diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts index a0ae72ea2083c..8d6566ab2e782 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts @@ -16,4 +16,6 @@ export const GEMINI_SYSTEM_PROMPT = "The final response is the only output the user sees and should be a complete answer to the user's question. Do not leave out important tool output. The final response should never be empty. Don't forget to use tools."; export const BEDROCK_SYSTEM_PROMPT = `Use tools as often as possible, as they have access to the latest data and syntax. Always return value from ESQLKnowledgeBaseTool as is. Never return tags in the response, but make sure to include tags content in the response. Do not reflect on the quality of the returned search results in your response.`; -export const VERTEX_SYSTEM_PROMPT = `ALWAYS use the provided tools, as they have access to the latest data and syntax.`; +export const VERTEX_SYSTEM_PROMPT = + `ALWAYS use the provided tools, as they have access to the latest data and syntax.` + + "Do not alter the tool response. The final response will be the only output the user sees and should be a complete answer to the user's question, as if you were responding to the user's initial question."; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts index eb52c227421fc..0e05cdb31c551 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts @@ -9,7 +9,7 @@ import { ChatPromptTemplate } from '@langchain/core/prompts'; import { BEDROCK_SYSTEM_PROMPT, DEFAULT_SYSTEM_PROMPT, - GEMINI_SYSTEM_PROMPT, + VERTEX_SYSTEM_PROMPT, } from './nodes/translations'; export const formatPrompt = (prompt: string, additionalPrompt?: string) => @@ -23,7 +23,7 @@ export const formatPrompt = (prompt: string, additionalPrompt?: string) => export const systemPrompts = { openai: DEFAULT_SYSTEM_PROMPT, bedrock: `${DEFAULT_SYSTEM_PROMPT} ${BEDROCK_SYSTEM_PROMPT}`, - gemini: `${DEFAULT_SYSTEM_PROMPT} ${GEMINI_SYSTEM_PROMPT}`, + gemini: `${DEFAULT_SYSTEM_PROMPT} ${VERTEX_SYSTEM_PROMPT}`, structuredChat: `Respond to the human as helpfully and accurately as possible. You have access to the following tools: {tools}