You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error occurs when creating consecutive AI messages with tool calls followed by Tool Messages:
400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.0.tool_use.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'"}}
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.0.tool_use.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'"}}
at APIError.generate (file:///node_modules/@anthropic-ai/sdk/error.mjs:36:20)
at Anthropic.makeStatusError (file:///node_modules/@anthropic-ai/sdk/core.mjs:256:25)
at Anthropic.makeRequest (file:///node_modules/@anthropic-ai/sdk/core.mjs:299:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RetryOperation._fn (/node_modules/p-retry/index.js:50:12
And another Tool message with response:
tool name: authenticate_user
tool id : toolu_01D1GYt1s5UhtKd2dNQydjY5
"Authenticated"
Running this generates the error above mentioned.
I have tried changing the tools names as the error suggests and tried changing the order of tools but nothing changed.
Both tools work when there is no consecutive tool.
Screenshot with initial AI and Tool Message:
Screenshot with The consecutive Ai and Tool Messages:
Screenshot with Error:
Suggestion:
No response
The text was updated successfully, but these errors were encountered:
I'm not entirely sure why the model is adding the space, since the schema provided seems to be correct. Will check on our side if anything is fishy
{"name":"authenticate_user","description":"This tool authenticates the current user, so tools that use the solar API will be able to fetch the user data. You must use this tool if the user is actually not authenticated or if some other tool failed with auth issues.","input_schema":{"type":"object","properties":{"cpf_or_cnpj":{"type":"string","description":"User cpf or cnpj value."},"password":{"type":"string","description":"User password"}},"required":["cpf_or_cnpj","password"]}}
Issue you'd like to raise.
The following error occurs when creating consecutive AI messages with tool calls followed by Tool Messages:
400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.0.tool_use.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'"}}
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.0.tool_use.name: String should match pattern '^[a-zA-Z0-9_-]{1,64}$'"}}
at APIError.generate (file:///node_modules/@anthropic-ai/sdk/error.mjs:36:20)
at Anthropic.makeStatusError (file:///node_modules/@anthropic-ai/sdk/core.mjs:256:25)
at Anthropic.makeRequest (file:///node_modules/@anthropic-ai/sdk/core.mjs:299:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RetryOperation._fn (/node_modules/p-retry/index.js:50:12
Steps to Reproduce:
Provider: ChatAnthropic
Model: claude-3-5-sonnet-20240620
tool name: getOrderData
tool id : toolu_018kq2eUEPncj2jBeEodys4Q
tool name: getOrderData
tool id: toolu_018kq2eUEPncj2jBeEodys4Q
Note: Works fine until this point.
tool name: authenticate_user
tool id : toolu_01D1GYt1s5UhtKd2dNQydjY5
tool name: authenticate_user
tool id : toolu_01D1GYt1s5UhtKd2dNQydjY5
Running this generates the error above mentioned.
I have tried changing the tools names as the error suggests and tried changing the order of tools but nothing changed.
Both tools work when there is no consecutive tool.
Screenshot with initial AI and Tool Message:
Screenshot with The consecutive Ai and Tool Messages:
Screenshot with Error:
Suggestion:
No response
The text was updated successfully, but these errors were encountered: