ora_test.py 765 B

1234567891011121314151617181920212223242526272829
  1. # inport ora
  2. import ora
  3. # create model
  4. model = ora.CompletionModel.create(
  5. system_prompt = 'You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible',
  6. description = 'ChatGPT Openai Language Model',
  7. name = 'gpt-3.5')
  8. print(model.id)
  9. # init conversation (will give you a conversationId)
  10. init = ora.Completion.create(
  11. model = model,
  12. prompt = 'hello world')
  13. print(init.completion.choices[0].text)
  14. while True:
  15. # pass in conversationId to continue conversation
  16. prompt = input('>>> ')
  17. response = ora.Completion.create(
  18. model = model,
  19. prompt = prompt,
  20. includeHistory = True,
  21. conversationId = init.id)
  22. print(response.completion.choices[0].text)
粤ICP备19079148号