Spaces:
Runtime error
Runtime error
Commit
·
9aebcc2
1
Parent(s):
717cc4f
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,22 @@ import openai
|
|
4 |
openai.api_key = "<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>"
|
5 |
TELEGRAM_API_TOKEN = "<6074730982:AAGKU2_gpogdkTQvmE4Ya63n9ot2dHVzA7I>"
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def text_message(update, context):
|
8 |
-
response = openai.
|
9 |
-
|
10 |
-
|
|
|
11 |
)
|
12 |
-
update.message.reply_text(response
|
13 |
|
14 |
|
15 |
updater = Updater(TELEGRAM_API_TOKEN, use_context=True)
|
|
|
4 |
openai.api_key = "<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>"
|
5 |
TELEGRAM_API_TOKEN = "<6074730982:AAGKU2_gpogdkTQvmE4Ya63n9ot2dHVzA7I>"
|
6 |
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
from telegram.ext import Updater, MessageHandler, Filters
|
11 |
+
import openai
|
12 |
+
|
13 |
+
openai.api_key = "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"
|
14 |
+
TELEGRAM_API_TOKEN = "6074730982:AAGKU2_gpogdkTQvmE4Ya63n9ot2dHVzA7I"
|
15 |
+
|
16 |
def text_message(update, context):
|
17 |
+
response = openai.Completion.create(
|
18 |
+
engine="davinci",
|
19 |
+
prompt="Hello, world!",
|
20 |
+
max_tokens=5
|
21 |
)
|
22 |
+
update.message.reply_text(response.choices[0].text)
|
23 |
|
24 |
|
25 |
updater = Updater(TELEGRAM_API_TOKEN, use_context=True)
|