Skip to content

Commit

Permalink
Wrong value
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirarism committed Aug 13, 2024
1 parent 1b80fd2 commit 41d1a15
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions misskaty/plugins/chatbot_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def gemini_chatbot(_, ctx: Message, strings):

@app.on_message(filters.command("ask", COMMAND_HANDLER) & pyro_cooldown.wait(10))
@use_chat_lang()
async def openai_chatbot(_, ctx: Message, strings):
async def openai_chatbot(self, ctx: Message, strings):
if len(ctx.command) == 1:
return await ctx.reply_msg(
strings("no_question").format(cmd=ctx.command[0]), quote=True, del_in=5
Expand All @@ -79,20 +79,11 @@ async def openai_chatbot(_, ctx: Message, strings):
try:
response = await ai.chat.completions.create(
model="gpt-4o-mini",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": pertanyaan
}
]
},
],
messages=[{"role": "user", "content": pertanyaan}]
temperature=0.7,
stream=True,
)
self.log.info
async for chunk in response:
if not chunk.choices or not chunk.choices[0].delta.content:
continue
Expand Down

0 comments on commit 41d1a15

Please sign in to comment.