diff --git a/lisette/core.py b/lisette/core.py index 8568f84..78efaa6 100644 --- a/lisette/core.py +++ b/lisette/core.py @@ -282,7 +282,7 @@ def _trunc_str(s, mx=2000, replace=""): return s+replace # %% ../nbs/00_core.ipynb -_final_prompt = dict(role="user", content="You have no more tool uses. Please summarize your findings. If you did not complete your goal please tell the user what further work needs to be done so they can choose how best to proceed.") +_final_prompt = dict(role="user", content="You have used all your tool calls for this turn. Please summarize your findings. If you did not complete your goal, tell the user what further work is needed. You may use tools again on the next user message.") _cwe_msg = "ContextWindowExceededError: Do no more tool calls and complete your response now. Inform user that you ran out of context and explain what the cause was. This is the response to this tool call, truncated if needed: " diff --git a/nbs/00_core.ipynb b/nbs/00_core.ipynb index ceaa9cd..0cd744b 100644 --- a/nbs/00_core.ipynb +++ b/nbs/00_core.ipynb @@ -2653,7 +2653,7 @@ "outputs": [], "source": [ "#| export\n", - "_final_prompt = dict(role=\"user\", content=\"You have no more tool uses. Please summarize your findings. If you did not complete your goal please tell the user what further work needs to be done so they can choose how best to proceed.\")\n", + "_final_prompt = dict(role=\"user\", content=\"You have used all your tool calls for this turn. Please summarize your findings. If you did not complete your goal, tell the user what further work is needed. You may use tools again on the next user message.\")\n", "\n", "_cwe_msg = \"ContextWindowExceededError: Do no more tool calls and complete your response now. Inform user that you ran out of context and explain what the cause was. This is the response to this tool call, truncated if needed: \"" ] @@ -3063,7 +3063,7 @@ "\n", "{'tool_call_id': 'call_0-v0en5bTn_cpUmdAErlRQ', 'role': 'tool', 'name': 'simple_add', 'content': '12'}\n", "\n", - "{'role': 'user', 'content': 'You have no more tool uses. Please summarize your findings. If you did not complete your goal please tell the user what further work needs to be done so they can choose how best to proceed.'}\n", + "{'role': 'user', 'content': 'You have used all your tool calls for this turn. Please summarize your findings. If you did not complete your goal, tell the user what further work is needed. You may use tools again on the next user message.'}\n", "\n", "Message(content=\"I used the tool to calculate 5 + 7, and the result is 12.\\n\\nIf you have any more calculations or questions, please let me know how you'd like to proceed, as I currently cannot use additional tools.\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[])\n", "\n" @@ -3688,7 +3688,7 @@ "\n", "{'tool_call_id': 'call_xHDw5-dvT7i0EvwSrDIsEg', 'role': 'tool', 'name': 'simple_add', 'content': '12'}\n", "\n", - "{'role': 'user', 'content': 'You have no more tool uses. Please summarize your findings. If you did not complete your goal please tell the user what further work needs to be done so they can choose how best to proceed.'}\n", + "{'role': 'user', 'content': 'You have used all your tool calls for this turn. Please summarize your findings. If you did not complete your goal, tell the user what further work is needed. You may use tools again on the next user message.'}\n", "\n", "Message(content='Based on my calculations, I can summarize my findings.\\n\\nThe primary goal was to calculate 5 + 7. Using the tool, I found that **5 + 7 = 12**.\\n\\nIn addition to this, I also performed a calculation and found that **6 + 7 = 13**.\\n\\nThe initial goal of calculating 5 + 7 has been successfully completed. There is no further work that needs to be done to answer your original question.', role='assistant', tool_calls=None, function_call=None, images=[], thinking_blocks=[], provider_specific_fields=None)\n", "\n" @@ -3793,7 +3793,7 @@ " 'name': 'simple_add',\n", " 'content': '8'},\n", " {'role': 'user',\n", - " 'content': 'You have no more tool uses. Please summarize your findings. If you did not complete your goal please tell the user what further work needs to be done so they can choose how best to proceed.'},\n", + " 'content': 'You have used all your tool calls for this turn. Please summarize your findings. If you did not complete your goal, tell the user what further work is needed. You may use tools again on the next user message.'},\n", " Message(content='Based on my previous action, I used the `simple_add` tool to calculate the sum of 5 and 3.\\n\\n**Summary of Findings:**\\nThe result of 5 + 3 is 8.\\n\\nThe goal has been completed, and no further work is necessary for this request.', role='assistant', tool_calls=None, function_call=None, images=[], thinking_blocks=[], provider_specific_fields=None),\n", " {'role': 'user', 'content': 'Now, tell me a joke based on that result.'},\n", " Message(content='Of course!\\n\\nWhat did the number 0 say to the number 8?\\n\\n\"Nice belt!\"', role='assistant', tool_calls=None, function_call=None, images=[], thinking_blocks=[], provider_specific_fields=None)]"