Skip to content

Commit

Permalink
feat: Update handling of tools_strict to ensure compatibility with vL…
Browse files Browse the repository at this point in the history
…LM (#150)

* update handling of tools_strict

* Update haystack_experimental/components/generators/chat/openai.py

Co-authored-by: Julian Risch <[email protected]>

---------

Co-authored-by: Julian Risch <[email protected]>
  • Loading branch information
Emil-io and julian-risch authored Dec 10, 2024
1 parent ef75823 commit 7ade6a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion haystack_experimental/components/generators/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,10 @@ def _prepare_api_call( # noqa: PLR0913
openai_tools = [
{
"type": "function",
"function": {**t.tool_spec, "strict": tools_strict},
"function": {
**t.tool_spec,
**({"strict": tools_strict} if tools_strict is not None else {}),
},
}
for t in tools
]
Expand Down

0 comments on commit 7ade6a2

Please sign in to comment.