Преглед изворни кода

[2.8.1] Désactivation du stream pour l'analyse d'images

Penta пре 1 месец
родитељ
комит
a56eeaba73
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      chatbot.py

+ 5 - 1
chatbot.py

@@ -257,6 +257,7 @@ async def call_for_image_analysis(image_data, user_name, user_text=None, detail=
 
     analysis = await openai_client.chat.completions.create(
         model=MODEL,
+        stream=False,
         messages=messages,
         temperature=TEMPERATURE
     )
@@ -272,7 +273,10 @@ async def call_openai_api(user_text, user_name, detail='high'):
     message_to_send = {
         "role": "user",
         "content": [
-            {"type": "text", "text": f"{user_name} dit : {transform_emote(user_text, False)}"}
+            {
+                "type": "text",
+                "text": f"{user_name} dit : {transform_emote(user_text, False)}"
+            }
         ]
     }