refactor: use LocalPromptRegistry for prompt template overrides

What does this merge request do and why?

refactor: use LocalPromptRegistry for prompt template overrides

When the request includes a custom prompt, the end goal is to use it as the system prompt. We currently achieve this by creating an InMemoryPromptRegistry and emulating the behavior of ChatAgentPromptTemplate and the prompt yml files. Instead, we introduce here a system_template_override jinja variable, which allows us to go back to relying on the main registry/prompt logic, which avoids unreliable behavior when we bypass it (for example #1596 (closed))

How to set up and validate locally

This problem arises only with custom agents in chat, so you should create a new custom agent, add it to a project, open duo chat, use this new custom agent, and select the model as a Vertex model.

Before: Fails with TypeError: AsyncMessages.create() got an unexpected keyword argument 'custom_llm_provider'

After: Chat completes successfully

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
  • If this change requires executor implementation: verified that issues/MRs exist for both Go executor and Node executor or confirmed that changes are backward-compatible and don't break existing executor functionality.

Related to #1596 (closed)

Edited by Martin Wortschack

Merge request reports

Loading