randydev commited on
Commit
d9d0030
·
verified ·
1 Parent(s): f9c2377

Update Akeno/utils/chat.py

Browse files
Files changed (1) hide show
  1. Akeno/utils/chat.py +37 -0
Akeno/utils/chat.py CHANGED
@@ -29,6 +29,43 @@ a short and concise answer. Give short step-by-step reasoning if required.
29
  Today is {dt.now():%A %d %B %Y %H:%M}
30
  """
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  async def chat_message(question):
33
  clients_x = Clients_g4f()
34
  response = clients_x.chat.completions.create(
 
29
  Today is {dt.now():%A %d %B %Y %H:%M}
30
  """
31
 
32
+ create_pyrogram_base = f"""
33
+ to create pyrogram library [PYTHON]
34
+
35
+ - replace other custom commands
36
+ - add comment #
37
+ - do not use java, c++, javascript
38
+ - do not use telethon
39
+
40
+ from pyrogram import Client, filters
41
+ from pyrogram.erros import *
42
+ from Akeno.utils.handler import *
43
+ from config import *
44
+
45
+ @Akeno(
46
+ ~filters.scheduled
47
+ & filters.command(["custom"], CMD_HANDLER)
48
+ & filters.me
49
+ & ~filters.forwarded
50
+ )
51
+ async def example(client: Client, message: Message):
52
+ pass
53
+
54
+ Today is {dt.now():%A %d %B %Y %H:%M}
55
+ """
56
+
57
+ async def chat_message_codegen(question):
58
+ clients_x = Clients_g4f()
59
+ response = clients_x.chat.completions.create(
60
+ model="gpt-4o",
61
+ messages=[
62
+ {"role": "system", "content": create_pyrogram_base},
63
+ {"role": "user", "content": question}
64
+ ],
65
+ )
66
+ messager = response.choices[0].message.content
67
+ return messager
68
+
69
  async def chat_message(question):
70
  clients_x = Clients_g4f()
71
  response = clients_x.chat.completions.create(