This commit is contained in:
Patrick_Pluto 2024-09-20 09:17:00 +02:00
parent 7bf91cdf7e
commit eb8fef13ff
2 changed files with 4 additions and 0 deletions

Binary file not shown.

View file

@ -12,6 +12,8 @@ class AI:
options={"temperature": 0.8}, options={"temperature": 0.8},
) )
return_class.ai_response[access_token] = ""
for chunk in stream: for chunk in stream:
print(chunk['message']['content']) print(chunk['message']['content'])
return_class.ai_response[access_token] += chunk['message']['content'] return_class.ai_response[access_token] += chunk['message']['content']
@ -28,5 +30,7 @@ class AI:
messages=messages messages=messages
) )
return_class.ai_response[access_token] = ""
for chunk in stream_response: for chunk in stream_response:
return_class.ai_response[access_token] += chunk.data.choices[0].delta.content return_class.ai_response[access_token] += chunk.data.choices[0].delta.content