mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
Wrong value
This commit is contained in:
parent
1b80fd276e
commit
41d1a15ea8
1 changed files with 3 additions and 12 deletions
|
|
@ -60,7 +60,7 @@ async def gemini_chatbot(_, ctx: Message, strings):
|
||||||
|
|
||||||
@app.on_message(filters.command("ask", COMMAND_HANDLER) & pyro_cooldown.wait(10))
|
@app.on_message(filters.command("ask", COMMAND_HANDLER) & pyro_cooldown.wait(10))
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
async def openai_chatbot(_, ctx: Message, strings):
|
async def openai_chatbot(self, ctx: Message, strings):
|
||||||
if len(ctx.command) == 1:
|
if len(ctx.command) == 1:
|
||||||
return await ctx.reply_msg(
|
return await ctx.reply_msg(
|
||||||
strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5
|
strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5
|
||||||
|
|
@ -79,20 +79,11 @@ async def openai_chatbot(_, ctx: Message, strings):
|
||||||
try:
|
try:
|
||||||
response = await ai.chat.completions.create(
|
response = await ai.chat.completions.create(
|
||||||
model="gpt-4o-mini",
|
model="gpt-4o-mini",
|
||||||
messages=[
|
messages=[{"role": "user", "content": pertanyaan}]
|
||||||
{
|
|
||||||
"role": "user",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": pertanyaan
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
],
|
|
||||||
temperature=0.7,
|
temperature=0.7,
|
||||||
stream=True,
|
stream=True,
|
||||||
)
|
)
|
||||||
|
self.log.info
|
||||||
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:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue