The default model of completion = text-davinci-003 doesn't work more.
Your sample :
var Completions := OpenAI.Completion.Create(
procedure(Params: TCompletionParams)
begin
Params.Prompt(MemoPrompt.Text);
Params.MaxTokens(2048);
end);
try
for var Choice in Completions.Choices do
MemoChat.Lines.Add(Choice.Index.ToString + ' ' + Choice.Text);
finally
Completions.Free;
end;
Will return :
Exception OpenAIExceptionInvalidRequestError with the message 'The model text-davinci-003 has been deprecated, learn more here: https://platform.openai.com/docs/deprecations'.
Because of by default:
OpenAI.complmetion :
constructor TCompletionParams.Create;
begin
inherited;
Model('text-davinci-003');
Temperature(0);
end;
Maybe replaced by :
constructor TCompletionParams.Create;
begin
inherited;
Model('gpt-3.5-turbo-instruct');
//Model('text-davinci-003');
Temperature(0);
end;
`
Of course ovveride params.model can be a workarround :
var Completions := OpenAI.Completion.Create(
procedure(Params: TCompletionParams)
begin
Params.Prompt(MemoPrompt.Text);
Params.MaxTokens(2048);
Params.model('gpt-3.5-turbo-instruct'); // HERE
end);
try
for var Choice in Completions.Choices do
MemoChat.Lines.Add(Choice.Index.ToString + ' ' + Choice.Text);
finally
Completions.Free;
end;`
Hello,
The default model of completion =
text-davinci-003
doesn't work more.Your sample :
Will return : Exception OpenAIExceptionInvalidRequestError with the message 'The model
text-davinci-003
has been deprecated, learn more here: https://platform.openai.com/docs/deprecations'.Because of by default: OpenAI.complmetion :
Maybe replaced by :
Of course ovveride params.model can be a workarround :