From 516bacc6da25efb7050efc7e90b6308dade9f92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Tue, 21 Jan 2025 17:59:18 +0100 Subject: [PATCH] fix: LLM call crash when no tools See #399 --- app/helpers/llm_worker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/llm_worker.py b/app/helpers/llm_worker.py index adb532e..955ccf8 100644 --- a/app/helpers/llm_worker.py +++ b/app/helpers/llm_worker.py @@ -148,7 +148,9 @@ async def _completion_stream_worker( max_tokens=max_tokens, messages=prompt, stream=True, - tools=tools, + # AI Inference API doesn't support enpty tools array + # See: https://github.com/microsoft/call-center-ai/issues/399 + tools=tools or None, ) # Yield chuncks