praxisdigital / assignsubmission_pxaiwriter

1 stars 2 forks source link

Switch to gpt-3.5 api #6

Closed TubsDK closed 1 year ago

TubsDK commented 1 year ago

We need to move to the gpt-3.5 model

https://platform.openai.com/docs/api-reference/chat/create

This means added a few settings in site admin so that the user can choose to use gpt-3.5

It also means that the syntax must be slightly altereret into the chat format: https://platform.openai.com/docs/guides/chat/chat-vs-completions

[ {"role": "system", "content": "Du er en hjælpsom AI-asissisten, der skal hjælpe en studerende med at løse en opgave."}, {"role": "user", "content": '{text}'} ]

List of model endpoint compatibility: https://platform.openai.com/docs/models/model-endpoint-compatibility

IMPORTANT:

Chat completion API is still in beta. This change is breaking mod_smartlink. This cannot test without refactor OpenAI API handler behavior in mod_smartlink.

TODO:

sampraxis commented 1 year ago

This should be close together with #1 when it has passed the test.