Skip to content

Commit 3831f03

Browse files
committed
Improve formatting of LLM usage prompt.
1 parent b583fd7 commit 3831f03

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/async/ollama/toolbox.rb

+8-10
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,26 @@ class Toolbox
2424
PROMPT = "You have access to the following tools, which you can invoke by replying with a single line of valid JSON:\n\n"
2525

2626
USAGE = <<~EOF
27-
- Use these tools to enhance your ability to answer user queries accurately.
27+
Use these tools to enhance your ability to answer user queries accurately.
2828
29-
- When you need to use a tool to answer the user's query, respond **only** with the JSON invocation.
29+
When you need to use a tool to answer the user's query, respond **only** with the JSON invocation.
3030
- Example: {"tool":"ruby", "code": "5+5"}
3131
- **Do not** include any explanations, greetings, or additional text when invoking a tool.
3232
- If you are dealing with numbers, ensure you provide them as Integers or Floats, not Strings.
3333
34-
- After invoking a tool:
34+
After invoking a tool:
3535
1. You will receive the tool's result as the next input.
3636
2. Use the result to formulate a direct, user-friendly response that answers the original query.
3737
3. Assume the user is unaware of the tool invocation or its result, so clearly summarize the answer without referring to the tool usage or the response it generated.
3838
39-
- Continue the conversation naturally after providing the answer. Ensure your responses are concise and user-focused.
39+
Continue the conversation naturally after providing the answer. Ensure your responses are concise and user-focused.
4040
4141
## Example Flow:
4242
43-
- User: "Why doesn't 5 + 5 equal 11?"
44-
- Assistant (invokes tool): {"tool": "ruby", "code": "5+5"}
45-
- (Tool Result): 10
46-
- Assistant: "The result of 5 + 5 is 10, because addition follows standard arithmetic rules."
47-
48-
Remember, invoke tools silently and use their results seamlessly in your responses to the user.
43+
User: "Why doesn't 5 + 5 equal 11?"
44+
Assistant (invokes tool): {"tool": "ruby", "code": "5+5"}
45+
(Tool Result): 10
46+
Assistant: "The result of 5 + 5 is 10, because addition follows standard arithmetic rules."
4947
EOF
5048

5149
def initialize

0 commit comments

Comments
 (0)