Skip to content

Commit 7ade6a2

Browse files
feat: Update handling of tools_strict to ensure compatibility with vLLM (#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]>
1 parent ef75823 commit 7ade6a2

File tree

1 file changed

+4
-1
lines changed
  • haystack_experimental/components/generators/chat

1 file changed

+4
-1
lines changed

haystack_experimental/components/generators/chat/openai.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ def _prepare_api_call( # noqa: PLR0913
447447
openai_tools = [
448448
{
449449
"type": "function",
450-
"function": {**t.tool_spec, "strict": tools_strict},
450+
"function": {
451+
**t.tool_spec,
452+
**({"strict": tools_strict} if tools_strict is not None else {}),
453+
},
451454
}
452455
for t in tools
453456
]

0 commit comments

Comments
 (0)