import { APIPromise } from "https://deno.land/x/openai@v4.69.0/core.ts";
A subclass of Promise
providing additional helper methods
for interacting with the SDK.
Constructors
Properties
Methods
Gets the raw Response
instance instead of parsing the response
data.
If you want to parse the response body but still get the Response
instance, you can use withResponse().
👋 Getting the wrong TypeScript type for Response
?
Try setting "moduleResolution": "NodeNext"
if you can,
or add one of these imports before your first import … from 'openai'
:
import 'openai/shims/node'
(if you're running on Node)import 'openai/shims/web'
(otherwise)
Gets the parsed response data, the raw Response
instance and the ID of the request,
returned via the X-Request-ID header which is useful for debugging requests and reporting
issues to OpenAI.
If you just want to get the raw Response
instance without parsing it,
you can use asResponse().
👋 Getting the wrong TypeScript type for Response
?
Try setting "moduleResolution": "NodeNext"
if you can,
or add one of these imports before your first import … from 'openai'
:
import 'openai/shims/node'
(if you're running on Node)import 'openai/shims/web'
(otherwise)