forked from Pavel_Durov/python_bot
fix replys
This commit is contained in:
parent
fc437530e4
commit
1f31c5155b
@ -3,6 +3,7 @@ from aiogram import types, Dispatcher
|
|||||||
from create_bot import dp, bot
|
from create_bot import dp, bot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
token = '5947963644:AAF_GKgMmU5ovqMpc1KXIpcf4aN0JMyKPqc'
|
token = '5947963644:AAF_GKgMmU5ovqMpc1KXIpcf4aN0JMyKPqc'
|
||||||
#openai.api_key = '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'
|
#openai.api_key = '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'
|
||||||
openai.api_key = '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'
|
openai.api_key = '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'
|
||||||
@ -15,7 +16,7 @@ async def send(message: types.Message):
|
|||||||
## TODO уточнить остатки токенов и денег
|
## TODO уточнить остатки токенов и денег
|
||||||
response = openai.Completion.create(
|
response = openai.Completion.create(
|
||||||
model="text-davinci-003",
|
model="text-davinci-003",
|
||||||
prompt=message.text,
|
prompt=message.text[7:],
|
||||||
temperature=0.7,
|
temperature=0.7,
|
||||||
max_tokens=1000,
|
max_tokens=1000,
|
||||||
top_p=1.0,
|
top_p=1.0,
|
||||||
@ -25,18 +26,18 @@ async def send(message: types.Message):
|
|||||||
)
|
)
|
||||||
await message.reply(response['choices'][0]['text'])
|
await message.reply(response['choices'][0]['text'])
|
||||||
|
|
||||||
# elif message.reply_to_message.bot:
|
elif message.reply_to_message.from_id:
|
||||||
# response = openai.Completion.create(
|
response = openai.Completion.create(
|
||||||
# model="text-davinci-003",
|
model="text-davinci-003",
|
||||||
# prompt=message.text,
|
prompt=message.text,
|
||||||
# temperature=0.7,
|
temperature=0.7,
|
||||||
# max_tokens=1000,
|
max_tokens=1000,
|
||||||
# top_p=1.0,
|
top_p=1.0,
|
||||||
# frequency_penalty=0.0,
|
frequency_penalty=0.0,
|
||||||
# presence_penalty=0.6,
|
presence_penalty=0.6,
|
||||||
# stop=["сброс"]
|
stop=["сброс"]
|
||||||
# )
|
)
|
||||||
# await message.reply(response['choices'][0]['text'])
|
await message.reply(response['choices'][0]['text'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user