import openai from "./zggpt";
const query = async (prompt:string, chatId:string, model:string) => {
const res= await openai
.createChatCompletion({
model,
prompt,
temperature: 0.9,
top_p:1,
max_tokens:1000,
frequency_penalty:0,
presence_penalty:0,
})
.then((res) => res.data.choices[0].text)
.catch((err)=>
`ZG was unable to find an answer for that!
(Error: ${err.message})`
);
return res;
};
export default query;
Property 'text' does not exist on type 'CreateChatCompletionResponseChoicesInner'.ts(2339)
Argument of type '{ model: string; prompt: string; temperature: number; top_p: number; max_tokens: number; frequency_penalty: number; presence_penalty: number; }' is not assignable to parameter of type 'CreateChatCompletionRequest'. Object literal may only specify known properties, and 'prompt' does not exist in type 'CreateChatCompletionRequest'.ts(2345)
even though I do everything as in the video, I get these errors.
i'm a beginner in coding, so I'm trying to make applications based on videos to learn.
Thanks
the application responds without returning an error. enter image description here