mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Compare commits
2 commits
2dee32841c
...
8adfb935b5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8adfb935b5 | ||
|
|
264bd0f393 |
1 changed files with 6 additions and 4 deletions
|
|
@ -46,7 +46,7 @@ async def get_openai_stream_response(is_stream, key, base_url, model, messages,
|
||||||
disable_web_page_preview=True,
|
disable_web_page_preview=True,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await bmsg.edit_msg(f"{html.escape(answer)}\n<b>Powered by:</b> <code>Gemini 1.5 Flash</code>")
|
await bmsg.edit_msg(f"{html.escape(answer)}\n\n<b>Powered by:</b> <code>Gemini 3 Flash</code>")
|
||||||
else:
|
else:
|
||||||
async for chunk in response:
|
async for chunk in response:
|
||||||
if not chunk.choices or not chunk.choices[0].delta.content:
|
if not chunk.choices or not chunk.choices[0].delta.content:
|
||||||
|
|
@ -64,7 +64,7 @@ async def get_openai_stream_response(is_stream, key, base_url, model, messages,
|
||||||
disable_web_page_preview=True,
|
disable_web_page_preview=True,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await bmsg.edit_msg(f"{html.escape(answer)}\n\n<b>Powered by:</b> <code>GPT 4o</code>")
|
await bmsg.edit_msg(f"{html.escape(answer)}\n\n<b>Powered by:</b> <code>GPT 5</code>")
|
||||||
except APIConnectionError as e:
|
except APIConnectionError as e:
|
||||||
await bmsg.edit_msg(f"The server could not be reached because {e.__cause__}")
|
await bmsg.edit_msg(f"The server could not be reached because {e.__cause__}")
|
||||||
return None
|
return None
|
||||||
|
|
@ -104,7 +104,7 @@ async def gemini_chatbot(_, ctx: Message, strings):
|
||||||
gemini_conversations[uid] = [{"role": "system", "content": "Kamu adalah AI dengan karakter mirip kucing bernama MissKaty AI yang diciptakan oleh Yasir untuk membantu manusia mencari informasi dan gunakan bahasa sesuai yang saya katakan."}, {"role": "user", "content": ctx.input}]
|
gemini_conversations[uid] = [{"role": "system", "content": "Kamu adalah AI dengan karakter mirip kucing bernama MissKaty AI yang diciptakan oleh Yasir untuk membantu manusia mencari informasi dan gunakan bahasa sesuai yang saya katakan."}, {"role": "user", "content": ctx.input}]
|
||||||
else:
|
else:
|
||||||
gemini_conversations[uid].append({"role": "user", "content": ctx.input})
|
gemini_conversations[uid].append({"role": "user", "content": ctx.input})
|
||||||
ai_response = await get_openai_stream_response(False, GOOGLEAI_KEY, "https://gemini.yasirapi.eu.org/v1", "gemini-1.5-flash", gemini_conversations[uid], msg, strings)
|
ai_response = await get_openai_stream_response(False, GOOGLEAI_KEY, "https://gemini.yasirapi.eu.org/v1", "gemini-3-flash-preview", gemini_conversations[uid], msg, strings)
|
||||||
if not ai_response:
|
if not ai_response:
|
||||||
gemini_conversations[uid].pop()
|
gemini_conversations[uid].pop()
|
||||||
if len(gemini_conversations[uid]) == 1:
|
if len(gemini_conversations[uid]) == 1:
|
||||||
|
|
@ -134,10 +134,12 @@ async def openai_chatbot(self, ctx: Message, strings):
|
||||||
gptai_conversations[uid] = [{"role": "system", "content": "Kamu adalah AI dengan karakter mirip kucing bernama MissKaty AI yang diciptakan oleh Yasir untuk membantu manusia mencari informasi dan gunakan bahasa sesuai yang saya katakan."}, {"role": "user", "content": pertanyaan}]
|
gptai_conversations[uid] = [{"role": "system", "content": "Kamu adalah AI dengan karakter mirip kucing bernama MissKaty AI yang diciptakan oleh Yasir untuk membantu manusia mencari informasi dan gunakan bahasa sesuai yang saya katakan."}, {"role": "user", "content": pertanyaan}]
|
||||||
else:
|
else:
|
||||||
gptai_conversations[uid].append({"role": "user", "content": pertanyaan})
|
gptai_conversations[uid].append({"role": "user", "content": pertanyaan})
|
||||||
ai_response = await get_openai_stream_response(True, OPENAI_KEY, "https://models.inference.ai.azure.com", "gpt-4o-mini", gptai_conversations[uid], msg, strings)
|
ai_response = await get_openai_stream_response(True, OPENAI_KEY, "https://models.inference.ai.azure.com", "gpt-5-mini", gptai_conversations[uid], msg, strings)
|
||||||
if not ai_response:
|
if not ai_response:
|
||||||
gptai_conversations[uid].pop()
|
gptai_conversations[uid].pop()
|
||||||
if len(gptai_conversations[uid]) == 1:
|
if len(gptai_conversations[uid]) == 1:
|
||||||
gptai_conversations.pop(uid)
|
gptai_conversations.pop(uid)
|
||||||
return
|
return
|
||||||
gptai_conversations[uid].append({"role": "assistant", "content": ai_response})
|
gptai_conversations[uid].append({"role": "assistant", "content": ai_response})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue