From c72dff5879ac289f6102dff5517ea0cfad59dd72 Mon Sep 17 00:00:00 2001 From: Andriy Semenets Date: Fri, 5 Apr 2024 15:44:00 +0200 Subject: [PATCH] Fix an issue with incorrect tools using openai --- backend/providers/openai.go | 2 +- backend/templates/prompts/agent.tmpl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/providers/openai.go b/backend/providers/openai.go index f73ce65..3be6830 100644 --- a/backend/providers/openai.go +++ b/backend/providers/openai.go @@ -59,7 +59,7 @@ func (p OpenAIProvider) NextTask(args NextTaskOptions) *database.Task { promptArgs := map[string]interface{}{ "DockerImage": args.DockerImage, - "ToolPlaceholder": getToolPlaceholder(), + "ToolPlaceholder": "Always use your function calling functionality, instead of returning a text result.", "Tasks": args.Tasks, } diff --git a/backend/templates/prompts/agent.tmpl b/backend/templates/prompts/agent.tmpl index 3753e42..9b474a7 100644 --- a/backend/templates/prompts/agent.tmpl +++ b/backend/templates/prompts/agent.tmpl @@ -17,6 +17,7 @@ Always use your function calling functionality instead of returning JSON. Always include a `message` field that describes what you are planning to achieve with this command. Use conversation-like (chat) style of communication. For example: "My plan is to read the documentation. Looking for it on the web.", "Let me try to use the terminal to do that.", or "It seems like I'm having issues with npm. Are you sure it's installed?". The `message` field is always shown to the user, so you have to communicate clearly. It's mandatory to have it. +Try to ask for confirmation as little as possible. Confirm only important things or when you are completely lost. These are the possible types of commands for your next steps and their arguments: