import { APIResource } from "../../../core/resource.js"; import * as Shared from "../../shared.js"; import * as ChatAPI from "../../chat/chat.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class Completions extends APIResource { /** * Submit an asynchronous chat completion request. */ create(body: CompletionCreateParams, options?: RequestOptions): APIPromise; /** * Retrieve a list of all asynchronous chat completion requests for a given user. */ list(options?: RequestOptions): APIPromise; /** * Retrieve the response for a given asynchronous chat completion request. */ get(apiRequest: string, params?: CompletionGetParams | null | undefined, options?: RequestOptions): APIPromise; } export interface CompletionCreateResponse { id: string; created_at: number; model: string; /** * Status enum for async processing. */ status: 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; completed_at?: number | null; error_message?: string | null; failed_at?: number | null; response?: ChatAPI.StreamChunk | null; started_at?: number | null; } export interface CompletionListResponse { requests: Array; next_token?: string | null; } export declare namespace CompletionListResponse { interface Request { id: string; created_at: number; model: string; /** * Status enum for async processing. */ status: 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; completed_at?: number | null; failed_at?: number | null; started_at?: number | null; } } export interface CompletionGetResponse { id: string; created_at: number; model: string; /** * Status enum for async processing. */ status: 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; completed_at?: number | null; error_message?: string | null; failed_at?: number | null; response?: ChatAPI.StreamChunk | null; started_at?: number | null; } export interface CompletionCreateParams { request: CompletionCreateParams.Request; idempotency_key?: string | null; } export declare namespace CompletionCreateParams { interface Request { messages: Array; model: string; _debug_pro_search?: boolean; _force_new_agent?: boolean | null; _inputs?: Array | null; _prompt_token_length?: number | null; best_of?: number | null; country?: string | null; cum_logprobs?: boolean | null; disable_search?: boolean | null; diverse_first_token?: boolean | null; enable_search_classifier?: boolean | null; file_workspace_id?: string | null; frequency_penalty?: number | null; has_image_url?: boolean; image_domain_filter?: Array | null; image_format_filter?: Array | null; language_preference?: string | null; last_updated_after_filter?: string | null; last_updated_before_filter?: string | null; latitude?: number | null; logprobs?: boolean | null; longitude?: number | null; max_tokens?: number | null; n?: number | null; num_images?: number; num_search_results?: number; parallel_tool_calls?: boolean | null; presence_penalty?: number | null; ranking_model?: string | null; reasoning_effort?: 'minimal' | 'low' | 'medium' | 'high' | null; response_format?: Request.ResponseFormatText | Request.ResponseFormatJsonSchema | Request.ResponseFormatRegex | null; response_metadata?: { [key: string]: unknown; } | null; return_images?: boolean | null; return_related_questions?: boolean | null; safe_search?: boolean | null; search_after_date_filter?: string | null; search_before_date_filter?: string | null; search_domain_filter?: Array | null; search_internal_properties?: { [key: string]: unknown; } | null; search_language_filter?: Array | null; search_mode?: 'web' | 'academic' | 'sec' | null; search_recency_filter?: 'hour' | 'day' | 'week' | 'month' | 'year' | null; search_tenant?: string | null; stop?: string | Array | null; stream?: boolean | null; stream_mode?: 'full' | 'concise'; temperature?: number | null; thread_id?: string | null; tool_choice?: 'none' | 'auto' | 'required' | null; tools?: Array | null; top_k?: number | null; top_logprobs?: number | null; top_p?: number | null; updated_after_timestamp?: number | null; updated_before_timestamp?: number | null; use_threads?: boolean | null; user_original_query?: string | null; web_search_options?: Shared.WebSearchOptions; } namespace Request { interface ResponseFormatText { type: 'text'; } interface ResponseFormatJsonSchema { json_schema: ResponseFormatJsonSchema.JsonSchema; type: 'json_schema'; } namespace ResponseFormatJsonSchema { interface JsonSchema { schema: { [key: string]: unknown; }; description?: string | null; name?: string | null; strict?: boolean | null; } } interface ResponseFormatRegex { regex: ResponseFormatRegex.Regex; type: 'regex'; } namespace ResponseFormatRegex { interface Regex { regex: string; description?: string | null; name?: string | null; strict?: boolean | null; } } interface Tool { function: Tool.Function; type: 'function'; } namespace Tool { interface Function { description: string; name: string; parameters: Function.Parameters; strict?: boolean | null; } namespace Function { interface Parameters { properties: { [key: string]: unknown; }; type: string; additional_properties?: boolean | null; required?: Array | null; } } } } } export interface CompletionGetParams { /** * Query param */ local_mode?: boolean; /** * Header param */ 'x-client-env'?: string; /** * Header param */ 'x-client-name'?: string; /** * Header param */ 'x-created-at-epoch-seconds'?: string; /** * Header param */ 'x-request-time'?: string; /** * Header param */ 'x-usage-tier'?: string; /** * Header param */ 'x-user-id'?: string; } export declare namespace Completions { export { type CompletionCreateResponse as CompletionCreateResponse, type CompletionListResponse as CompletionListResponse, type CompletionGetResponse as CompletionGetResponse, type CompletionCreateParams as CompletionCreateParams, type CompletionGetParams as CompletionGetParams, }; } //# sourceMappingURL=completions.d.ts.map