mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(llm): use anthropic.Omit instead of NotGiven for tools parameter
The Anthropic SDK messages.create expects Omit (not NotGiven) for the tools parameter. Use anthropic.omit sentinel value to match the expected type.
This commit is contained in:
@@ -407,12 +407,12 @@ class LLMResponse(BaseModel):
|
||||
|
||||
def convert_openai_tool_fmt_to_anthropic(
|
||||
openai_tools: list[dict] | None = None,
|
||||
) -> Iterable[ToolUnionParam] | anthropic.NotGiven:
|
||||
) -> Iterable[ToolUnionParam] | anthropic.Omit:
|
||||
"""
|
||||
Convert OpenAI tool format to Anthropic tool format.
|
||||
"""
|
||||
if not openai_tools or len(openai_tools) == 0:
|
||||
return anthropic.NOT_GIVEN
|
||||
return anthropic.omit
|
||||
|
||||
anthropic_tools = []
|
||||
for tool in openai_tools:
|
||||
|
||||
Reference in New Issue
Block a user