Update ora_gpt4.py

This commit is contained in:
t.me/xtekky 2023-04-23 16:53:18 +01:00
parent 1be1e440fd
commit 99d36a7753

View File

@ -25,3 +25,16 @@ model = ora.CompletionModel.load(chatbot_id, 'gpt-4')
response = ora.Completion.create(model, 'hello') response = ora.Completion.create(model, 'hello')
print(response.completion.choices[0].text) print(response.completion.choices[0].text)
conversation_id = response.id
while True:
# pass in conversationId to continue conversation
prompt = input('>>> ')
response = ora.Completion.create(
model = model,
prompt = prompt,
includeHistory = True, # remember history
conversationId = conversation_id)
print(response.completion.choices[0].text)