/opt/canhelp/node_modules/openai/resources
NameSizeModeActions
audio/-0755rm
beta/-0755rm
chat/-0755rm
containers/-0755rm
conversations/-0755rm
evals/-0755rm
fine-tuning/-0755rm
graders/-0755rm
realtime/-0755rm
responses/-0755rm
skills/-0755rm
uploads/-0755rm
vector-stores/-0755rm
webhooks/-0755rm
audio.d.mts710644editdlrm
audio.d.mts.map1150644editdlrm
audio.d.ts690644editdlrm
audio.d.ts.map1140644editdlrm
audio.js3060644editdlrm
audio.js.map1390644editdlrm
audio.mjs1560644editdlrm
audio.mjs.map1240644editdlrm
batches.d.mts96670644editdlrm
batches.d.mts.map34990644editdlrm
batches.d.ts96600644editdlrm
batches.d.ts.map34980644editdlrm
batches.js14420644editdlrm
batches.js.map8340644editdlrm
batches.mjs12690644editdlrm
batches.mjs.map8350644editdlrm
beta.d.mts690644editdlrm
beta.d.mts.map1130644editdlrm
beta.d.ts670644editdlrm
beta.d.ts.map1120644editdlrm
beta.js3040644editdlrm
beta.js.map1370644editdlrm
beta.mjs1540644editdlrm
beta.mjs.map1220644editdlrm
chat.d.mts690644editdlrm
chat.d.mts.map1130644editdlrm
chat.d.ts670644editdlrm
chat.d.ts.map1120644editdlrm
chat.js3040644editdlrm
chat.js.map1370644editdlrm
chat.mjs1540644editdlrm
chat.mjs.map1220644editdlrm
completions.d.mts137800644editdlrm
completions.d.mts.map38290644editdlrm
completions.d.ts137730644editdlrm
completions.d.ts.map38280644editdlrm
completions.js6700644editdlrm
completions.js.map3850644editdlrm
completions.mjs5260644editdlrm
completions.mjs.map3820644editdlrm
containers.d.mts810644editdlrm
containers.d.mts.map1250644editdlrm
containers.d.ts790644editdlrm
containers.d.ts.map1240644editdlrm
containers.js3160644editdlrm
containers.js.map1490644editdlrm
containers.mjs1660644editdlrm
containers.mjs.map1340644editdlrm
conversations.d.mts870644editdlrm
conversations.d.mts.map1310644editdlrm
conversations.d.ts850644editdlrm
conversations.d.ts.map1300644editdlrm
conversations.js3220644editdlrm
conversations.js.map1550644editdlrm
conversations.mjs1720644editdlrm
conversations.mjs.map1400644editdlrm
embeddings.d.mts42480644editdlrm
embeddings.d.mts.map14440644editdlrm
embeddings.d.ts42440644editdlrm
embeddings.d.ts.map14430644editdlrm
embeddings.js26100644editdlrm
embeddings.js.map12640644editdlrm
embeddings.mjs24480644editdlrm
embeddings.mjs.map12600644editdlrm
evals.d.mts710644editdlrm
evals.d.mts.map1150644editdlrm
evals.d.ts690644editdlrm
evals.d.ts.map1140644editdlrm
evals.js3060644editdlrm
evals.js.map1390644editdlrm
evals.mjs1560644editdlrm
evals.mjs.map1240644editdlrm
files.d.mts66190644editdlrm
files.d.mts.map24350644editdlrm
files.d.ts66130644editdlrm
files.d.ts.map24340644editdlrm
files.js37700644editdlrm
files.js.map19190644editdlrm
files.mjs35770644editdlrm
files.mjs.map19340644editdlrm
fine-tuning.d.mts830644editdlrm
fine-tuning.d.mts.map1270644editdlrm
fine-tuning.d.ts810644editdlrm
fine-tuning.d.ts.map1260644editdlrm
fine-tuning.js3180644editdlrm
fine-tuning.js.map1510644editdlrm
fine-tuning.mjs1680644editdlrm
fine-tuning.mjs.map1360644editdlrm
graders.d.mts750644editdlrm
graders.d.mts.map1190644editdlrm
graders.d.ts730644editdlrm
graders.d.ts.map1180644editdlrm
graders.js3100644editdlrm
graders.js.map1430644editdlrm
graders.mjs1600644editdlrm
graders.mjs.map1280644editdlrm
images.d.mts261750644editdlrm
images.d.mts.map84160644editdlrm
images.d.ts261680644editdlrm
images.d.ts.map84150644editdlrm
images.js12800644editdlrm
images.js.map8080644editdlrm
images.mjs11390644editdlrm
images.mjs.map8040644editdlrm
index.d.mts39670644editdlrm
index.d.mts.map24540644editdlrm
index.d.ts39430644editdlrm
index.d.ts.map24530644editdlrm
index.js42100644editdlrm
index.js.map8820644editdlrm
index.mjs12070644editdlrm
index.mjs.map5570644editdlrm
models.d.mts17790644editdlrm
models.d.mts.map9950644editdlrm
models.d.ts17740644editdlrm
models.d.ts.map9940644editdlrm
models.js12800644editdlrm
models.js.map6450644editdlrm
models.mjs11040644editdlrm
models.mjs.map6450644editdlrm
moderations.d.mts103030644editdlrm
moderations.d.mts.map35270644editdlrm
moderations.d.ts102990644editdlrm
moderations.d.ts.map35260644editdlrm
moderations.js7570644editdlrm
moderations.js.map3520644editdlrm
moderations.mjs6130644editdlrm
moderations.mjs.map3510644editdlrm
realtime.d.mts770644editdlrm
realtime.d.mts.map1210644editdlrm
realtime.d.ts750644editdlrm
realtime.d.ts.map1200644editdlrm
realtime.js3120644editdlrm
realtime.js.map1450644editdlrm
realtime.mjs1620644editdlrm
realtime.mjs.map1300644editdlrm
responses.d.mts790644editdlrm
responses.d.mts.map1230644editdlrm
responses.d.ts770644editdlrm
responses.d.ts.map1220644editdlrm
responses.js3140644editdlrm
responses.js.map1470644editdlrm
responses.mjs1640644editdlrm
responses.mjs.map1320644editdlrm
shared.d.mts125110644editdlrm
shared.d.mts.map39900644editdlrm
shared.d.ts125100644editdlrm
shared.d.ts.map39890644editdlrm
shared.js1980644editdlrm
shared.js.map1260644editdlrm
shared.mjs1330644editdlrm
shared.mjs.map1260644editdlrm
skills.d.mts730644editdlrm
skills.d.mts.map1170644editdlrm
skills.d.ts710644editdlrm
skills.d.ts.map1160644editdlrm
skills.js3080644editdlrm
skills.js.map1410644editdlrm
skills.mjs1580644editdlrm
skills.mjs.map1260644editdlrm
uploads.d.mts750644editdlrm
uploads.d.mts.map1190644editdlrm
uploads.d.ts730644editdlrm
uploads.d.ts.map1180644editdlrm
uploads.js3100644editdlrm
uploads.js.map1430644editdlrm
uploads.mjs1600644editdlrm
uploads.mjs.map1280644editdlrm
vector-stores.d.mts870644editdlrm
vector-stores.d.mts.map1310644editdlrm
vector-stores.d.ts850644editdlrm
vector-stores.d.ts.map1300644editdlrm
vector-stores.js3220644editdlrm
vector-stores.js.map1550644editdlrm
vector-stores.mjs1720644editdlrm
vector-stores.mjs.map1400644editdlrm
videos.d.mts91520644editdlrm
videos.d.mts.map45430644editdlrm
videos.d.ts91460644editdlrm
videos.d.ts.map45420644editdlrm
videos.js31940644editdlrm
videos.js.map21350644editdlrm
videos.mjs29650644editdlrm
videos.mjs.map21230644editdlrm
webhooks.d.mts770644editdlrm
webhooks.d.mts.map1210644editdlrm
webhooks.d.ts750644editdlrm
webhooks.d.ts.map1200644editdlrm
webhooks.js3120644editdlrm
webhooks.js.map1450644editdlrm
webhooks.mjs1620644editdlrm
webhooks.mjs.map1300644editdlrm
Edit: /opt/canhelp/node_modules/openai/resources/completions.d.mts (13780B)
import { APIResource } from "../core/resource.mjs"; import * as CompletionsAPI from "./completions.mjs"; import * as ChatCompletionsAPI from "./chat/completions/completions.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { Stream } from "../core/streaming.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; /** * Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. */ export declare class Completions extends APIResource { /** * Creates a completion for the provided prompt and parameters. * * Returns a completion object, or a sequence of completion objects if the request * is streamed. * * @example * ```ts * const completion = await client.completions.create({ * model: 'string', * prompt: 'This is a test.', * }); * ``` */ create(body: CompletionCreateParamsNonStreaming, options?: RequestOptions): APIPromise; create(body: CompletionCreateParamsStreaming, options?: RequestOptions): APIPromise>; create(body: CompletionCreateParamsBase, options?: RequestOptions): APIPromise | Completion>; } /** * Represents a completion response from the API. Note: both the streamed and * non-streamed response objects share the same shape (unlike the chat endpoint). */ export interface Completion { /** * A unique identifier for the completion. */ id: string; /** * The list of completion choices the model generated for the input prompt. */ choices: Array; /** * The Unix timestamp (in seconds) of when the completion was created. */ created: number; /** * The model used for completion. */ model: string; /** * The object type, which is always "text_completion" */ object: 'text_completion'; /** * This fingerprint represents the backend configuration that the model runs with. * * Can be used in conjunction with the `seed` request parameter to understand when * backend changes have been made that might impact determinism. */ system_fingerprint?: string; /** * Usage statistics for the completion request. */ usage?: CompletionUsage; } export interface CompletionChoice { /** * The reason the model stopped generating tokens. This will be `stop` if the model * hit a natural stop point or a provided stop sequence, `length` if the maximum * number of tokens specified in the request was reached, or `content_filter` if * content was omitted due to a flag from our content filters. */ finish_reason: 'stop' | 'length' | 'content_filter'; index: number; logprobs: CompletionChoice.Logprobs | null; text: string; } export declare namespace CompletionChoice { interface Logprobs { text_offset?: Array; token_logprobs?: Array; tokens?: Array; top_logprobs?: Array<{ [key: string]: number; }>; } } /** * Usage statistics for the completion request. */ export interface CompletionUsage { /** * Number of tokens in the generated completion. */ completion_tokens: number; /** * Number of tokens in the prompt. */ prompt_tokens: number; /** * Total number of tokens used in the request (prompt + completion). */ total_tokens: number; /** * Breakdown of tokens used in a completion. */ completion_tokens_details?: CompletionUsage.CompletionTokensDetails; /** * Breakdown of tokens used in the prompt. */ prompt_tokens_details?: CompletionUsage.PromptTokensDetails; } export declare namespace CompletionUsage { /** * Breakdown of tokens used in a completion. */ interface CompletionTokensDetails { /** * When using Predicted Outputs, the number of tokens in the prediction that * appeared in the completion. */ accepted_prediction_tokens?: number; /** * Audio input tokens generated by the model. */ audio_tokens?: number; /** * Tokens generated by the model for reasoning. */ reasoning_tokens?: number; /** * When using Predicted Outputs, the number of tokens in the prediction that did * not appear in the completion. However, like reasoning tokens, these tokens are * still counted in the total completion tokens for purposes of billing, output, * and context window limits. */ rejected_prediction_tokens?: number; } /** * Breakdown of tokens used in the prompt. */ interface PromptTokensDetails { /** * Audio input tokens present in the prompt. */ audio_tokens?: number; /** * Cached tokens present in the prompt. */ cached_tokens?: number; } } export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming; export interface CompletionCreateParamsBase { /** * ID of the model to use. You can use the * [List models](https://platform.openai.com/docs/api-reference/models/list) API to * see all of your available models, or see our * [Model overview](https://platform.openai.com/docs/models) for descriptions of * them. */ model: (string & {}) | 'gpt-3.5-turbo-instruct' | 'davinci-002' | 'babbage-002'; /** * The prompt(s) to generate completions for, encoded as a string, array of * strings, array of tokens, or array of token arrays. * * Note that <|endoftext|> is the document separator that the model sees during * training, so if a prompt is not specified the model will generate as if from the * beginning of a new document. */ prompt: string | Array | Array | Array> | null; /** * Generates `best_of` completions server-side and returns the "best" (the one with * the highest log probability per token). Results cannot be streamed. * * When used with `n`, `best_of` controls the number of candidate completions and * `n` specifies how many to return – `best_of` must be greater than `n`. * * **Note:** Because this parameter generates many completions, it can quickly * consume your token quota. Use carefully and ensure that you have reasonable * settings for `max_tokens` and `stop`. */ best_of?: number | null; /** * Echo back the prompt in addition to the completion */ echo?: boolean | null; /** * Number between -2.0 and 2.0. Positive values penalize new tokens based on their * existing frequency in the text so far, decreasing the model's likelihood to * repeat the same line verbatim. * * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) */ frequency_penalty?: number | null; /** * Modify the likelihood of specified tokens appearing in the completion. * * Accepts a JSON object that maps tokens (specified by their token ID in the GPT * tokenizer) to an associated bias value from -100 to 100. You can use this * [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. * Mathematically, the bias is added to the logits generated by the model prior to * sampling. The exact effect will vary per model, but values between -1 and 1 * should decrease or increase likelihood of selection; values like -100 or 100 * should result in a ban or exclusive selection of the relevant token. * * As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token * from being generated. */ logit_bias?: { [key: string]: number; } | null; /** * Include the log probabilities on the `logprobs` most likely output tokens, as * well the chosen tokens. For example, if `logprobs` is 5, the API will return a * list of the 5 most likely tokens. The API will always return the `logprob` of * the sampled token, so there may be up to `logprobs+1` elements in the response. * * The maximum value for `logprobs` is 5. */ logprobs?: number | null; /** * The maximum number of [tokens](/tokenizer) that can be generated in the * completion. * * The token count of your prompt plus `max_tokens` cannot exceed the model's * context length. * [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) * for counting tokens. */ max_tokens?: number | null; /** * How many completions to generate for each prompt. * * **Note:** Because this parameter generates many completions, it can quickly * consume your token quota. Use carefully and ensure that you have reasonable * settings for `max_tokens` and `stop`. */ n?: number | null; /** * Number between -2.0 and 2.0. Positive values penalize new tokens based on * whether they appear in the text so far, increasing the model's likelihood to * talk about new topics. * * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) */ presence_penalty?: number | null; /** * If specified, our system will make a best effort to sample deterministically, * such that repeated requests with the same `seed` and parameters should return * the same result. * * Determinism is not guaranteed, and you should refer to the `system_fingerprint` * response parameter to monitor changes in the backend. */ seed?: number | null; /** * Not supported with latest reasoning models `o3` and `o4-mini`. * * Up to 4 sequences where the API will stop generating further tokens. The * returned text will not contain the stop sequence. */ stop?: string | null | Array; /** * Whether to stream back partial progress. If set, tokens will be sent as * data-only * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) * as they become available, with the stream terminated by a `data: [DONE]` * message. * [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). */ stream?: boolean | null; /** * Options for streaming response. Only set this when you set `stream: true`. */ stream_options?: ChatCompletionsAPI.ChatCompletionStreamOptions | null; /** * The suffix that comes after a completion of inserted text. * * This parameter is only supported for `gpt-3.5-turbo-instruct`. */ suffix?: string | null; /** * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will * make the output more random, while lower values like 0.2 will make it more * focused and deterministic. * * We generally recommend altering this or `top_p` but not both. */ temperature?: number | null; /** * An alternative to sampling with temperature, called nucleus sampling, where the * model considers the results of the tokens with top_p probability mass. So 0.1 * means only the tokens comprising the top 10% probability mass are considered. * * We generally recommend altering this or `temperature` but not both. */ top_p?: number | null; /** * A unique identifier representing your end-user, which can help OpenAI to monitor * and detect abuse. * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). */ user?: string; } export declare namespace CompletionCreateParams { type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming; type CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming; } export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase { /** * Whether to stream back partial progress. If set, tokens will be sent as * data-only * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) * as they become available, with the stream terminated by a `data: [DONE]` * message. * [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). */ stream?: false | null; } export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase { /** * Whether to stream back partial progress. If set, tokens will be sent as * data-only * [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) * as they become available, with the stream terminated by a `data: [DONE]` * message. * [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). */ stream: true; } export declare namespace Completions { export { type Completion as Completion, type CompletionChoice as CompletionChoice, type CompletionUsage as CompletionUsage, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, }; } //# sourceMappingURL=completions.d.mts.map