Open rattrayalex opened 9 months ago
See https://github.com/openai/openai-node/issues/477
The docs here: https://deno.land/x/openai@v4.16.1/mod.ts?s=default.ChatCompletion
recommend this code:
import { type default } from "https://deno.land/x/openai@v4.16.1/mod.ts"; const { ChatCompletion } = default;
which cause this error:
Identifier expected.
The code should instead be this:
import type OpenAI from "https://deno.land/x/openai@v4.16.1/mod.ts"; type ChatCompletion = OpenAI.ChatCompletion
Which involves a few changes:
default
const
Ah, this should perhaps be merged into https://github.com/denoland/deno_doc/issues/395 …
See https://github.com/openai/openai-node/issues/477
The docs here: https://deno.land/x/openai@v4.16.1/mod.ts?s=default.ChatCompletion
recommend this code:
which cause this error:
The code should instead be this:
Which involves a few changes:
default
when possibleconst
for a type