From 212aa228ab006c3a982f0f5781ba4e65c235b4e8 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Tue, 19 Mar 2024 10:30:58 -0400 Subject: [PATCH] fix bug with using enum as string --- backend/llm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/llm.py b/backend/llm.py index dba5720..2c529e2 100644 --- a/backend/llm.py +++ b/backend/llm.py @@ -35,7 +35,12 @@ async def stream_openai_response( model = Llm.GPT_4_VISION # Base parameters - params = {"model": model, "messages": messages, "stream": True, "timeout": 600} + params = { + "model": model.value, + "messages": messages, + "stream": True, + "timeout": 600, + } # Add 'max_tokens' only if the model is a GPT4 vision model if model == Llm.GPT_4_VISION: