diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46e7d1c..0b9c056 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,6 @@ jobs: AUTH: ${{ steps.github-oidc.outputs.github_token }} SHA: ${{ github.sha }} run: ./scripts/utils/upload-artifact.sh - test: timeout-minutes: 10 name: test diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bce5b8a..23b4f02 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.18-alpha.3" + ".": "0.2.19-alpha.1" } diff --git a/.stats.yml b/.stats.yml index 1dfa3ca..f937dc2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-4f6633567c1a079df49d0cf58f37251a4bb0ee2f2a496ac83c9fee26eb325f9c.yml -openapi_spec_hash: af5b3d3bbecf48f15c90b982ccac852e -config_hash: de16e52db65de71ac35adcdb665a74f5 +configured_endpoints: 107 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-f252873ea1e1f38fd207331ef2621c511154d5be3f4076e59cc15754fc58eee4.yml +openapi_spec_hash: 10cbb4337a06a9fdd7d08612dd6044c3 +config_hash: 40b8d777e1eb8b6ab05759b663edd2fb diff --git a/CHANGELOG.md b/CHANGELOG.md index e275c8a..791a98a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## 0.2.19-alpha.1 (2025-08-26) + +Full Changelog: [v0.2.18-alpha.3...v0.2.19-alpha.1](https://github.com/llamastack/llama-stack-client-typescript/compare/v0.2.18-alpha.3...v0.2.19-alpha.1) + +### Features + +* **api:** fix completion response breakage perhaps? ([8afb71e](https://github.com/llamastack/llama-stack-client-typescript/commit/8afb71e178fc6d76549cfb24a3ef93915f8bb402)) +* **api:** manual updates ([6124969](https://github.com/llamastack/llama-stack-client-typescript/commit/61249693bae9649d586cf6aab3fbebd9529c7f2b)) +* **api:** manual updates ([58379c6](https://github.com/llamastack/llama-stack-client-typescript/commit/58379c6961ac0af1296f016fe05a9713c799f623)) +* **api:** query_metrics, batches, changes ([8d3d366](https://github.com/llamastack/llama-stack-client-typescript/commit/8d3d366c7ed4bab6936f15668851d9ec9db77a2b)) +* **api:** some updates to query metrics ([2434aea](https://github.com/llamastack/llama-stack-client-typescript/commit/2434aeaf2386f934b01491dfdc96463e2bb07bdd)) + + +### Chores + +* **deps:** update dependency node-fetch to v2.6.13 ([4d1ef8f](https://github.com/llamastack/llama-stack-client-typescript/commit/4d1ef8fb5e58927d2c2b80d21a95e6b53153ba6d)) +* **internal:** formatting change ([6ea2c4e](https://github.com/llamastack/llama-stack-client-typescript/commit/6ea2c4e31d861f23aa5b2cc36664a6d48623e881)) +* **internal:** formatting change ([2221870](https://github.com/llamastack/llama-stack-client-typescript/commit/2221870d728ed08ddf10c2f037784ab67005df43)) +* update ([3a17e19](https://github.com/llamastack/llama-stack-client-typescript/commit/3a17e196b631a62ac1642b67a6dbd8ada0bb5244)) +* update CI script ([bff686d](https://github.com/llamastack/llama-stack-client-typescript/commit/bff686d2311e714ab5f082304c0d8e865990f29e)) + + +### Build System + +* Bump version to 0.2.18 ([7549391](https://github.com/llamastack/llama-stack-client-typescript/commit/754939187da2726e54d902241747351d120f5174)) + ## 0.2.18-alpha.3 (2025-08-14) Full Changelog: [v0.2.17...v0.2.18-alpha.3](https://github.com/llamastack/llama-stack-client-typescript/compare/v0.2.17...v0.2.18-alpha.3) diff --git a/api.md b/api.md index df16b33..cdae905 100644 --- a/api.md +++ b/api.md @@ -11,18 +11,17 @@ Types: - InterleavedContent - InterleavedContentItem - Message +- Metric - ParamType - QueryConfig - QueryGeneratorConfig - QueryResult - ResponseFormat -- ReturnType - SafetyViolation - SamplingParams - ScoringResult - SystemMessage - ToolCall -- ToolCallOrString - ToolParamDefinition - ToolResponseMessage - UserMessage @@ -87,7 +86,7 @@ Methods: - client.responses.create({ ...params }) -> ResponseObject - client.responses.retrieve(responseId) -> ResponseObject -- client.responses.list({ ...params }) -> ResponseListResponse +- client.responses.list({ ...params }) -> ResponseListResponsesOpenAICursorPage ## InputItems @@ -262,7 +261,7 @@ Methods: - client.chat.completions.create({ ...params }) -> CompletionCreateResponse - client.chat.completions.retrieve(completionId) -> CompletionRetrieveResponse -- client.chat.completions.list({ ...params }) -> CompletionListResponse +- client.chat.completions.list({ ...params }) -> CompletionListResponsesOpenAICursorPage # Completions @@ -315,7 +314,7 @@ Methods: - client.vectorStores.create({ ...params }) -> VectorStore - client.vectorStores.retrieve(vectorStoreId) -> VectorStore - client.vectorStores.update(vectorStoreId, { ...params }) -> VectorStore -- client.vectorStores.list({ ...params }) -> ListVectorStoresResponse +- client.vectorStores.list({ ...params }) -> VectorStoresOpenAICursorPage - client.vectorStores.delete(vectorStoreId) -> VectorStoreDeleteResponse - client.vectorStores.search(vectorStoreId, { ...params }) -> VectorStoreSearchResponse @@ -324,7 +323,6 @@ Methods: Types: - VectorStoreFile -- FileListResponse - FileDeleteResponse - FileContentResponse @@ -333,7 +331,7 @@ Methods: - client.vectorStores.files.create(vectorStoreId, { ...params }) -> VectorStoreFile - client.vectorStores.files.retrieve(vectorStoreId, fileId) -> VectorStoreFile - client.vectorStores.files.update(vectorStoreId, fileId, { ...params }) -> VectorStoreFile -- client.vectorStores.files.list(vectorStoreId, { ...params }) -> FileListResponse +- client.vectorStores.files.list(vectorStoreId, { ...params }) -> VectorStoreFilesOpenAICursorPage - client.vectorStores.files.delete(vectorStoreId, fileId) -> FileDeleteResponse - client.vectorStores.files.content(vectorStoreId, fileId) -> FileContentResponse @@ -458,6 +456,7 @@ Types: - Trace - TelemetryGetSpanResponse - TelemetryGetSpanTreeResponse +- TelemetryQueryMetricsResponse - TelemetryQuerySpansResponse - TelemetryQueryTracesResponse @@ -467,6 +466,7 @@ Methods: - client.telemetry.getSpanTree(spanId, { ...params }) -> TelemetryGetSpanTreeResponse - client.telemetry.getTrace(traceId) -> Trace - client.telemetry.logEvent({ ...params }) -> void +- client.telemetry.queryMetrics(metricName, { ...params }) -> TelemetryQueryMetricsResponse - client.telemetry.querySpans({ ...params }) -> TelemetryQuerySpansResponse - client.telemetry.queryTraces({ ...params }) -> TelemetryQueryTracesResponse - client.telemetry.saveSpansToDataset({ ...params }) -> void @@ -525,6 +525,6 @@ Methods: - client.files.create({ ...params }) -> File - client.files.retrieve(fileId) -> File -- client.files.list({ ...params }) -> ListFilesResponse +- client.files.list({ ...params }) -> FilesOpenAICursorPage - client.files.delete(fileId) -> DeleteFileResponse - client.files.content(fileId) -> unknown diff --git a/bin/publish-npm b/bin/publish-npm index fa2243d..45e8aa8 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -58,4 +58,4 @@ else fi # Publish with the appropriate tag -yarn publish --access public --tag "$TAG" +yarn publish --tag "$TAG" diff --git a/package.json b/package.json index 487a1ea..6d88b6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "llama-stack-client", - "version": "0.2.18", + "version": "0.2.19-alpha.1", "description": "The official TypeScript library for the Llama Stack Client API", "author": "Llama Stack Client ", "types": "dist/index.d.ts", @@ -13,6 +13,9 @@ "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "./scripts/test", "build": "./scripts/build", diff --git a/scripts/mock b/scripts/mock index d2814ae..0b28f6e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index 2049e31..7bce051 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 34d5407..c35b01d 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,7 +12,7 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ +UPLOAD_RESPONSE=$(tar -cz "${BUILD_PATH:-dist}" | curl -v -X PUT \ -H "Content-Type: application/gzip" \ --data-binary @- "$SIGNED_URL" 2>&1) diff --git a/src/index.ts b/src/index.ts index 042239d..86a30d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,12 @@ import * as qs from './internal/qs'; import * as Core from './core'; import * as Errors from './error'; import * as Pagination from './pagination'; -import { type DatasetsIterrowsParams, DatasetsIterrowsResponse } from './pagination'; +import { + type DatasetsIterrowsParams, + DatasetsIterrowsResponse, + type OpenAICursorPageParams, + OpenAICursorPageResponse, +} from './pagination'; import * as Uploads from './uploads'; import * as API from './resources/index'; import { @@ -41,6 +46,7 @@ import { FileCreateParams, FileListParams, Files, + FilesOpenAICursorPage, ListFilesResponse, } from './resources/files'; import { @@ -109,6 +115,8 @@ import { TelemetryGetSpanTreeParams, TelemetryGetSpanTreeResponse, TelemetryLogEventParams, + TelemetryQueryMetricsParams, + TelemetryQueryMetricsResponse, TelemetryQuerySpansParams, TelemetryQuerySpansResponse, TelemetryQueryTracesParams, @@ -177,6 +185,7 @@ import { ResponseCreateParamsStreaming, ResponseListParams, ResponseListResponse, + ResponseListResponsesOpenAICursorPage, ResponseObject, ResponseObjectStream, Responses, @@ -199,6 +208,7 @@ import { VectorStoreSearchResponse, VectorStoreUpdateParams, VectorStores, + VectorStoresOpenAICursorPage, } from './resources/vector-stores/vector-stores'; export interface ClientOptions { @@ -394,6 +404,7 @@ LlamaStackClient.Toolgroups = Toolgroups; LlamaStackClient.Tools = Tools; LlamaStackClient.ToolRuntime = ToolRuntime; LlamaStackClient.Responses = Responses; +LlamaStackClient.ResponseListResponsesOpenAICursorPage = ResponseListResponsesOpenAICursorPage; LlamaStackClient.Agents = Agents; LlamaStackClient.Datasets = Datasets; LlamaStackClient.Eval = Eval; @@ -405,6 +416,7 @@ LlamaStackClient.Completions = Completions; LlamaStackClient.VectorIo = VectorIo; LlamaStackClient.VectorDBs = VectorDBs; LlamaStackClient.VectorStores = VectorStores; +LlamaStackClient.VectorStoresOpenAICursorPage = VectorStoresOpenAICursorPage; LlamaStackClient.Models = Models; LlamaStackClient.PostTraining = PostTraining; LlamaStackClient.Providers = Providers; @@ -418,6 +430,8 @@ LlamaStackClient.Scoring = Scoring; LlamaStackClient.ScoringFunctions = ScoringFunctions; LlamaStackClient.Benchmarks = Benchmarks; LlamaStackClient.Files = Files; +LlamaStackClient.FilesOpenAICursorPage = FilesOpenAICursorPage; + export declare namespace LlamaStackClient { export type RequestOptions = Core.RequestOptions; @@ -427,6 +441,12 @@ export declare namespace LlamaStackClient { type DatasetsIterrowsResponse as DatasetsIterrowsResponse, }; + export import OpenAICursorPage = Pagination.OpenAICursorPage; + export { + type OpenAICursorPageParams as OpenAICursorPageParams, + type OpenAICursorPageResponse as OpenAICursorPageResponse, + }; + export { Toolgroups as Toolgroups, type ListToolGroupsResponse as ListToolGroupsResponse, @@ -457,6 +477,7 @@ export declare namespace LlamaStackClient { type ResponseObject as ResponseObject, type ResponseObjectStream as ResponseObjectStream, type ResponseListResponse as ResponseListResponse, + ResponseListResponsesOpenAICursorPage as ResponseListResponsesOpenAICursorPage, type ResponseCreateParams as ResponseCreateParams, type ResponseCreateParamsNonStreaming as ResponseCreateParamsNonStreaming, type ResponseCreateParamsStreaming as ResponseCreateParamsStreaming, @@ -565,6 +586,7 @@ export declare namespace LlamaStackClient { type VectorStore as VectorStore, type VectorStoreDeleteResponse as VectorStoreDeleteResponse, type VectorStoreSearchResponse as VectorStoreSearchResponse, + VectorStoresOpenAICursorPage as VectorStoresOpenAICursorPage, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, @@ -635,10 +657,12 @@ export declare namespace LlamaStackClient { type Trace as Trace, type TelemetryGetSpanResponse as TelemetryGetSpanResponse, type TelemetryGetSpanTreeResponse as TelemetryGetSpanTreeResponse, + type TelemetryQueryMetricsResponse as TelemetryQueryMetricsResponse, type TelemetryQuerySpansResponse as TelemetryQuerySpansResponse, type TelemetryQueryTracesResponse as TelemetryQueryTracesResponse, type TelemetryGetSpanTreeParams as TelemetryGetSpanTreeParams, type TelemetryLogEventParams as TelemetryLogEventParams, + type TelemetryQueryMetricsParams as TelemetryQueryMetricsParams, type TelemetryQuerySpansParams as TelemetryQuerySpansParams, type TelemetryQueryTracesParams as TelemetryQueryTracesParams, type TelemetrySaveSpansToDatasetParams as TelemetrySaveSpansToDatasetParams, @@ -675,6 +699,7 @@ export declare namespace LlamaStackClient { type File as File, type ListFilesResponse as ListFilesResponse, type FileContentResponse as FileContentResponse, + FilesOpenAICursorPage as FilesOpenAICursorPage, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, }; @@ -688,18 +713,17 @@ export declare namespace LlamaStackClient { export type InterleavedContent = API.InterleavedContent; export type InterleavedContentItem = API.InterleavedContentItem; export type Message = API.Message; + export type Metric = API.Metric; export type ParamType = API.ParamType; export type QueryConfig = API.QueryConfig; export type QueryGeneratorConfig = API.QueryGeneratorConfig; export type QueryResult = API.QueryResult; export type ResponseFormat = API.ResponseFormat; - export type ReturnType = API.ReturnType; export type SafetyViolation = API.SafetyViolation; export type SamplingParams = API.SamplingParams; export type ScoringResult = API.ScoringResult; export type SystemMessage = API.SystemMessage; export type ToolCall = API.ToolCall; - export type ToolCallOrString = API.ToolCallOrString; export type ToolParamDefinition = API.ToolParamDefinition; export type ToolResponseMessage = API.ToolResponseMessage; export type UserMessage = API.UserMessage; diff --git a/src/pagination.ts b/src/pagination.ts index 9e0d28e..8eccc4b 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -60,3 +60,73 @@ export class DatasetsIterrows extends AbstractPage implements Datase }; } } + +export interface OpenAICursorPageResponse { + data: Array; + + has_more: boolean; + + last_id: string; +} + +export interface OpenAICursorPageParams { + limit?: number; + + after?: string; +} + +export class OpenAICursorPage extends AbstractPage implements OpenAICursorPageResponse { + data: Array; + + has_more: boolean; + + last_id: string; + + constructor( + client: APIClient, + response: Response, + body: OpenAICursorPageResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.data = body.data || []; + this.has_more = body.has_more || false; + this.last_id = body.last_id || ''; + } + + getPaginatedItems(): Item[] { + return this.data ?? []; + } + + override hasNextPage(): boolean { + if (this.has_more === false) { + return false; + } + + return super.hasNextPage(); + } + + // @deprecated Please use `nextPageInfo()` instead + nextPageParams(): Partial | null { + const info = this.nextPageInfo(); + if (!info) return null; + if ('params' in info) return info.params; + const params = Object.fromEntries(info.url.searchParams); + if (!Object.keys(params).length) return null; + return params; + } + + nextPageInfo(): PageInfo | null { + const cursor = this.last_id; + if (!cursor) { + return null; + } + + return { + params: { + after: cursor, + }, + }; + } +} diff --git a/src/resources/chat/chat.ts b/src/resources/chat/chat.ts index a38445d..b43e6d3 100644 --- a/src/resources/chat/chat.ts +++ b/src/resources/chat/chat.ts @@ -9,6 +9,7 @@ import { CompletionCreateResponse, CompletionListParams, CompletionListResponse, + CompletionListResponsesOpenAICursorPage, CompletionRetrieveResponse, Completions, } from './completions'; @@ -219,6 +220,7 @@ export namespace ChatCompletionChunk { } Chat.Completions = Completions; +Chat.CompletionListResponsesOpenAICursorPage = CompletionListResponsesOpenAICursorPage; export declare namespace Chat { export { type ChatCompletionChunk as ChatCompletionChunk }; @@ -228,6 +230,7 @@ export declare namespace Chat { type CompletionCreateResponse as CompletionCreateResponse, type CompletionRetrieveResponse as CompletionRetrieveResponse, type CompletionListResponse as CompletionListResponse, + CompletionListResponsesOpenAICursorPage as CompletionListResponsesOpenAICursorPage, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index 6331b0a..c7ed5e8 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -6,6 +6,7 @@ import { APIPromise } from '../../core'; import * as Core from '../../core'; import * as CompletionsAPI from './completions'; import * as ChatAPI from './chat'; +import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination'; import { Stream } from '../../streaming'; export class Completions extends APIResource { @@ -46,19 +47,30 @@ export class Completions extends APIResource { /** * List all chat completions. */ - list(query?: CompletionListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; + list( + query?: CompletionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + options?: Core.RequestOptions, + ): Core.PagePromise; list( query: CompletionListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } - return this._client.get('/v1/openai/v1/chat/completions', { query, ...options }); + return this._client.getAPIList( + '/v1/openai/v1/chat/completions', + CompletionListResponsesOpenAICursorPage, + { query, ...options }, + ); } } +export class CompletionListResponsesOpenAICursorPage extends OpenAICursorPage {} + /** * Response from an OpenAI-compatible chat completion request. */ @@ -1217,756 +1229,724 @@ export namespace CompletionRetrieveResponse { } } -/** - * Response from listing OpenAI-compatible chat completions. - */ export interface CompletionListResponse { /** - * List of chat completion objects with their input messages + * The ID of the chat completion */ - data: Array; + id: string; /** - * ID of the first completion in this list + * List of choices */ - first_id: string; + choices: Array; /** - * Whether there are more completions available beyond this list + * The Unix timestamp in seconds when the chat completion was created */ - has_more: boolean; + created: number; + + input_messages: Array< + | CompletionListResponse.OpenAIUserMessageParam + | CompletionListResponse.OpenAISystemMessageParam + | CompletionListResponse.OpenAIAssistantMessageParam + | CompletionListResponse.OpenAIToolMessageParam + | CompletionListResponse.OpenAIDeveloperMessageParam + >; /** - * ID of the last completion in this list + * The model that was used to generate the chat completion */ - last_id: string; + model: string; /** - * Must be "list" to identify this as a list response + * The object type, which will be "chat.completion" */ - object: 'list'; + object: 'chat.completion'; } export namespace CompletionListResponse { - export interface Data { - /** - * The ID of the chat completion - */ - id: string; - + /** + * A choice from an OpenAI-compatible chat completion response. + */ + export interface Choice { /** - * List of choices + * The reason the model stopped generating */ - choices: Array; + finish_reason: string; /** - * The Unix timestamp in seconds when the chat completion was created + * The index of the choice */ - created: number; - - input_messages: Array< - | Data.OpenAIUserMessageParam - | Data.OpenAISystemMessageParam - | Data.OpenAIAssistantMessageParam - | Data.OpenAIToolMessageParam - | Data.OpenAIDeveloperMessageParam - >; + index: number; /** - * The model that was used to generate the chat completion + * The message from the model */ - model: string; + message: + | Choice.OpenAIUserMessageParam + | Choice.OpenAISystemMessageParam + | Choice.OpenAIAssistantMessageParam + | Choice.OpenAIToolMessageParam + | Choice.OpenAIDeveloperMessageParam; /** - * The object type, which will be "chat.completion" + * (Optional) The log probabilities for the tokens in the message */ - object: 'chat.completion'; + logprobs?: Choice.Logprobs; } - export namespace Data { + export namespace Choice { /** - * A choice from an OpenAI-compatible chat completion response. + * A message from the user in an OpenAI-compatible chat completion request. */ - export interface Choice { - /** - * The reason the model stopped generating - */ - finish_reason: string; - + export interface OpenAIUserMessageParam { /** - * The index of the choice + * The content of the message, which can include text and other media */ - index: number; + content: + | string + | Array< + | OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam + | OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam + | OpenAIUserMessageParam.OpenAIFile + >; /** - * The message from the model + * Must be "user" to identify this as a user message */ - message: - | Choice.OpenAIUserMessageParam - | Choice.OpenAISystemMessageParam - | Choice.OpenAIAssistantMessageParam - | Choice.OpenAIToolMessageParam - | Choice.OpenAIDeveloperMessageParam; + role: 'user'; /** - * (Optional) The log probabilities for the tokens in the message + * (Optional) The name of the user message participant. */ - logprobs?: Choice.Logprobs; + name?: string; } - export namespace Choice { + export namespace OpenAIUserMessageParam { /** - * A message from the user in an OpenAI-compatible chat completion request. + * Text content part for OpenAI-compatible chat completion messages. */ - export interface OpenAIUserMessageParam { + export interface OpenAIChatCompletionContentPartTextParam { /** - * The content of the message, which can include text and other media + * The text content of the message */ - content: - | string - | Array< - | OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam - | OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam - | OpenAIUserMessageParam.OpenAIFile - >; + text: string; /** - * Must be "user" to identify this as a user message + * Must be "text" to identify this as text content */ - role: 'user'; + type: 'text'; + } + /** + * Image content part for OpenAI-compatible chat completion messages. + */ + export interface OpenAIChatCompletionContentPartImageParam { /** - * (Optional) The name of the user message participant. + * Image URL specification and processing details */ - name?: string; - } + image_url: OpenAIChatCompletionContentPartImageParam.ImageURL; - export namespace OpenAIUserMessageParam { /** - * Text content part for OpenAI-compatible chat completion messages. + * Must be "image_url" to identify this as image content */ - export interface OpenAIChatCompletionContentPartTextParam { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } + type: 'image_url'; + } + export namespace OpenAIChatCompletionContentPartImageParam { /** - * Image content part for OpenAI-compatible chat completion messages. + * Image URL specification and processing details */ - export interface OpenAIChatCompletionContentPartImageParam { - /** - * Image URL specification and processing details - */ - image_url: OpenAIChatCompletionContentPartImageParam.ImageURL; - + export interface ImageURL { /** - * Must be "image_url" to identify this as image content + * URL of the image to include in the message */ - type: 'image_url'; - } + url: string; - export namespace OpenAIChatCompletionContentPartImageParam { /** - * Image URL specification and processing details + * (Optional) Level of detail for image processing. Can be "low", "high", or "auto" */ - export interface ImageURL { - /** - * URL of the image to include in the message - */ - url: string; - - /** - * (Optional) Level of detail for image processing. Can be "low", "high", or "auto" - */ - detail?: string; - } + detail?: string; } + } - export interface OpenAIFile { - file: OpenAIFile.File; + export interface OpenAIFile { + file: OpenAIFile.File; - type: 'file'; - } + type: 'file'; + } - export namespace OpenAIFile { - export interface File { - file_data?: string; + export namespace OpenAIFile { + export interface File { + file_data?: string; - file_id?: string; + file_id?: string; - filename?: string; - } + filename?: string; } } + } + /** + * A system message providing instructions or context to the model. + */ + export interface OpenAISystemMessageParam { /** - * A system message providing instructions or context to the model. + * The content of the "system prompt". If multiple system messages are provided, + * they are concatenated. The underlying Llama Stack code may also add other system + * messages (for example, for formatting tool definitions). */ - export interface OpenAISystemMessageParam { - /** - * The content of the "system prompt". If multiple system messages are provided, - * they are concatenated. The underlying Llama Stack code may also add other system - * messages (for example, for formatting tool definitions). - */ - content: string | Array; - - /** - * Must be "system" to identify this as a system message - */ - role: 'system'; - - /** - * (Optional) The name of the system message participant. - */ - name?: string; - } - - export namespace OpenAISystemMessageParam { - /** - * Text content part for OpenAI-compatible chat completion messages. - */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } - } + content: string | Array; /** - * A message containing the model's (assistant) response in an OpenAI-compatible - * chat completion request. + * Must be "system" to identify this as a system message */ - export interface OpenAIAssistantMessageParam { - /** - * Must be "assistant" to identify this as the model's response - */ - role: 'assistant'; + role: 'system'; - /** - * The content of the model's response - */ - content?: string | Array; + /** + * (Optional) The name of the system message participant. + */ + name?: string; + } + export namespace OpenAISystemMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { /** - * (Optional) The name of the assistant message participant. + * The text content of the message */ - name?: string; + text: string; /** - * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. + * Must be "text" to identify this as text content */ - tool_calls?: Array; + type: 'text'; } + } - export namespace OpenAIAssistantMessageParam { - /** - * Text content part for OpenAI-compatible chat completion messages. - */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } - - /** - * Tool call specification for OpenAI-compatible chat completion responses. - */ - export interface ToolCall { - /** - * Must be "function" to identify this as a function call - */ - type: 'function'; + /** + * A message containing the model's (assistant) response in an OpenAI-compatible + * chat completion request. + */ + export interface OpenAIAssistantMessageParam { + /** + * Must be "assistant" to identify this as the model's response + */ + role: 'assistant'; - /** - * (Optional) Unique identifier for the tool call - */ - id?: string; + /** + * The content of the model's response + */ + content?: string | Array; - /** - * (Optional) Function call details - */ - function?: ToolCall.Function; + /** + * (Optional) The name of the assistant message participant. + */ + name?: string; - /** - * (Optional) Index of the tool call in the list - */ - index?: number; - } + /** + * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. + */ + tool_calls?: Array; + } - export namespace ToolCall { - /** - * (Optional) Function call details - */ - export interface Function { - /** - * (Optional) Arguments to pass to the function as a JSON string - */ - arguments?: string; + export namespace OpenAIAssistantMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { + /** + * The text content of the message + */ + text: string; - /** - * (Optional) Name of the function to call - */ - name?: string; - } - } + /** + * Must be "text" to identify this as text content + */ + type: 'text'; } /** - * A message representing the result of a tool invocation in an OpenAI-compatible - * chat completion request. + * Tool call specification for OpenAI-compatible chat completion responses. */ - export interface OpenAIToolMessageParam { + export interface ToolCall { /** - * The response content from the tool + * Must be "function" to identify this as a function call */ - content: string | Array; + type: 'function'; /** - * Must be "tool" to identify this as a tool response + * (Optional) Unique identifier for the tool call */ - role: 'tool'; + id?: string; /** - * Unique identifier for the tool call this response is for + * (Optional) Function call details */ - tool_call_id: string; + function?: ToolCall.Function; + + /** + * (Optional) Index of the tool call in the list + */ + index?: number; } - export namespace OpenAIToolMessageParam { + export namespace ToolCall { /** - * Text content part for OpenAI-compatible chat completion messages. + * (Optional) Function call details */ - export interface UnionMember1 { + export interface Function { /** - * The text content of the message + * (Optional) Arguments to pass to the function as a JSON string */ - text: string; + arguments?: string; /** - * Must be "text" to identify this as text content + * (Optional) Name of the function to call */ - type: 'text'; + name?: string; } } + } + /** + * A message representing the result of a tool invocation in an OpenAI-compatible + * chat completion request. + */ + export interface OpenAIToolMessageParam { /** - * A message from the developer in an OpenAI-compatible chat completion request. + * The response content from the tool */ - export interface OpenAIDeveloperMessageParam { - /** - * The content of the developer message - */ - content: string | Array; + content: string | Array; + + /** + * Must be "tool" to identify this as a tool response + */ + role: 'tool'; + + /** + * Unique identifier for the tool call this response is for + */ + tool_call_id: string; + } + export namespace OpenAIToolMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { /** - * Must be "developer" to identify this as a developer message + * The text content of the message */ - role: 'developer'; + text: string; /** - * (Optional) The name of the developer message participant. + * Must be "text" to identify this as text content */ - name?: string; + type: 'text'; } + } - export namespace OpenAIDeveloperMessageParam { - /** - * Text content part for OpenAI-compatible chat completion messages. - */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; + /** + * A message from the developer in an OpenAI-compatible chat completion request. + */ + export interface OpenAIDeveloperMessageParam { + /** + * The content of the developer message + */ + content: string | Array; - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } - } + /** + * Must be "developer" to identify this as a developer message + */ + role: 'developer'; /** - * (Optional) The log probabilities for the tokens in the message + * (Optional) The name of the developer message participant. */ - export interface Logprobs { + name?: string; + } + + export namespace OpenAIDeveloperMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { /** - * (Optional) The log probabilities for the tokens in the message + * The text content of the message */ - content?: Array; + text: string; /** - * (Optional) The log probabilities for the tokens in the message + * Must be "text" to identify this as text content */ - refusal?: Array; + type: 'text'; } + } - export namespace Logprobs { + /** + * (Optional) The log probabilities for the tokens in the message + */ + export interface Logprobs { + /** + * (Optional) The log probabilities for the tokens in the message + */ + content?: Array; + + /** + * (Optional) The log probabilities for the tokens in the message + */ + refusal?: Array; + } + + export namespace Logprobs { + /** + * The log probability for a token from an OpenAI-compatible chat completion + * response. + */ + export interface Content { + token: string; + + logprob: number; + + top_logprobs: Array; + + bytes?: Array; + } + + export namespace Content { /** - * The log probability for a token from an OpenAI-compatible chat completion + * The top log probability for a token from an OpenAI-compatible chat completion * response. */ - export interface Content { + export interface TopLogprob { token: string; logprob: number; - top_logprobs: Array; - bytes?: Array; } + } - export namespace Content { - /** - * The top log probability for a token from an OpenAI-compatible chat completion - * response. - */ - export interface TopLogprob { - token: string; + /** + * The log probability for a token from an OpenAI-compatible chat completion + * response. + */ + export interface Refusal { + token: string; - logprob: number; + logprob: number; - bytes?: Array; - } - } + top_logprobs: Array; + + bytes?: Array; + } + export namespace Refusal { /** - * The log probability for a token from an OpenAI-compatible chat completion + * The top log probability for a token from an OpenAI-compatible chat completion * response. */ - export interface Refusal { + export interface TopLogprob { token: string; logprob: number; - top_logprobs: Array; - bytes?: Array; } + } + } + } - export namespace Refusal { - /** - * The top log probability for a token from an OpenAI-compatible chat completion - * response. - */ - export interface TopLogprob { - token: string; + /** + * A message from the user in an OpenAI-compatible chat completion request. + */ + export interface OpenAIUserMessageParam { + /** + * The content of the message, which can include text and other media + */ + content: + | string + | Array< + | OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam + | OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam + | OpenAIUserMessageParam.OpenAIFile + >; - logprob: number; + /** + * Must be "user" to identify this as a user message + */ + role: 'user'; - bytes?: Array; - } - } - } - } + /** + * (Optional) The name of the user message participant. + */ + name?: string; + } + export namespace OpenAIUserMessageParam { /** - * A message from the user in an OpenAI-compatible chat completion request. + * Text content part for OpenAI-compatible chat completion messages. */ - export interface OpenAIUserMessageParam { + export interface OpenAIChatCompletionContentPartTextParam { /** - * The content of the message, which can include text and other media + * The text content of the message */ - content: - | string - | Array< - | OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam - | OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam - | OpenAIUserMessageParam.OpenAIFile - >; + text: string; /** - * Must be "user" to identify this as a user message + * Must be "text" to identify this as text content */ - role: 'user'; + type: 'text'; + } + /** + * Image content part for OpenAI-compatible chat completion messages. + */ + export interface OpenAIChatCompletionContentPartImageParam { /** - * (Optional) The name of the user message participant. + * Image URL specification and processing details */ - name?: string; - } + image_url: OpenAIChatCompletionContentPartImageParam.ImageURL; - export namespace OpenAIUserMessageParam { /** - * Text content part for OpenAI-compatible chat completion messages. + * Must be "image_url" to identify this as image content */ - export interface OpenAIChatCompletionContentPartTextParam { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } + type: 'image_url'; + } + export namespace OpenAIChatCompletionContentPartImageParam { /** - * Image content part for OpenAI-compatible chat completion messages. + * Image URL specification and processing details */ - export interface OpenAIChatCompletionContentPartImageParam { + export interface ImageURL { /** - * Image URL specification and processing details + * URL of the image to include in the message */ - image_url: OpenAIChatCompletionContentPartImageParam.ImageURL; + url: string; /** - * Must be "image_url" to identify this as image content + * (Optional) Level of detail for image processing. Can be "low", "high", or "auto" */ - type: 'image_url'; + detail?: string; } + } - export namespace OpenAIChatCompletionContentPartImageParam { - /** - * Image URL specification and processing details - */ - export interface ImageURL { - /** - * URL of the image to include in the message - */ - url: string; + export interface OpenAIFile { + file: OpenAIFile.File; - /** - * (Optional) Level of detail for image processing. Can be "low", "high", or "auto" - */ - detail?: string; - } - } + type: 'file'; + } - export interface OpenAIFile { - file: OpenAIFile.File; + export namespace OpenAIFile { + export interface File { + file_data?: string; - type: 'file'; + file_id?: string; + + filename?: string; } + } + } - export namespace OpenAIFile { - export interface File { - file_data?: string; + /** + * A system message providing instructions or context to the model. + */ + export interface OpenAISystemMessageParam { + /** + * The content of the "system prompt". If multiple system messages are provided, + * they are concatenated. The underlying Llama Stack code may also add other system + * messages (for example, for formatting tool definitions). + */ + content: string | Array; - file_id?: string; + /** + * Must be "system" to identify this as a system message + */ + role: 'system'; - filename?: string; - } - } - } + /** + * (Optional) The name of the system message participant. + */ + name?: string; + } + export namespace OpenAISystemMessageParam { /** - * A system message providing instructions or context to the model. + * Text content part for OpenAI-compatible chat completion messages. */ - export interface OpenAISystemMessageParam { + export interface UnionMember1 { /** - * The content of the "system prompt". If multiple system messages are provided, - * they are concatenated. The underlying Llama Stack code may also add other system - * messages (for example, for formatting tool definitions). + * The text content of the message */ - content: string | Array; + text: string; /** - * Must be "system" to identify this as a system message + * Must be "text" to identify this as text content */ - role: 'system'; + type: 'text'; + } + } + + /** + * A message containing the model's (assistant) response in an OpenAI-compatible + * chat completion request. + */ + export interface OpenAIAssistantMessageParam { + /** + * Must be "assistant" to identify this as the model's response + */ + role: 'assistant'; + + /** + * The content of the model's response + */ + content?: string | Array; + /** + * (Optional) The name of the assistant message participant. + */ + name?: string; + + /** + * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. + */ + tool_calls?: Array; + } + + export namespace OpenAIAssistantMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { /** - * (Optional) The name of the system message participant. + * The text content of the message */ - name?: string; - } + text: string; - export namespace OpenAISystemMessageParam { /** - * Text content part for OpenAI-compatible chat completion messages. + * Must be "text" to identify this as text content */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } + type: 'text'; } /** - * A message containing the model's (assistant) response in an OpenAI-compatible - * chat completion request. + * Tool call specification for OpenAI-compatible chat completion responses. */ - export interface OpenAIAssistantMessageParam { + export interface ToolCall { /** - * Must be "assistant" to identify this as the model's response + * Must be "function" to identify this as a function call */ - role: 'assistant'; + type: 'function'; /** - * The content of the model's response + * (Optional) Unique identifier for the tool call */ - content?: string | Array; + id?: string; /** - * (Optional) The name of the assistant message participant. + * (Optional) Function call details */ - name?: string; + function?: ToolCall.Function; /** - * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. + * (Optional) Index of the tool call in the list */ - tool_calls?: Array; + index?: number; } - export namespace OpenAIAssistantMessageParam { - /** - * Text content part for OpenAI-compatible chat completion messages. - */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } - + export namespace ToolCall { /** - * Tool call specification for OpenAI-compatible chat completion responses. + * (Optional) Function call details */ - export interface ToolCall { - /** - * Must be "function" to identify this as a function call - */ - type: 'function'; - - /** - * (Optional) Unique identifier for the tool call - */ - id?: string; - + export interface Function { /** - * (Optional) Function call details + * (Optional) Arguments to pass to the function as a JSON string */ - function?: ToolCall.Function; + arguments?: string; /** - * (Optional) Index of the tool call in the list + * (Optional) Name of the function to call */ - index?: number; + name?: string; } + } + } - export namespace ToolCall { - /** - * (Optional) Function call details - */ - export interface Function { - /** - * (Optional) Arguments to pass to the function as a JSON string - */ - arguments?: string; + /** + * A message representing the result of a tool invocation in an OpenAI-compatible + * chat completion request. + */ + export interface OpenAIToolMessageParam { + /** + * The response content from the tool + */ + content: string | Array; - /** - * (Optional) Name of the function to call - */ - name?: string; - } - } - } + /** + * Must be "tool" to identify this as a tool response + */ + role: 'tool'; /** - * A message representing the result of a tool invocation in an OpenAI-compatible - * chat completion request. + * Unique identifier for the tool call this response is for */ - export interface OpenAIToolMessageParam { - /** - * The response content from the tool - */ - content: string | Array; + tool_call_id: string; + } + export namespace OpenAIToolMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { /** - * Must be "tool" to identify this as a tool response + * The text content of the message */ - role: 'tool'; + text: string; /** - * Unique identifier for the tool call this response is for + * Must be "text" to identify this as text content */ - tool_call_id: string; + type: 'text'; } + } - export namespace OpenAIToolMessageParam { - /** - * Text content part for OpenAI-compatible chat completion messages. - */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } - } + /** + * A message from the developer in an OpenAI-compatible chat completion request. + */ + export interface OpenAIDeveloperMessageParam { + /** + * The content of the developer message + */ + content: string | Array; /** - * A message from the developer in an OpenAI-compatible chat completion request. + * Must be "developer" to identify this as a developer message */ - export interface OpenAIDeveloperMessageParam { - /** - * The content of the developer message - */ - content: string | Array; + role: 'developer'; - /** - * Must be "developer" to identify this as a developer message - */ - role: 'developer'; + /** + * (Optional) The name of the developer message participant. + */ + name?: string; + } + export namespace OpenAIDeveloperMessageParam { + /** + * Text content part for OpenAI-compatible chat completion messages. + */ + export interface UnionMember1 { /** - * (Optional) The name of the developer message participant. + * The text content of the message */ - name?: string; - } + text: string; - export namespace OpenAIDeveloperMessageParam { /** - * Text content part for OpenAI-compatible chat completion messages. + * Must be "text" to identify this as text content */ - export interface UnionMember1 { - /** - * The text content of the message - */ - text: string; - - /** - * Must be "text" to identify this as text content - */ - type: 'text'; - } + type: 'text'; } } } @@ -2471,17 +2451,7 @@ export interface CompletionCreateParamsStreaming extends CompletionCreateParamsB stream: true; } -export interface CompletionListParams { - /** - * The ID of the last chat completion to return. - */ - after?: string; - - /** - * The maximum number of chat completions to return. - */ - limit?: number; - +export interface CompletionListParams extends OpenAICursorPageParams { /** * The model to filter by. */ @@ -2493,11 +2463,14 @@ export interface CompletionListParams { order?: 'asc' | 'desc'; } +Completions.CompletionListResponsesOpenAICursorPage = CompletionListResponsesOpenAICursorPage; + export declare namespace Completions { export { type CompletionCreateResponse as CompletionCreateResponse, type CompletionRetrieveResponse as CompletionRetrieveResponse, type CompletionListResponse as CompletionListResponse, + CompletionListResponsesOpenAICursorPage as CompletionListResponsesOpenAICursorPage, type CompletionCreateParams as CompletionCreateParams, type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, diff --git a/src/resources/chat/index.ts b/src/resources/chat/index.ts index 31c9aba..2157334 100644 --- a/src/resources/chat/index.ts +++ b/src/resources/chat/index.ts @@ -2,6 +2,7 @@ export { Chat, type ChatCompletionChunk } from './chat'; export { + CompletionListResponsesOpenAICursorPage, Completions, type CompletionCreateResponse, type CompletionRetrieveResponse, diff --git a/src/resources/files.ts b/src/resources/files.ts index 7671fc4..4dc5223 100644 --- a/src/resources/files.ts +++ b/src/resources/files.ts @@ -3,6 +3,7 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; +import { OpenAICursorPage, type OpenAICursorPageParams } from '../pagination'; export class Files extends APIResource { /** @@ -26,16 +27,16 @@ export class Files extends APIResource { /** * Returns a list of files that belong to the user's organization. */ - list(query?: FileListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; + list(query?: FileListParams, options?: Core.RequestOptions): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( query: FileListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } - return this._client.get('/v1/openai/v1/files', { query, ...options }); + return this._client.getAPIList('/v1/openai/v1/files', FilesOpenAICursorPage, { query, ...options }); } /** @@ -53,6 +54,8 @@ export class Files extends APIResource { } } +export class FilesOpenAICursorPage extends OpenAICursorPage {} + /** * Response for deleting a file in OpenAI Files API. */ @@ -110,7 +113,7 @@ export interface File { /** * The intended purpose of the file */ - purpose: 'assistants'; + purpose: 'assistants' | 'batch'; } /** @@ -151,24 +154,10 @@ export interface FileCreateParams { /** * Valid purpose values for OpenAI Files API. */ - purpose: 'assistants'; + purpose: 'assistants' | 'batch'; } -export interface FileListParams { - /** - * A cursor for use in pagination. `after` is an object ID that defines your place - * in the list. For instance, if you make a list request and receive 100 objects, - * ending with obj_foo, your subsequent call can include after=obj_foo in order to - * fetch the next page of the list. - */ - after?: string; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and - * 10,000, and the default is 10,000. - */ - limit?: number; - +export interface FileListParams extends OpenAICursorPageParams { /** * Sort order by the `created_at` timestamp of the objects. `asc` for ascending * order and `desc` for descending order. @@ -178,15 +167,18 @@ export interface FileListParams { /** * Only return files with the given purpose. */ - purpose?: 'assistants'; + purpose?: 'assistants' | 'batch'; } +Files.FilesOpenAICursorPage = FilesOpenAICursorPage; + export declare namespace Files { export { type DeleteFileResponse as DeleteFileResponse, type File as File, type ListFilesResponse as ListFilesResponse, type FileContentResponse as FileContentResponse, + FilesOpenAICursorPage as FilesOpenAICursorPage, type FileCreateParams as FileCreateParams, type FileListParams as FileListParams, }; diff --git a/src/resources/index.ts b/src/resources/index.ts index ceba761..2c760b2 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -53,6 +53,7 @@ export { type EvalRunEvalAlphaParams, } from './eval/eval'; export { + FilesOpenAICursorPage, Files, type DeleteFileResponse, type File, @@ -97,6 +98,7 @@ export { } from './post-training/post-training'; export { Providers, type ListProvidersResponse, type ProviderListResponse } from './providers'; export { + ResponseListResponsesOpenAICursorPage, Responses, type ResponseObject, type ResponseObjectStream, @@ -144,10 +146,12 @@ export { type Trace, type TelemetryGetSpanResponse, type TelemetryGetSpanTreeResponse, + type TelemetryQueryMetricsResponse, type TelemetryQuerySpansResponse, type TelemetryQueryTracesResponse, type TelemetryGetSpanTreeParams, type TelemetryLogEventParams, + type TelemetryQueryMetricsParams, type TelemetryQuerySpansParams, type TelemetryQueryTracesParams, type TelemetrySaveSpansToDatasetParams, @@ -189,6 +193,7 @@ export { type VectorIoQueryParams, } from './vector-io'; export { + VectorStoresOpenAICursorPage, VectorStores, type ListVectorStoresResponse, type VectorStore, diff --git a/src/resources/inference.ts b/src/resources/inference.ts index ae1088b..a2669d6 100644 --- a/src/resources/inference.ts +++ b/src/resources/inference.ts @@ -109,7 +109,7 @@ export interface ChatCompletionResponseStreamChunk { /** * (Optional) List of metrics associated with the API response */ - metrics?: Array; + metrics?: Array; } export namespace ChatCompletionResponseStreamChunk { @@ -138,26 +138,6 @@ export namespace ChatCompletionResponseStreamChunk { */ stop_reason?: 'end_of_turn' | 'end_of_message' | 'out_of_tokens'; } - - /** - * A metric value included in API responses. - */ - export interface Metric { - /** - * The name of the metric - */ - metric: string; - - /** - * The numeric value of the metric - */ - value: number; - - /** - * (Optional) The unit of measurement for the metric value - */ - unit?: string; - } } /** @@ -182,29 +162,7 @@ export interface CompletionResponse { /** * (Optional) List of metrics associated with the API response */ - metrics?: Array; -} - -export namespace CompletionResponse { - /** - * A metric value included in API responses. - */ - export interface Metric { - /** - * The name of the metric - */ - metric: string; - - /** - * The numeric value of the metric - */ - value: number; - - /** - * (Optional) The unit of measurement for the metric value - */ - unit?: string; - } + metrics?: Array; } /** diff --git a/src/resources/moderations.ts b/src/resources/moderations.ts index aee9b57..a945ab3 100644 --- a/src/resources/moderations.ts +++ b/src/resources/moderations.ts @@ -55,11 +55,7 @@ export namespace CreateResponse { category_applied_input_types?: { [key: string]: Array }; /** - * A list of the categories along with their scores as predicted by model. Required - * set of categories that need to be in response - violence - violence/graphic - - * harassment - harassment/threatening - hate - hate/threatening - illicit - - * illicit/violent - sexual - sexual/minors - self-harm - self-harm/intent - - * self-harm/instructions + * A list of the categories along with their scores as predicted by model. */ category_scores?: { [key: string]: number }; diff --git a/src/resources/responses/index.ts b/src/resources/responses/index.ts index 6a19891..c4ea6a8 100644 --- a/src/resources/responses/index.ts +++ b/src/resources/responses/index.ts @@ -2,6 +2,7 @@ export { InputItems, type InputItemListResponse, type InputItemListParams } from './input-items'; export { + ResponseListResponsesOpenAICursorPage, Responses, type ResponseObject, type ResponseObjectStream, diff --git a/src/resources/responses/input-items.ts b/src/resources/responses/input-items.ts index ff21948..74c556c 100644 --- a/src/resources/responses/input-items.ts +++ b/src/resources/responses/input-items.ts @@ -95,7 +95,39 @@ export namespace InputItemListResponse { /** * (Optional) Search results returned by the file search operation */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; + results?: Array; + } + + export namespace OpenAIResponseOutputMessageFileSearchToolCall { + /** + * Search results returned by the file search operation. + */ + export interface Result { + /** + * (Optional) Key-value attributes associated with the file + */ + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; + + /** + * Unique identifier of the file containing the result + */ + file_id: string; + + /** + * Name of the file containing the result + */ + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; + } } /** diff --git a/src/resources/responses/responses.ts b/src/resources/responses/responses.ts index ad3f879..a5348d2 100644 --- a/src/resources/responses/responses.ts +++ b/src/resources/responses/responses.ts @@ -7,6 +7,7 @@ import * as Core from '../../core'; import * as ResponsesAPI from './responses'; import * as InputItemsAPI from './input-items'; import { InputItemListParams, InputItemListResponse, InputItems } from './input-items'; +import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination'; import { Stream } from '../../streaming'; export class Responses extends APIResource { @@ -45,19 +46,29 @@ export class Responses extends APIResource { /** * List all OpenAI responses. */ - list(query?: ResponseListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; + list( + query?: ResponseListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + options?: Core.RequestOptions, + ): Core.PagePromise; list( query: ResponseListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } - return this._client.get('/v1/openai/v1/responses', { query, ...options }); + return this._client.getAPIList('/v1/openai/v1/responses', ResponseListResponsesOpenAICursorPage, { + query, + ...options, + }); } } +export class ResponseListResponsesOpenAICursorPage extends OpenAICursorPage {} + /** * Complete OpenAI response object containing generation results and metadata. */ @@ -340,7 +351,39 @@ export namespace ResponseObject { /** * (Optional) Search results returned by the file search operation */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; + results?: Array; + } + + export namespace OpenAIResponseOutputMessageFileSearchToolCall { + /** + * Search results returned by the file search operation. + */ + export interface Result { + /** + * (Optional) Key-value attributes associated with the file + */ + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; + + /** + * Unique identifier of the file containing the result + */ + file_id: string; + + /** + * Name of the file containing the result + */ + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; + } } /** @@ -803,7 +846,39 @@ export namespace ResponseObjectStream { /** * (Optional) Search results returned by the file search operation */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; + results?: Array; + } + + export namespace OpenAIResponseOutputMessageFileSearchToolCall { + /** + * Search results returned by the file search operation. + */ + export interface Result { + /** + * (Optional) Key-value attributes associated with the file + */ + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; + + /** + * Unique identifier of the file containing the result + */ + file_id: string; + + /** + * Name of the file containing the result + */ + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; + } } /** @@ -1165,7 +1240,39 @@ export namespace ResponseObjectStream { /** * (Optional) Search results returned by the file search operation */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; + results?: Array; + } + + export namespace OpenAIResponseOutputMessageFileSearchToolCall { + /** + * Search results returned by the file search operation. + */ + export interface Result { + /** + * (Optional) Key-value attributes associated with the file + */ + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; + + /** + * Unique identifier of the file containing the result + */ + file_id: string; + + /** + * Name of the file containing the result + */ + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; + } } /** @@ -1687,765 +1794,797 @@ export namespace ResponseObjectStream { } /** - * Paginated list of OpenAI response objects with navigation metadata. + * OpenAI response object extended with input context information. */ export interface ResponseListResponse { /** - * List of response objects with their input context + * Unique identifier for this response + */ + id: string; + + /** + * Unix timestamp when the response was created + */ + created_at: number; + + /** + * List of input items that led to this response + */ + input: Array< + | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall + | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall + | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall + | ResponseListResponse.OpenAIResponseInputFunctionToolCallOutput + | ResponseListResponse.OpenAIResponseMessage + >; + + /** + * Model identifier used for generation + */ + model: string; + + /** + * Object type identifier, always "response" + */ + object: 'response'; + + /** + * List of generated output items (messages, tool calls, etc.) + */ + output: Array< + | ResponseListResponse.OpenAIResponseMessage + | ResponseListResponse.OpenAIResponseOutputMessageWebSearchToolCall + | ResponseListResponse.OpenAIResponseOutputMessageFileSearchToolCall + | ResponseListResponse.OpenAIResponseOutputMessageFunctionToolCall + | ResponseListResponse.OpenAIResponseOutputMessageMcpCall + | ResponseListResponse.OpenAIResponseOutputMessageMcpListTools + >; + + /** + * Whether tool calls can be executed in parallel + */ + parallel_tool_calls: boolean; + + /** + * Current status of the response generation + */ + status: string; + + /** + * Text formatting configuration for the response + */ + text: ResponseListResponse.Text; + + /** + * (Optional) Error details if the response generation failed + */ + error?: ResponseListResponse.Error; + + /** + * (Optional) ID of the previous response in a conversation */ - data: Array; + previous_response_id?: string; /** - * Identifier of the first item in this page + * (Optional) Sampling temperature used for generation */ - first_id: string; + temperature?: number; /** - * Whether there are more results available beyond this page + * (Optional) Nucleus sampling parameter used for generation */ - has_more: boolean; + top_p?: number; /** - * Identifier of the last item in this page + * (Optional) Truncation strategy applied to the response */ - last_id: string; + truncation?: string; /** - * Object type identifier, always "list" + * (Optional) User identifier associated with the request */ - object: 'list'; + user?: string; } export namespace ResponseListResponse { /** - * OpenAI response object extended with input context information. + * Web search tool call output message for OpenAI responses. */ - export interface Data { + export interface OpenAIResponseOutputMessageWebSearchToolCall { /** - * Unique identifier for this response + * Unique identifier for this tool call */ id: string; /** - * Unix timestamp when the response was created + * Current status of the web search operation */ - created_at: number; + status: string; /** - * List of input items that led to this response + * Tool call type identifier, always "web_search_call" */ - input: Array< - | Data.OpenAIResponseOutputMessageWebSearchToolCall - | Data.OpenAIResponseOutputMessageFileSearchToolCall - | Data.OpenAIResponseOutputMessageFunctionToolCall - | Data.OpenAIResponseInputFunctionToolCallOutput - | Data.OpenAIResponseMessage - >; + type: 'web_search_call'; + } + /** + * File search tool call output message for OpenAI responses. + */ + export interface OpenAIResponseOutputMessageFileSearchToolCall { /** - * Model identifier used for generation + * Unique identifier for this tool call */ - model: string; + id: string; /** - * Object type identifier, always "response" + * List of search queries executed */ - object: 'response'; + queries: Array; /** - * List of generated output items (messages, tool calls, etc.) + * Current status of the file search operation */ - output: Array< - | Data.OpenAIResponseMessage - | Data.OpenAIResponseOutputMessageWebSearchToolCall - | Data.OpenAIResponseOutputMessageFileSearchToolCall - | Data.OpenAIResponseOutputMessageFunctionToolCall - | Data.OpenAIResponseOutputMessageMcpCall - | Data.OpenAIResponseOutputMessageMcpListTools - >; + status: string; /** - * Whether tool calls can be executed in parallel + * Tool call type identifier, always "file_search_call" */ - parallel_tool_calls: boolean; + type: 'file_search_call'; /** - * Current status of the response generation + * (Optional) Search results returned by the file search operation */ - status: string; + results?: Array; + } + export namespace OpenAIResponseOutputMessageFileSearchToolCall { /** - * Text formatting configuration for the response + * Search results returned by the file search operation. */ - text: Data.Text; + export interface Result { + /** + * (Optional) Key-value attributes associated with the file + */ + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; + + /** + * Unique identifier of the file containing the result + */ + file_id: string; + + /** + * Name of the file containing the result + */ + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; + } + } + /** + * Function tool call output message for OpenAI responses. + */ + export interface OpenAIResponseOutputMessageFunctionToolCall { /** - * (Optional) Error details if the response generation failed + * JSON string containing the function arguments */ - error?: Data.Error; + arguments: string; /** - * (Optional) ID of the previous response in a conversation + * Unique identifier for the function call */ - previous_response_id?: string; + call_id: string; /** - * (Optional) Sampling temperature used for generation + * Name of the function being called */ - temperature?: number; + name: string; /** - * (Optional) Nucleus sampling parameter used for generation + * Tool call type identifier, always "function_call" */ - top_p?: number; + type: 'function_call'; /** - * (Optional) Truncation strategy applied to the response + * (Optional) Additional identifier for the tool call */ - truncation?: string; + id?: string; /** - * (Optional) User identifier associated with the request + * (Optional) Current status of the function call execution */ - user?: string; + status?: string; + } + + /** + * This represents the output of a function call that gets passed back to the + * model. + */ + export interface OpenAIResponseInputFunctionToolCallOutput { + call_id: string; + + output: string; + + type: 'function_call_output'; + + id?: string; + + status?: string; + } + + /** + * Corresponds to the various Message types in the Responses API. They are all + * under one type because the Responses API gives them all the same "type" value, + * and there is no way to tell them apart in certain scenarios. + */ + export interface OpenAIResponseMessage { + content: + | string + | Array< + | OpenAIResponseMessage.OpenAIResponseInputMessageContentText + | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage + > + | Array; + + role: 'system' | 'developer' | 'user' | 'assistant'; + + type: 'message'; + + id?: string; + + status?: string; } - export namespace Data { + export namespace OpenAIResponseMessage { /** - * Web search tool call output message for OpenAI responses. + * Text content for input messages in OpenAI response format. */ - export interface OpenAIResponseOutputMessageWebSearchToolCall { - /** - * Unique identifier for this tool call - */ - id: string; - + export interface OpenAIResponseInputMessageContentText { /** - * Current status of the web search operation + * The text content of the input message */ - status: string; + text: string; /** - * Tool call type identifier, always "web_search_call" + * Content type identifier, always "input_text" */ - type: 'web_search_call'; + type: 'input_text'; } /** - * File search tool call output message for OpenAI responses. + * Image content for input messages in OpenAI response format. */ - export interface OpenAIResponseOutputMessageFileSearchToolCall { + export interface OpenAIResponseInputMessageContentImage { /** - * Unique identifier for this tool call + * Level of detail for image processing, can be "low", "high", or "auto" */ - id: string; + detail: 'low' | 'high' | 'auto'; /** - * List of search queries executed + * Content type identifier, always "input_image" */ - queries: Array; + type: 'input_image'; /** - * Current status of the file search operation + * (Optional) URL of the image content */ - status: string; - - /** - * Tool call type identifier, always "file_search_call" - */ - type: 'file_search_call'; - - /** - * (Optional) Search results returned by the file search operation - */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; + image_url?: string; } - /** - * Function tool call output message for OpenAI responses. - */ - export interface OpenAIResponseOutputMessageFunctionToolCall { - /** - * JSON string containing the function arguments - */ - arguments: string; - - /** - * Unique identifier for the function call - */ - call_id: string; - - /** - * Name of the function being called - */ - name: string; + export interface UnionMember2 { + annotations: Array< + | UnionMember2.OpenAIResponseAnnotationFileCitation + | UnionMember2.OpenAIResponseAnnotationCitation + | UnionMember2.OpenAIResponseAnnotationContainerFileCitation + | UnionMember2.OpenAIResponseAnnotationFilePath + >; - /** - * Tool call type identifier, always "function_call" - */ - type: 'function_call'; + text: string; - /** - * (Optional) Additional identifier for the tool call - */ - id?: string; + type: 'output_text'; + } + export namespace UnionMember2 { /** - * (Optional) Current status of the function call execution + * File citation annotation for referencing specific files in response content. */ - status?: string; - } - - /** - * This represents the output of a function call that gets passed back to the - * model. - */ - export interface OpenAIResponseInputFunctionToolCallOutput { - call_id: string; - - output: string; - - type: 'function_call_output'; - - id?: string; - - status?: string; - } - - /** - * Corresponds to the various Message types in the Responses API. They are all - * under one type because the Responses API gives them all the same "type" value, - * and there is no way to tell them apart in certain scenarios. - */ - export interface OpenAIResponseMessage { - content: - | string - | Array< - | OpenAIResponseMessage.OpenAIResponseInputMessageContentText - | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage - > - | Array; - - role: 'system' | 'developer' | 'user' | 'assistant'; - - type: 'message'; - - id?: string; + export interface OpenAIResponseAnnotationFileCitation { + /** + * Unique identifier of the referenced file + */ + file_id: string; - status?: string; - } + /** + * Name of the referenced file + */ + filename: string; - export namespace OpenAIResponseMessage { - /** - * Text content for input messages in OpenAI response format. - */ - export interface OpenAIResponseInputMessageContentText { /** - * The text content of the input message + * Position index of the citation within the content */ - text: string; + index: number; /** - * Content type identifier, always "input_text" + * Annotation type identifier, always "file_citation" */ - type: 'input_text'; + type: 'file_citation'; } /** - * Image content for input messages in OpenAI response format. + * URL citation annotation for referencing external web resources. */ - export interface OpenAIResponseInputMessageContentImage { + export interface OpenAIResponseAnnotationCitation { /** - * Level of detail for image processing, can be "low", "high", or "auto" + * End position of the citation span in the content */ - detail: 'low' | 'high' | 'auto'; + end_index: number; /** - * Content type identifier, always "input_image" + * Start position of the citation span in the content */ - type: 'input_image'; + start_index: number; /** - * (Optional) URL of the image content + * Title of the referenced web resource */ - image_url?: string; - } - - export interface UnionMember2 { - annotations: Array< - | UnionMember2.OpenAIResponseAnnotationFileCitation - | UnionMember2.OpenAIResponseAnnotationCitation - | UnionMember2.OpenAIResponseAnnotationContainerFileCitation - | UnionMember2.OpenAIResponseAnnotationFilePath - >; - - text: string; - - type: 'output_text'; - } + title: string; - export namespace UnionMember2 { /** - * File citation annotation for referencing specific files in response content. + * Annotation type identifier, always "url_citation" */ - export interface OpenAIResponseAnnotationFileCitation { - /** - * Unique identifier of the referenced file - */ - file_id: string; + type: 'url_citation'; - /** - * Name of the referenced file - */ - filename: string; + /** + * URL of the referenced web resource + */ + url: string; + } - /** - * Position index of the citation within the content - */ - index: number; + export interface OpenAIResponseAnnotationContainerFileCitation { + container_id: string; - /** - * Annotation type identifier, always "file_citation" - */ - type: 'file_citation'; - } + end_index: number; - /** - * URL citation annotation for referencing external web resources. - */ - export interface OpenAIResponseAnnotationCitation { - /** - * End position of the citation span in the content - */ - end_index: number; + file_id: string; - /** - * Start position of the citation span in the content - */ - start_index: number; + filename: string; - /** - * Title of the referenced web resource - */ - title: string; + start_index: number; - /** - * Annotation type identifier, always "url_citation" - */ - type: 'url_citation'; + type: 'container_file_citation'; + } - /** - * URL of the referenced web resource - */ - url: string; - } + export interface OpenAIResponseAnnotationFilePath { + file_id: string; - export interface OpenAIResponseAnnotationContainerFileCitation { - container_id: string; + index: number; - end_index: number; + type: 'file_path'; + } + } + } - file_id: string; + /** + * Corresponds to the various Message types in the Responses API. They are all + * under one type because the Responses API gives them all the same "type" value, + * and there is no way to tell them apart in certain scenarios. + */ + export interface OpenAIResponseMessage { + content: + | string + | Array< + | OpenAIResponseMessage.OpenAIResponseInputMessageContentText + | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage + > + | Array; - filename: string; + role: 'system' | 'developer' | 'user' | 'assistant'; - start_index: number; + type: 'message'; - type: 'container_file_citation'; - } + id?: string; - export interface OpenAIResponseAnnotationFilePath { - file_id: string; + status?: string; + } - index: number; + export namespace OpenAIResponseMessage { + /** + * Text content for input messages in OpenAI response format. + */ + export interface OpenAIResponseInputMessageContentText { + /** + * The text content of the input message + */ + text: string; - type: 'file_path'; - } - } + /** + * Content type identifier, always "input_text" + */ + type: 'input_text'; } /** - * Corresponds to the various Message types in the Responses API. They are all - * under one type because the Responses API gives them all the same "type" value, - * and there is no way to tell them apart in certain scenarios. - */ - export interface OpenAIResponseMessage { - content: - | string - | Array< - | OpenAIResponseMessage.OpenAIResponseInputMessageContentText - | OpenAIResponseMessage.OpenAIResponseInputMessageContentImage - > - | Array; + * Image content for input messages in OpenAI response format. + */ + export interface OpenAIResponseInputMessageContentImage { + /** + * Level of detail for image processing, can be "low", "high", or "auto" + */ + detail: 'low' | 'high' | 'auto'; - role: 'system' | 'developer' | 'user' | 'assistant'; + /** + * Content type identifier, always "input_image" + */ + type: 'input_image'; - type: 'message'; + /** + * (Optional) URL of the image content + */ + image_url?: string; + } - id?: string; + export interface UnionMember2 { + annotations: Array< + | UnionMember2.OpenAIResponseAnnotationFileCitation + | UnionMember2.OpenAIResponseAnnotationCitation + | UnionMember2.OpenAIResponseAnnotationContainerFileCitation + | UnionMember2.OpenAIResponseAnnotationFilePath + >; - status?: string; + text: string; + + type: 'output_text'; } - export namespace OpenAIResponseMessage { + export namespace UnionMember2 { /** - * Text content for input messages in OpenAI response format. + * File citation annotation for referencing specific files in response content. */ - export interface OpenAIResponseInputMessageContentText { + export interface OpenAIResponseAnnotationFileCitation { /** - * The text content of the input message + * Unique identifier of the referenced file */ - text: string; + file_id: string; /** - * Content type identifier, always "input_text" + * Name of the referenced file */ - type: 'input_text'; + filename: string; + + /** + * Position index of the citation within the content + */ + index: number; + + /** + * Annotation type identifier, always "file_citation" + */ + type: 'file_citation'; } /** - * Image content for input messages in OpenAI response format. + * URL citation annotation for referencing external web resources. */ - export interface OpenAIResponseInputMessageContentImage { + export interface OpenAIResponseAnnotationCitation { /** - * Level of detail for image processing, can be "low", "high", or "auto" + * End position of the citation span in the content */ - detail: 'low' | 'high' | 'auto'; + end_index: number; /** - * Content type identifier, always "input_image" + * Start position of the citation span in the content */ - type: 'input_image'; + start_index: number; /** - * (Optional) URL of the image content + * Title of the referenced web resource */ - image_url?: string; - } - - export interface UnionMember2 { - annotations: Array< - | UnionMember2.OpenAIResponseAnnotationFileCitation - | UnionMember2.OpenAIResponseAnnotationCitation - | UnionMember2.OpenAIResponseAnnotationContainerFileCitation - | UnionMember2.OpenAIResponseAnnotationFilePath - >; - - text: string; + title: string; - type: 'output_text'; - } + /** + * Annotation type identifier, always "url_citation" + */ + type: 'url_citation'; - export namespace UnionMember2 { /** - * File citation annotation for referencing specific files in response content. + * URL of the referenced web resource */ - export interface OpenAIResponseAnnotationFileCitation { - /** - * Unique identifier of the referenced file - */ - file_id: string; + url: string; + } - /** - * Name of the referenced file - */ - filename: string; + export interface OpenAIResponseAnnotationContainerFileCitation { + container_id: string; - /** - * Position index of the citation within the content - */ - index: number; + end_index: number; - /** - * Annotation type identifier, always "file_citation" - */ - type: 'file_citation'; - } + file_id: string; - /** - * URL citation annotation for referencing external web resources. - */ - export interface OpenAIResponseAnnotationCitation { - /** - * End position of the citation span in the content - */ - end_index: number; + filename: string; - /** - * Start position of the citation span in the content - */ - start_index: number; + start_index: number; - /** - * Title of the referenced web resource - */ - title: string; + type: 'container_file_citation'; + } - /** - * Annotation type identifier, always "url_citation" - */ - type: 'url_citation'; + export interface OpenAIResponseAnnotationFilePath { + file_id: string; - /** - * URL of the referenced web resource - */ - url: string; - } + index: number; - export interface OpenAIResponseAnnotationContainerFileCitation { - container_id: string; + type: 'file_path'; + } + } + } - end_index: number; + /** + * Web search tool call output message for OpenAI responses. + */ + export interface OpenAIResponseOutputMessageWebSearchToolCall { + /** + * Unique identifier for this tool call + */ + id: string; - file_id: string; + /** + * Current status of the web search operation + */ + status: string; - filename: string; + /** + * Tool call type identifier, always "web_search_call" + */ + type: 'web_search_call'; + } - start_index: number; + /** + * File search tool call output message for OpenAI responses. + */ + export interface OpenAIResponseOutputMessageFileSearchToolCall { + /** + * Unique identifier for this tool call + */ + id: string; - type: 'container_file_citation'; - } + /** + * List of search queries executed + */ + queries: Array; - export interface OpenAIResponseAnnotationFilePath { - file_id: string; + /** + * Current status of the file search operation + */ + status: string; - index: number; + /** + * Tool call type identifier, always "file_search_call" + */ + type: 'file_search_call'; - type: 'file_path'; - } - } - } + /** + * (Optional) Search results returned by the file search operation + */ + results?: Array; + } + export namespace OpenAIResponseOutputMessageFileSearchToolCall { /** - * Web search tool call output message for OpenAI responses. + * Search results returned by the file search operation. */ - export interface OpenAIResponseOutputMessageWebSearchToolCall { + export interface Result { /** - * Unique identifier for this tool call + * (Optional) Key-value attributes associated with the file */ - id: string; + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; /** - * Current status of the web search operation + * Unique identifier of the file containing the result */ - status: string; + file_id: string; /** - * Tool call type identifier, always "web_search_call" + * Name of the file containing the result */ - type: 'web_search_call'; + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; } + } + + /** + * Function tool call output message for OpenAI responses. + */ + export interface OpenAIResponseOutputMessageFunctionToolCall { + /** + * JSON string containing the function arguments + */ + arguments: string; + + /** + * Unique identifier for the function call + */ + call_id: string; + + /** + * Name of the function being called + */ + name: string; + + /** + * Tool call type identifier, always "function_call" + */ + type: 'function_call'; + + /** + * (Optional) Additional identifier for the tool call + */ + id?: string; + + /** + * (Optional) Current status of the function call execution + */ + status?: string; + } + /** + * Model Context Protocol (MCP) call output message for OpenAI responses. + */ + export interface OpenAIResponseOutputMessageMcpCall { /** - * File search tool call output message for OpenAI responses. + * Unique identifier for this MCP call */ - export interface OpenAIResponseOutputMessageFileSearchToolCall { - /** - * Unique identifier for this tool call - */ - id: string; - - /** - * List of search queries executed - */ - queries: Array; + id: string; - /** - * Current status of the file search operation - */ - status: string; + /** + * JSON string containing the MCP call arguments + */ + arguments: string; - /** - * Tool call type identifier, always "file_search_call" - */ - type: 'file_search_call'; + /** + * Name of the MCP method being called + */ + name: string; - /** - * (Optional) Search results returned by the file search operation - */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; - } + /** + * Label identifying the MCP server handling the call + */ + server_label: string; /** - * Function tool call output message for OpenAI responses. + * Tool call type identifier, always "mcp_call" */ - export interface OpenAIResponseOutputMessageFunctionToolCall { - /** - * JSON string containing the function arguments - */ - arguments: string; + type: 'mcp_call'; - /** - * Unique identifier for the function call - */ - call_id: string; + /** + * (Optional) Error message if the MCP call failed + */ + error?: string; - /** - * Name of the function being called - */ - name: string; + /** + * (Optional) Output result from the successful MCP call + */ + output?: string; + } - /** - * Tool call type identifier, always "function_call" - */ - type: 'function_call'; + /** + * MCP list tools output message containing available tools from an MCP server. + */ + export interface OpenAIResponseOutputMessageMcpListTools { + /** + * Unique identifier for this MCP list tools operation + */ + id: string; - /** - * (Optional) Additional identifier for the tool call - */ - id?: string; + /** + * Label identifying the MCP server providing the tools + */ + server_label: string; - /** - * (Optional) Current status of the function call execution - */ - status?: string; - } + /** + * List of available tools provided by the MCP server + */ + tools: Array; /** - * Model Context Protocol (MCP) call output message for OpenAI responses. + * Tool call type identifier, always "mcp_list_tools" */ - export interface OpenAIResponseOutputMessageMcpCall { - /** - * Unique identifier for this MCP call - */ - id: string; + type: 'mcp_list_tools'; + } + export namespace OpenAIResponseOutputMessageMcpListTools { + /** + * Tool definition returned by MCP list tools operation. + */ + export interface Tool { /** - * JSON string containing the MCP call arguments + * JSON schema defining the tool's input parameters */ - arguments: string; + input_schema: { [key: string]: boolean | number | string | Array | unknown | null }; /** - * Name of the MCP method being called + * Name of the tool */ name: string; /** - * Label identifying the MCP server handling the call - */ - server_label: string; - - /** - * Tool call type identifier, always "mcp_call" - */ - type: 'mcp_call'; - - /** - * (Optional) Error message if the MCP call failed - */ - error?: string; - - /** - * (Optional) Output result from the successful MCP call + * (Optional) Description of what the tool does */ - output?: string; + description?: string; } + } + /** + * Text formatting configuration for the response + */ + export interface Text { /** - * MCP list tools output message containing available tools from an MCP server. + * (Optional) Text format configuration specifying output format requirements */ - export interface OpenAIResponseOutputMessageMcpListTools { + format?: Text.Format; + } + + export namespace Text { + /** + * (Optional) Text format configuration specifying output format requirements + */ + export interface Format { /** - * Unique identifier for this MCP list tools operation + * Must be "text", "json_schema", or "json_object" to identify the format type */ - id: string; + type: 'text' | 'json_schema' | 'json_object'; /** - * Label identifying the MCP server providing the tools + * (Optional) A description of the response format. Only used for json_schema. */ - server_label: string; + description?: string; /** - * List of available tools provided by the MCP server + * The name of the response format. Only used for json_schema. */ - tools: Array; + name?: string; /** - * Tool call type identifier, always "mcp_list_tools" + * The JSON schema the response should conform to. In a Python SDK, this is often a + * `pydantic` model. Only used for json_schema. */ - type: 'mcp_list_tools'; - } + schema?: { [key: string]: boolean | number | string | Array | unknown | null }; - export namespace OpenAIResponseOutputMessageMcpListTools { /** - * Tool definition returned by MCP list tools operation. + * (Optional) Whether to strictly enforce the JSON schema. If true, the response + * must match the schema exactly. Only used for json_schema. */ - export interface Tool { - /** - * JSON schema defining the tool's input parameters - */ - input_schema: { [key: string]: boolean | number | string | Array | unknown | null }; - - /** - * Name of the tool - */ - name: string; - - /** - * (Optional) Description of what the tool does - */ - description?: string; - } + strict?: boolean; } + } + /** + * (Optional) Error details if the response generation failed + */ + export interface Error { /** - * Text formatting configuration for the response + * Error code identifying the type of failure */ - export interface Text { - /** - * (Optional) Text format configuration specifying output format requirements - */ - format?: Text.Format; - } - - export namespace Text { - /** - * (Optional) Text format configuration specifying output format requirements - */ - export interface Format { - /** - * Must be "text", "json_schema", or "json_object" to identify the format type - */ - type: 'text' | 'json_schema' | 'json_object'; - - /** - * (Optional) A description of the response format. Only used for json_schema. - */ - description?: string; - - /** - * The name of the response format. Only used for json_schema. - */ - name?: string; - - /** - * The JSON schema the response should conform to. In a Python SDK, this is often a - * `pydantic` model. Only used for json_schema. - */ - schema?: { [key: string]: boolean | number | string | Array | unknown | null }; - - /** - * (Optional) Whether to strictly enforce the JSON schema. If true, the response - * must match the schema exactly. Only used for json_schema. - */ - strict?: boolean; - } - } + code: string; /** - * (Optional) Error details if the response generation failed + * Human-readable error message describing the failure */ - export interface Error { - /** - * Error code identifying the type of failure - */ - code: string; - - /** - * Human-readable error message describing the failure - */ - message: string; - } + message: string; } } @@ -2470,6 +2609,11 @@ export interface ResponseCreateParamsBase { */ model: string; + /** + * (Optional) Additional fields to include in the response. + */ + include?: Array; + instructions?: string; max_infer_iters?: number; @@ -2548,7 +2692,39 @@ export namespace ResponseCreateParams { /** * (Optional) Search results returned by the file search operation */ - results?: Array<{ [key: string]: boolean | number | string | Array | unknown | null }>; + results?: Array; + } + + export namespace OpenAIResponseOutputMessageFileSearchToolCall { + /** + * Search results returned by the file search operation. + */ + export interface Result { + /** + * (Optional) Key-value attributes associated with the file + */ + attributes: { [key: string]: boolean | number | string | Array | unknown | null }; + + /** + * Unique identifier of the file containing the result + */ + file_id: string; + + /** + * Name of the file containing the result + */ + filename: string; + + /** + * Relevance score for this search result (between 0 and 1) + */ + score: number; + + /** + * Text content of the search result + */ + text: string; + } } /** @@ -2964,17 +3140,7 @@ export interface ResponseCreateParamsStreaming extends ResponseCreateParamsBase stream: true; } -export interface ResponseListParams { - /** - * The ID of the last response to return. - */ - after?: string; - - /** - * The number of responses to return. - */ - limit?: number; - +export interface ResponseListParams extends OpenAICursorPageParams { /** * The model to filter responses by. */ @@ -2986,6 +3152,7 @@ export interface ResponseListParams { order?: 'asc' | 'desc'; } +Responses.ResponseListResponsesOpenAICursorPage = ResponseListResponsesOpenAICursorPage; Responses.InputItems = InputItems; export declare namespace Responses { @@ -2993,6 +3160,7 @@ export declare namespace Responses { type ResponseObject as ResponseObject, type ResponseObjectStream as ResponseObjectStream, type ResponseListResponse as ResponseListResponse, + ResponseListResponsesOpenAICursorPage as ResponseListResponsesOpenAICursorPage, type ResponseCreateParams as ResponseCreateParams, type ResponseCreateParamsNonStreaming as ResponseCreateParamsNonStreaming, type ResponseCreateParamsStreaming as ResponseCreateParamsStreaming, diff --git a/src/resources/scoring-functions.ts b/src/resources/scoring-functions.ts index e4e3c33..1e9294f 100644 --- a/src/resources/scoring-functions.ts +++ b/src/resources/scoring-functions.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as Shared from './shared'; export class ScoringFunctions extends APIResource { /** @@ -49,7 +48,7 @@ export interface ScoringFn { provider_id: string; - return_type: Shared.ReturnType; + return_type: ScoringFn.ReturnType; /** * The resource type, always scoring_function @@ -66,6 +65,22 @@ export interface ScoringFn { provider_resource_id?: string; } +export namespace ScoringFn { + export interface ReturnType { + type: + | 'string' + | 'number' + | 'boolean' + | 'array' + | 'object' + | 'json' + | 'union' + | 'chat_completion_input' + | 'completion_input' + | 'agent_turn_input'; + } +} + /** * Parameters for LLM-as-judge scoring function configuration. */ @@ -155,7 +170,7 @@ export interface ScoringFunctionRegisterParams { */ description: string; - return_type: Shared.ReturnType; + return_type: ScoringFunctionRegisterParams.ReturnType; /** * The ID of the scoring function to register. @@ -179,6 +194,22 @@ export interface ScoringFunctionRegisterParams { provider_scoring_fn_id?: string; } +export namespace ScoringFunctionRegisterParams { + export interface ReturnType { + type: + | 'string' + | 'number' + | 'boolean' + | 'array' + | 'object' + | 'json' + | 'union' + | 'chat_completion_input' + | 'completion_input' + | 'agent_turn_input'; + } +} + export declare namespace ScoringFunctions { export { type ListScoringFunctionsResponse as ListScoringFunctionsResponse, diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 7f6fa8b..00c767f 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -132,29 +132,7 @@ export interface ChatCompletionResponse { /** * (Optional) List of metrics associated with the API response */ - metrics?: Array; -} - -export namespace ChatCompletionResponse { - /** - * A metric value included in API responses. - */ - export interface Metric { - /** - * The name of the metric - */ - metric: string; - - /** - * The numeric value of the metric - */ - value: number; - - /** - * (Optional) The unit of measurement for the metric value - */ - unit?: string; - } + metrics?: Array; } /** @@ -235,7 +213,7 @@ export namespace ContentDelta { /** * Either an in-progress tool call string or the final parsed tool call */ - tool_call: Shared.ToolCallOrString; + tool_call: string | Shared.ToolCall; /** * Discriminator type of the delta. Always "tool_call" @@ -494,6 +472,26 @@ export namespace InterleavedContentItem { */ export type Message = UserMessage | SystemMessage | ToolResponseMessage | CompletionMessage; +/** + * A metric value included in API responses. + */ +export interface Metric { + /** + * The name of the metric + */ + metric: string; + + /** + * The numeric value of the metric + */ + value: number; + + /** + * (Optional) The unit of measurement for the metric value + */ + unit?: string; +} + /** * Parameter type for string values. */ @@ -781,20 +779,6 @@ export namespace ResponseFormat { } } -export interface ReturnType { - type: - | 'string' - | 'number' - | 'boolean' - | 'array' - | 'object' - | 'json' - | 'union' - | 'chat_completion_input' - | 'completion_input' - | 'agent_turn_input'; -} - /** * Details of a safety violation detected by content moderation. */ @@ -949,11 +933,6 @@ export interface ToolCall { arguments_json?: string; } -/** - * Either an in-progress tool call string or the final parsed tool call - */ -export type ToolCallOrString = string | ToolCall; - export interface ToolParamDefinition { param_type: string; diff --git a/src/resources/telemetry.ts b/src/resources/telemetry.ts index 3e47e3c..8064a72 100644 --- a/src/resources/telemetry.ts +++ b/src/resources/telemetry.ts @@ -48,6 +48,21 @@ export class Telemetry extends APIResource { }); } + /** + * Query metrics. + */ + queryMetrics( + metricName: string, + body: TelemetryQueryMetricsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.post(`/v1/telemetry/metrics/${metricName}`, { body, ...options }) as Core.APIPromise<{ + data: TelemetryQueryMetricsResponse; + }> + )._thenUnwrap((obj) => obj.data); + } + /** * Query spans. */ @@ -401,6 +416,68 @@ export interface TelemetryGetSpanResponse { */ export type TelemetryGetSpanTreeResponse = { [key: string]: SpanWithStatus }; +/** + * List of metric series matching the query criteria + */ +export type TelemetryQueryMetricsResponse = + Array; + +export namespace TelemetryQueryMetricsResponse { + /** + * A time series of metric data points. + */ + export interface TelemetryQueryMetricsResponseItem { + /** + * List of labels associated with this metric series + */ + labels: Array; + + /** + * The name of the metric + */ + metric: string; + + /** + * List of data points in chronological order + */ + values: Array; + } + + export namespace TelemetryQueryMetricsResponseItem { + /** + * A label associated with a metric. + */ + export interface Label { + /** + * The name of the label + */ + name: string; + + /** + * The value of the label + */ + value: string; + } + + /** + * A single data point in a metric time series. + */ + export interface Value { + /** + * Unix timestamp when the metric value was recorded + */ + timestamp: number; + + unit: string; + + /** + * The numeric value of the metric at this timestamp + */ + value: number; + } + } +} + /** * List of spans matching the query criteria */ @@ -477,6 +554,55 @@ export interface TelemetryLogEventParams { ttl_seconds: number; } +export interface TelemetryQueryMetricsParams { + /** + * The type of query to perform. + */ + query_type: 'range' | 'instant'; + + /** + * The start time of the metric to query. + */ + start_time: number; + + /** + * The end time of the metric to query. + */ + end_time?: number; + + /** + * The granularity of the metric to query. + */ + granularity?: string; + + /** + * The label matchers to apply to the metric. + */ + label_matchers?: Array; +} + +export namespace TelemetryQueryMetricsParams { + /** + * A matcher for filtering metrics by label values. + */ + export interface LabelMatcher { + /** + * The name of the label to match + */ + name: string; + + /** + * The comparison operator to use for matching + */ + operator: '=' | '!=' | '=~' | '!~'; + + /** + * The value to match against + */ + value: string; + } +} + export interface TelemetryQuerySpansParams { /** * The attribute filters to apply to the spans. @@ -547,10 +673,12 @@ export declare namespace Telemetry { type Trace as Trace, type TelemetryGetSpanResponse as TelemetryGetSpanResponse, type TelemetryGetSpanTreeResponse as TelemetryGetSpanTreeResponse, + type TelemetryQueryMetricsResponse as TelemetryQueryMetricsResponse, type TelemetryQuerySpansResponse as TelemetryQuerySpansResponse, type TelemetryQueryTracesResponse as TelemetryQueryTracesResponse, type TelemetryGetSpanTreeParams as TelemetryGetSpanTreeParams, type TelemetryLogEventParams as TelemetryLogEventParams, + type TelemetryQueryMetricsParams as TelemetryQueryMetricsParams, type TelemetryQuerySpansParams as TelemetryQuerySpansParams, type TelemetryQueryTracesParams as TelemetryQueryTracesParams, type TelemetrySaveSpansToDatasetParams as TelemetrySaveSpansToDatasetParams, diff --git a/src/resources/vector-stores/files.ts b/src/resources/vector-stores/files.ts index a0cbdab..bc950cc 100644 --- a/src/resources/vector-stores/files.ts +++ b/src/resources/vector-stores/files.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; +import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination'; export class Files extends APIResource { /** @@ -49,17 +50,24 @@ export class Files extends APIResource { vectorStoreId: string, query?: FileListParams, options?: Core.RequestOptions, - ): Core.APIPromise; - list(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise; + ): Core.PagePromise; + list( + vectorStoreId: string, + options?: Core.RequestOptions, + ): Core.PagePromise; list( vectorStoreId: string, query: FileListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list(vectorStoreId, {}, query); } - return this._client.get(`/v1/openai/v1/vector_stores/${vectorStoreId}/files`, { query, ...options }); + return this._client.getAPIList( + `/v1/openai/v1/vector_stores/${vectorStoreId}/files`, + VectorStoreFilesOpenAICursorPage, + { query, ...options }, + ); } /** @@ -85,6 +93,8 @@ export class Files extends APIResource { } } +export class VectorStoreFilesOpenAICursorPage extends OpenAICursorPage {} + /** * OpenAI Vector Store File object. */ @@ -196,36 +206,6 @@ export namespace VectorStoreFile { } } -/** - * Response from listing files in a vector store. - */ -export interface FileListResponse { - /** - * List of vector store file objects - */ - data: Array; - - /** - * Whether there are more files available beyond this page - */ - has_more: boolean; - - /** - * Object type identifier, always "list" - */ - object: string; - - /** - * (Optional) ID of the first file in the list for pagination - */ - first_id?: string; - - /** - * (Optional) ID of the last file in the list for pagination - */ - last_id?: string; -} - /** * Response from deleting a vector store file. */ @@ -358,13 +338,7 @@ export interface FileUpdateParams { attributes: { [key: string]: boolean | number | string | Array | unknown | null }; } -export interface FileListParams { - /** - * (Optional) A cursor for use in pagination. `after` is an object ID that defines - * your place in the list. - */ - after?: string; - +export interface FileListParams extends OpenAICursorPageParams { /** * (Optional) A cursor for use in pagination. `before` is an object ID that defines * your place in the list. @@ -376,12 +350,6 @@ export interface FileListParams { */ filter?: 'completed' | 'in_progress' | 'cancelled' | 'failed'; - /** - * (Optional) A limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the default is 20. - */ - limit?: number; - /** * (Optional) Sort order by the `created_at` timestamp of the objects. `asc` for * ascending order and `desc` for descending order. @@ -389,12 +357,14 @@ export interface FileListParams { order?: string; } +Files.VectorStoreFilesOpenAICursorPage = VectorStoreFilesOpenAICursorPage; + export declare namespace Files { export { type VectorStoreFile as VectorStoreFile, - type FileListResponse as FileListResponse, type FileDeleteResponse as FileDeleteResponse, type FileContentResponse as FileContentResponse, + VectorStoreFilesOpenAICursorPage as VectorStoreFilesOpenAICursorPage, type FileCreateParams as FileCreateParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, diff --git a/src/resources/vector-stores/index.ts b/src/resources/vector-stores/index.ts index d4d883a..4b35bbb 100644 --- a/src/resources/vector-stores/index.ts +++ b/src/resources/vector-stores/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { + VectorStoreFilesOpenAICursorPage, Files, type VectorStoreFile, - type FileListResponse, type FileDeleteResponse, type FileContentResponse, type FileCreateParams, @@ -11,6 +11,7 @@ export { type FileListParams, } from './files'; export { + VectorStoresOpenAICursorPage, VectorStores, type ListVectorStoresResponse, type VectorStore, diff --git a/src/resources/vector-stores/vector-stores.ts b/src/resources/vector-stores/vector-stores.ts index 90c672d..e8994e2 100644 --- a/src/resources/vector-stores/vector-stores.ts +++ b/src/resources/vector-stores/vector-stores.ts @@ -9,11 +9,12 @@ import { FileCreateParams, FileDeleteResponse, FileListParams, - FileListResponse, FileUpdateParams, Files, VectorStoreFile, + VectorStoreFilesOpenAICursorPage, } from './files'; +import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination'; export class VectorStores extends APIResource { files: FilesAPI.Files = new FilesAPI.Files(this._client); @@ -49,16 +50,19 @@ export class VectorStores extends APIResource { list( query?: VectorStoreListParams, options?: Core.RequestOptions, - ): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( query: VectorStoreListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } - return this._client.get('/v1/openai/v1/vector_stores', { query, ...options }); + return this._client.getAPIList('/v1/openai/v1/vector_stores', VectorStoresOpenAICursorPage, { + query, + ...options, + }); } /** @@ -81,6 +85,8 @@ export class VectorStores extends APIResource { } } +export class VectorStoresOpenAICursorPage extends OpenAICursorPage {} + /** * Response from listing vector stores. */ @@ -363,25 +369,13 @@ export interface VectorStoreUpdateParams { name?: string; } -export interface VectorStoreListParams { - /** - * A cursor for use in pagination. `after` is an object ID that defines your place - * in the list. - */ - after?: string; - +export interface VectorStoreListParams extends OpenAICursorPageParams { /** * A cursor for use in pagination. `before` is an object ID that defines your place * in the list. */ before?: string; - /** - * A limit on the number of objects to be returned. Limit can range between 1 and - * 100, and the default is 20. - */ - limit?: number; - /** * Sort order by the `created_at` timestamp of the objects. `asc` for ascending * order and `desc` for descending order. @@ -438,7 +432,9 @@ export namespace VectorStoreSearchParams { } } +VectorStores.VectorStoresOpenAICursorPage = VectorStoresOpenAICursorPage; VectorStores.Files = Files; +VectorStores.VectorStoreFilesOpenAICursorPage = VectorStoreFilesOpenAICursorPage; export declare namespace VectorStores { export { @@ -446,6 +442,7 @@ export declare namespace VectorStores { type VectorStore as VectorStore, type VectorStoreDeleteResponse as VectorStoreDeleteResponse, type VectorStoreSearchResponse as VectorStoreSearchResponse, + VectorStoresOpenAICursorPage as VectorStoresOpenAICursorPage, type VectorStoreCreateParams as VectorStoreCreateParams, type VectorStoreUpdateParams as VectorStoreUpdateParams, type VectorStoreListParams as VectorStoreListParams, @@ -455,9 +452,9 @@ export declare namespace VectorStores { export { Files as Files, type VectorStoreFile as VectorStoreFile, - type FileListResponse as FileListResponse, type FileDeleteResponse as FileDeleteResponse, type FileContentResponse as FileContentResponse, + VectorStoreFilesOpenAICursorPage as VectorStoreFilesOpenAICursorPage, type FileCreateParams as FileCreateParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, diff --git a/src/version.ts b/src/version.ts index 56f21fb..b0ac2bf 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.2.18'; // x-release-please-version +export const VERSION = '0.2.19-alpha.1'; // x-release-please-version diff --git a/tests/api-resources/responses/responses.test.ts b/tests/api-resources/responses/responses.test.ts index 79575ae..3f14892 100644 --- a/tests/api-resources/responses/responses.test.ts +++ b/tests/api-resources/responses/responses.test.ts @@ -21,6 +21,7 @@ describe('resource responses', () => { const response = await client.responses.create({ input: 'string', model: 'model', + include: ['string'], instructions: 'instructions', max_infer_iters: 0, previous_response_id: 'previous_response_id', diff --git a/tests/api-resources/telemetry.test.ts b/tests/api-resources/telemetry.test.ts index 0c2b8e0..e042d08 100644 --- a/tests/api-resources/telemetry.test.ts +++ b/tests/api-resources/telemetry.test.ts @@ -89,6 +89,32 @@ describe('resource telemetry', () => { }); }); + // unsupported query params in java / kotlin + test.skip('queryMetrics: only required params', async () => { + const responsePromise = client.telemetry.queryMetrics('metric_name', { + query_type: 'range', + start_time: 0, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // unsupported query params in java / kotlin + test.skip('queryMetrics: required and optional params', async () => { + const response = await client.telemetry.queryMetrics('metric_name', { + query_type: 'range', + start_time: 0, + end_time: 0, + granularity: 'granularity', + label_matchers: [{ name: 'name', operator: '=', value: 'value' }], + }); + }); + // unsupported query params in java / kotlin test.skip('querySpans: only required params', async () => { const responsePromise = client.telemetry.querySpans({ diff --git a/yarn.lock b/yarn.lock index bb17942..2bcc59e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -852,19 +852,19 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.13" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.13.tgz#e0c9b7b5edbdb1b50ce32c127e85e880872d56ee" + integrity sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.4" "@types/node@*": - version "20.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" - integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== + version "24.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.3.0.tgz#89b09f45cb9a8ee69466f18ee5864e4c3eb84dec" + integrity sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow== dependencies: - undici-types "~5.26.4" + undici-types "~7.10.0" "@types/node@^18.11.18": version "18.11.18" @@ -1097,7 +1097,7 @@ array-union@^2.1.0: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== babel-jest@^29.7.0: version "29.7.0" @@ -1234,6 +1234,14 @@ bundle-name@^3.0.0: dependencies: run-applescript "^5.0.0" +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1433,7 +1441,7 @@ define-lazy-prop@^3.0.0: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== depd@^1.1.2: version "1.1.2" @@ -1469,6 +1477,15 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + electron-to-chromium@^1.4.601: version "1.4.614" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz#2fe789d61fa09cb875569f37c309d0c2701f91c0" @@ -1491,6 +1508,33 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1780,13 +1824,15 @@ form-data-encoder@1.7.2: resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" formdata-node@^4.3.2: @@ -1822,11 +1868,35 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stdin@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" @@ -1887,6 +1957,11 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -1907,6 +1982,18 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + hasown@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" @@ -1914,6 +2001,13 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -2611,6 +2705,11 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -2629,17 +2728,17 @@ micromatch@^4.0.4: braces "^3.0.3" picomatch "^2.3.1" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2691,9 +2790,9 @@ node-domexception@1.0.0: integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^2.6.7: - version "2.6.11" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" - integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -3230,7 +3329,7 @@ to-regex-range@^5.0.1: tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-api-utils@^1.0.1: version "1.3.0" @@ -3332,10 +3431,10 @@ typescript@^4.8.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== untildify@^4.0.0: version "4.0.0" @@ -3391,12 +3490,12 @@ web-streams-polyfill@4.0.0-beta.1: webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0"