diff --git a/packages/editor/src/integrations/ai/openai.ts b/packages/editor/src/integrations/ai/openai.ts index 56209a4a..89d46389 100644 --- a/packages/editor/src/integrations/ai/openai.ts +++ b/packages/editor/src/integrations/ai/openai.ts @@ -1,10 +1,10 @@ import { OpenAIStream, StreamingTextResponse } from "ai"; -import { ChatCompletionCreateParamsBase, OpenAI } from "openai"; +import { OpenAI } from "openai"; export async function queryOpenAI(parameters: { - messages: ChatCompletionCreateParamsBase["messages"]; - functions?: ChatCompletionCreateParamsBase["functions"]; - function_key?: ChatCompletionCreateParamsBase["function_key"]; + messages: OpenAI.Chat.ChatCompletionCreateParams["messages"]; + functions?: OpenAI.Chat.ChatCompletionCreateParams["functions"]; + function_call?: OpenAI.Chat.ChatCompletionCreateParams["function_call"]; }) { // get key from localstorage let key = localStorage.getItem("oai-key"); diff --git a/packages/frame/src/ai/ai.ts b/packages/frame/src/ai/ai.ts index 75f21c52..8eb3a514 100644 --- a/packages/frame/src/ai/ai.ts +++ b/packages/frame/src/ai/ai.ts @@ -2,7 +2,7 @@ import "@blocknote/core/style.css"; import * as mobx from "mobx"; import * as monaco from "monaco-editor"; -import { ChatCompletionMessageParam } from "openai"; +import type openai from "openai"; import { BlockNoteEditor } from "@blocknote/core"; import { HostBridgeMethods } from "@typecell-org/shared"; @@ -260,7 +260,7 @@ type ExpandRecursively = T extends object }` : undefined; - const messages: Array = [ + const messages: openai.Chat.ChatCompletionCreateParams["messages"] = [ { role: "system", content: TYPECELL_PROMPT,