Fix TypeError by replacing this.openai.createChatCompletion with the correct function call ()

fixed new api syntax
This commit is contained in:
Shahar 2024-08-15 00:39:48 +03:00 committed by GitHub
parent bdf37bf180
commit 4365d69359
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,7 @@ class HuggingFaceLLM {
}
async getChatCompletion(messages = null, { temperature = 0.7 }) {
const result = await this.openai.createChatCompletion({
const result = await this.openai.chat.completions.create({
model: this.model,
messages,
temperature,