From b16f4e0317de38a8fb28d4cb0b0801c6fd3eee5f Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 21 Sep 2024 05:58:52 +1000 Subject: [PATCH] [8.x] [Simulated function calling] specify that only one tool call can be performed at a time (#193556) (#193627) # Backport This will backport the following commits from `main` to `8.x`: - [[Simulated function calling] specify that only one tool call can be performed at a time (#193556)](https://github.com/elastic/kibana/pull/193556) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Pierre Gayvallet --- .../simulated_function_calling/get_system_instructions.ts | 3 +++ .../get_system_message_instructions.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/x-pack/plugins/inference/server/chat_complete/simulated_function_calling/get_system_instructions.ts b/x-pack/plugins/inference/server/chat_complete/simulated_function_calling/get_system_instructions.ts index 848b8d1f44f07..abfc48dfa2ef2 100644 --- a/x-pack/plugins/inference/server/chat_complete/simulated_function_calling/get_system_instructions.ts +++ b/x-pack/plugins/inference/server/chat_complete/simulated_function_calling/get_system_instructions.ts @@ -32,6 +32,9 @@ export function getSystemMessageInstructions({ IMPORTANT: make sure you start and end a tool call with the ${TOOL_USE_START} and ${TOOL_USE_END} markers, it MUST be included in the tool call. + You can only call A SINGLE TOOL at a time. Do not call multiple tools, or multiple times the same tool, in the same + response. + You may call tools like this: ${TOOL_USE_START} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/adapters/simulate_function_calling/get_system_message_instructions.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/adapters/simulate_function_calling/get_system_message_instructions.ts index c80ac022ca6c0..eaf89233a2bcd 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/adapters/simulate_function_calling/get_system_message_instructions.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/adapters/simulate_function_calling/get_system_message_instructions.ts @@ -33,6 +33,9 @@ export function getSystemMessageInstructions({ IMPORTANT: make sure you start and end a tool call with the ${TOOL_USE_START} and ${TOOL_USE_END} markers, it MUST be included in the tool call. + You can only call A SINGLE TOOL at a time. Do not call multiple tools, or multiple times the same tool, in the same + response. + You may call tools like this: ${TOOL_USE_START}