Hey @sega look at the error:
Whe we use the tool_choice parameter like OpenAI we get this error:
BadRequestError: Error code: 400 - anthropic error: tool_choice may only be specified while providing tools.
This is the code:
prompt_completion = portkey.prompts.completions.create(
prompt_id="pp-sql-21c0ac",
variables={"user_query":f"{query}"},
tools=tool_sql,
tool_choice="required",
max_tokens=1660
)
prompt_completion
How ever when whe change the format to Anthropic:
tool_choice={"type":"tool", "name":"sql_generator"},
We get:
InternalServerError: {"status":"failure","message":"Something went wrong"}