Thanks Google for not using standards.

This commit is contained in:
Patrick_Pluto 2024-09-24 09:27:36 +02:00
parent 65ddc69be7
commit 778bfd632e

View file

@ -93,11 +93,14 @@ class AI:
msg['role'] = 'model' msg['role'] = 'model'
genai.configure(api_key=api_key) genai.configure(api_key=api_key)
model = genai.GenerativeModel("gemini-1.5-flash")
model = genai.GenerativeModel(model)
chat = model.start_chat( chat = model.start_chat(
system_instruction=system, system_instruction=system,
history=[ history=messages
{"role": "user", "parts": "Hello"},
{"role": "model", "parts": "Great to meet you. What would you like to know?"},
]
) )
response = chat.send_message(message, stream=True)
for chunk in response:
return_class.ai_response[access_token] += chunk.text