Skip to content

Commit 24bd449

Browse files
committed
fix: update method to match openai model
1 parent a842d62 commit 24bd449

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/client.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import crud from '@cocreate/crud-client'
22
import Actions from '@cocreate/actions'
33

4-
const apiUrl = 'https://api.openai.com/v1/chat/completions';
54
const model = 'gpt-4-1106-preview'
65
const max_tokens = 3300;
76
const temperature = 0.6;
@@ -63,7 +62,7 @@ const componentsReference = {
6362
async function send(conversation) {
6463
try {
6564
let data = await crud.socket.send({
66-
method: 'openai.chat',
65+
method: 'openai.chat.completions.create',
6766
action: 'chat',
6867
chat: {
6968
messages: conversation,

src/server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const OpenAI = require('openai')
22

3-
const name = 'openai'
4-
53
async function send(data) {
64
let openai = false;
75

0 commit comments

Comments
 (0)