From 8890e6d9c18d9e17d9de51832eee911b2af50f6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 03:51:55 +0000 Subject: [PATCH 01/24] chore: rebuild project due to codegen change (#6) --- .gitignore | 2 +- package.json | 2 +- scripts/build | 2 +- src/core.ts | 10 +- src/error.ts | 2 +- src/index.ts | 297 ++++++++++++------ src/resources/assistants.ts | 15 +- src/resources/audio/audio.ts | 28 +- src/resources/audio/index.ts | 10 +- src/resources/audio/transcriptions.ts | 9 +- src/resources/audio/translations.ts | 9 +- src/resources/batches.ts | 13 +- src/resources/chat.ts | 9 +- src/resources/completions.ts | 9 +- src/resources/embeddings.ts | 9 +- src/resources/files/content.ts | 5 +- src/resources/files/files.ts | 22 +- src/resources/files/index.ts | 12 +- src/resources/fine-tuning/fine-tuning.ts | 17 +- src/resources/fine-tuning/index.ts | 8 +- src/resources/fine-tuning/jobs/checkpoints.ts | 9 +- src/resources/fine-tuning/jobs/events.ts | 6 +- src/resources/fine-tuning/jobs/index.ts | 12 +- src/resources/fine-tuning/jobs/jobs.ts | 36 ++- src/resources/images/edits.ts | 5 +- src/resources/images/generations.ts | 5 +- src/resources/images/images.ts | 20 +- src/resources/images/index.ts | 6 +- src/resources/images/variations.ts | 5 +- src/resources/index.ts | 83 ++--- src/resources/invites.ts | 11 +- src/resources/models.ts | 11 +- src/resources/moderations.ts | 9 +- src/resources/organization/audit-logs.ts | 6 +- src/resources/organization/index.ts | 4 +- src/resources/organization/invites.ts | 6 +- src/resources/organization/organization.ts | 24 +- src/resources/projects/api-keys.ts | 13 +- src/resources/projects/index.ts | 38 ++- src/resources/projects/projects.ts | 86 +++-- src/resources/projects/service-accounts.ts | 17 +- src/resources/projects/users.ts | 15 +- src/resources/threads/index.ts | 28 +- src/resources/threads/messages.ts | 15 +- src/resources/threads/runs/index.ts | 18 +- src/resources/threads/runs/runs.ts | 31 +- src/resources/threads/runs/steps.ts | 13 +- src/resources/threads/threads.ts | 150 +++------ src/resources/uploads/index.ts | 4 +- src/resources/uploads/parts.ts | 6 +- src/resources/uploads/uploads.ts | 19 +- src/resources/users.ts | 15 +- .../file-batches/file-batches.ts | 17 +- .../vector-stores/file-batches/files.ts | 6 +- .../vector-stores/file-batches/index.ts | 4 +- src/resources/vector-stores/files.ts | 15 +- src/resources/vector-stores/index.ts | 26 +- src/resources/vector-stores/vector-stores.ts | 51 ++- tsconfig.deno.json | 11 +- tsconfig.json | 3 +- yarn.lock | 180 +++++------ 61 files changed, 876 insertions(+), 653 deletions(-) diff --git a/.gitignore b/.gitignore index 3eed6dd..d98d51a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ yarn-error.log codegen.log Brewfile.lock.json dist -/deno +dist-deno /*.tgz .idea/ diff --git a/package.json b/package.json index b9bae7e..58f1a95 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ - "*" + "**/*" ], "private": false, "scripts": { diff --git a/scripts/build b/scripts/build index 5723ed7..ac5f898 100755 --- a/scripts/build +++ b/scripts/build @@ -50,7 +50,7 @@ node scripts/utils/postprocess-files.cjs (cd dist && node -e 'require("argot-stainless-openai")') (cd dist && node -e 'import("argot-stainless-openai")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] +if [ -e ./scripts/build-deno ] then ./scripts/build-deno fi diff --git a/src/core.ts b/src/core.ts index fbff193..6b7a5c8 100644 --- a/src/core.ts +++ b/src/core.ts @@ -396,7 +396,7 @@ export abstract class APIClient { error: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { return APIError.generate(status, error, message, headers); } @@ -668,9 +668,9 @@ export abstract class AbstractPage implements AsyncIterable { return await this.#client.requestAPIList(this.constructor as any, nextOptions); } - async *iterPages() { + async *iterPages(): AsyncGenerator { // eslint-disable-next-line @typescript-eslint/no-this-alias - let page: AbstractPage = this; + let page: this = this; yield page; while (page.hasNextPage()) { page = await page.getNextPage(); @@ -678,7 +678,7 @@ export abstract class AbstractPage implements AsyncIterable { } } - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { for await (const page of this.iterPages()) { for (const item of page.getPaginatedItems()) { yield item; @@ -721,7 +721,7 @@ export class PagePromise< * console.log(item) * } */ - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { const page = await this; for await (const item of page) { yield item; diff --git a/src/error.ts b/src/error.ts index 5100c22..0e2c096 100644 --- a/src/error.ts +++ b/src/error.ts @@ -47,7 +47,7 @@ export class APIError extends ArgotOpenAIError { errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { if (!status) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } diff --git a/src/index.ts b/src/index.ts index 64ee5ea..46f2c4b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,74 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Errors from './error'; -import * as Uploads from './uploads'; import { type Agent } from './_shims/index'; import * as qs from './internal/qs'; import * as Core from './core'; +import * as Errors from './error'; +import * as Uploads from './uploads'; import * as API from './resources/index'; +import { + AssistantCreateParams, + AssistantDeleteResponse, + AssistantListParams, + AssistantListResponse, + AssistantObject, + Assistants, +} from './resources/assistants'; +import { Batch, BatchCreateParams, BatchListParams, BatchListResponse, Batches } from './resources/batches'; +import { Chat, ChatCompletionsParams, ChatCompletionsResponse } from './resources/chat'; +import { CompletionCreateParams, CompletionCreateResponse, Completions } from './resources/completions'; +import { EmbeddingCreateParams, EmbeddingCreateResponse, Embeddings } from './resources/embeddings'; +import { Invite, InviteCreateParams, InviteDeleteResponse, Invites } from './resources/invites'; +import { Model, ModelDeleteResponse, ModelListResponse, Models } from './resources/models'; +import { ModerationCreateParams, ModerationCreateResponse, Moderations } from './resources/moderations'; +import { + User, + UserCreateParams, + UserDeleteResponse, + UserListParams, + UserListResponse, + Users, +} from './resources/users'; +import { Audio, AudioSpeechParams } from './resources/audio/audio'; +import { + FileCreateParams, + FileDeleteResponse, + FileListParams, + FileListResponse, + Files, + OpenAIFile, +} from './resources/files/files'; +import { FineTuning } from './resources/fine-tuning/fine-tuning'; +import { Images } from './resources/images/images'; +import { Organization } from './resources/organization/organization'; +import { + Project, + ProjectCreateParams, + ProjectListParams, + ProjectListResponse, + Projects, +} from './resources/projects/projects'; +import { + ThreadCreateParams, + ThreadDeleteResponse, + ThreadObject, + ThreadUpdateParams, + Threads, +} from './resources/threads/threads'; +import { + Upload, + UploadCompleteParams, + UploadCreateParams, + Uploads as UploadsAPIUploads, +} from './resources/uploads/uploads'; +import { + VectorStoreCreateParams, + VectorStoreDeleteResponse, + VectorStoreListParams, + VectorStoreListResponse, + VectorStoreObject, + VectorStores, +} from './resources/vector-stores/vector-stores'; export interface ClientOptions { /** @@ -179,7 +242,7 @@ export class ArgotOpenAI extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export const { +export { ArgotOpenAIError, APIError, APIConnectionError, @@ -193,101 +256,147 @@ export const { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} = Errors; +} from './error'; export import toFile = Uploads.toFile; export import fileFromPath = Uploads.fileFromPath; -export namespace ArgotOpenAI { - export import RequestOptions = Core.RequestOptions; - - export import Chat = API.Chat; - export import ChatCompletionsResponse = API.ChatCompletionsResponse; - export import ChatCompletionsParams = API.ChatCompletionsParams; - - export import Completions = API.Completions; - export import CompletionCreateResponse = API.CompletionCreateResponse; - export import CompletionCreateParams = API.CompletionCreateParams; - - export import Images = API.Images; - - export import Embeddings = API.Embeddings; - export import EmbeddingCreateResponse = API.EmbeddingCreateResponse; - export import EmbeddingCreateParams = API.EmbeddingCreateParams; - - export import Audio = API.Audio; - export import AudioSpeechParams = API.AudioSpeechParams; - - export import Files = API.Files; - export import OpenAIFile = API.OpenAIFile; - export import FileListResponse = API.FileListResponse; - export import FileDeleteResponse = API.FileDeleteResponse; - export import FileCreateParams = API.FileCreateParams; - export import FileListParams = API.FileListParams; - - export import Uploads = API.Uploads; - export import Upload = API.Upload; - export import UploadCreateParams = API.UploadCreateParams; - export import UploadCompleteParams = API.UploadCompleteParams; - - export import FineTuning = API.FineTuning; - - export import Models = API.Models; - export import Model = API.Model; - export import ModelListResponse = API.ModelListResponse; - export import ModelDeleteResponse = API.ModelDeleteResponse; - - export import Moderations = API.Moderations; - export import ModerationCreateResponse = API.ModerationCreateResponse; - export import ModerationCreateParams = API.ModerationCreateParams; - - export import Assistants = API.Assistants; - export import AssistantObject = API.AssistantObject; - export import AssistantListResponse = API.AssistantListResponse; - export import AssistantDeleteResponse = API.AssistantDeleteResponse; - export import AssistantCreateParams = API.AssistantCreateParams; - export import AssistantListParams = API.AssistantListParams; - - export import Threads = API.Threads; - export import ThreadObject = API.ThreadObject; - export import ThreadDeleteResponse = API.ThreadDeleteResponse; - export import ThreadCreateParams = API.ThreadCreateParams; - export import ThreadUpdateParams = API.ThreadUpdateParams; - - export import VectorStores = API.VectorStores; - export import VectorStoreObject = API.VectorStoreObject; - export import VectorStoreListResponse = API.VectorStoreListResponse; - export import VectorStoreDeleteResponse = API.VectorStoreDeleteResponse; - export import VectorStoreCreateParams = API.VectorStoreCreateParams; - export import VectorStoreListParams = API.VectorStoreListParams; - - export import Batches = API.Batches; - export import Batch = API.Batch; - export import BatchListResponse = API.BatchListResponse; - export import BatchCreateParams = API.BatchCreateParams; - export import BatchListParams = API.BatchListParams; - - export import Organization = API.Organization; - - export import Invites = API.Invites; - export import Invite = API.Invite; - export import InviteDeleteResponse = API.InviteDeleteResponse; - export import InviteCreateParams = API.InviteCreateParams; - - export import Users = API.Users; - export import User = API.User; - export import UserListResponse = API.UserListResponse; - export import UserDeleteResponse = API.UserDeleteResponse; - export import UserCreateParams = API.UserCreateParams; - export import UserListParams = API.UserListParams; - - export import Projects = API.Projects; - export import Project = API.Project; - export import ProjectListResponse = API.ProjectListResponse; - export import ProjectCreateParams = API.ProjectCreateParams; - export import ProjectListParams = API.ProjectListParams; - - export import ImagesResponse = API.ImagesResponse; +ArgotOpenAI.Chat = Chat; +ArgotOpenAI.Completions = Completions; +ArgotOpenAI.Images = Images; +ArgotOpenAI.Embeddings = Embeddings; +ArgotOpenAI.Audio = Audio; +ArgotOpenAI.Files = Files; +ArgotOpenAI.Uploads = UploadsAPIUploads; +ArgotOpenAI.FineTuning = FineTuning; +ArgotOpenAI.Models = Models; +ArgotOpenAI.Moderations = Moderations; +ArgotOpenAI.Assistants = Assistants; +ArgotOpenAI.Threads = Threads; +ArgotOpenAI.VectorStores = VectorStores; +ArgotOpenAI.Batches = Batches; +ArgotOpenAI.Organization = Organization; +ArgotOpenAI.Invites = Invites; +ArgotOpenAI.Users = Users; +ArgotOpenAI.Projects = Projects; + +export declare namespace ArgotOpenAI { + export type RequestOptions = Core.RequestOptions; + + export { + Chat as Chat, + type ChatCompletionsResponse as ChatCompletionsResponse, + type ChatCompletionsParams as ChatCompletionsParams, + }; + + export { + Completions as Completions, + type CompletionCreateResponse as CompletionCreateResponse, + type CompletionCreateParams as CompletionCreateParams, + }; + + export { Images as Images }; + + export { + Embeddings as Embeddings, + type EmbeddingCreateResponse as EmbeddingCreateResponse, + type EmbeddingCreateParams as EmbeddingCreateParams, + }; + + export { Audio as Audio, type AudioSpeechParams as AudioSpeechParams }; + + export { + Files as Files, + type OpenAIFile as OpenAIFile, + type FileListResponse as FileListResponse, + type FileDeleteResponse as FileDeleteResponse, + type FileCreateParams as FileCreateParams, + type FileListParams as FileListParams, + }; + + export { + UploadsAPIUploads as Uploads, + type Upload as Upload, + type UploadCreateParams as UploadCreateParams, + type UploadCompleteParams as UploadCompleteParams, + }; + + export { FineTuning as FineTuning }; + + export { + Models as Models, + type Model as Model, + type ModelListResponse as ModelListResponse, + type ModelDeleteResponse as ModelDeleteResponse, + }; + + export { + Moderations as Moderations, + type ModerationCreateResponse as ModerationCreateResponse, + type ModerationCreateParams as ModerationCreateParams, + }; + + export { + Assistants as Assistants, + type AssistantObject as AssistantObject, + type AssistantListResponse as AssistantListResponse, + type AssistantDeleteResponse as AssistantDeleteResponse, + type AssistantCreateParams as AssistantCreateParams, + type AssistantListParams as AssistantListParams, + }; + + export { + Threads as Threads, + type ThreadObject as ThreadObject, + type ThreadDeleteResponse as ThreadDeleteResponse, + type ThreadCreateParams as ThreadCreateParams, + type ThreadUpdateParams as ThreadUpdateParams, + }; + + export { + VectorStores as VectorStores, + type VectorStoreObject as VectorStoreObject, + type VectorStoreListResponse as VectorStoreListResponse, + type VectorStoreDeleteResponse as VectorStoreDeleteResponse, + type VectorStoreCreateParams as VectorStoreCreateParams, + type VectorStoreListParams as VectorStoreListParams, + }; + + export { + Batches as Batches, + type Batch as Batch, + type BatchListResponse as BatchListResponse, + type BatchCreateParams as BatchCreateParams, + type BatchListParams as BatchListParams, + }; + + export { Organization as Organization }; + + export { + Invites as Invites, + type Invite as Invite, + type InviteDeleteResponse as InviteDeleteResponse, + type InviteCreateParams as InviteCreateParams, + }; + + export { + Users as Users, + type User as User, + type UserListResponse as UserListResponse, + type UserDeleteResponse as UserDeleteResponse, + type UserCreateParams as UserCreateParams, + type UserListParams as UserListParams, + }; + + export { + Projects as Projects, + type Project as Project, + type ProjectListResponse as ProjectListResponse, + type ProjectCreateParams as ProjectCreateParams, + type ProjectListParams as ProjectListParams, + }; + + export type ImagesResponse = API.ImagesResponse; } export default ArgotOpenAI; diff --git a/src/resources/assistants.ts b/src/resources/assistants.ts index ea3f383..00bbb44 100644 --- a/src/resources/assistants.ts +++ b/src/resources/assistants.ts @@ -3,7 +3,6 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; -import * as AssistantsAPI from './assistants'; export class Assistants extends APIResource { /** @@ -715,10 +714,12 @@ export interface AssistantListParams { order?: 'asc' | 'desc'; } -export namespace Assistants { - export import AssistantObject = AssistantsAPI.AssistantObject; - export import AssistantListResponse = AssistantsAPI.AssistantListResponse; - export import AssistantDeleteResponse = AssistantsAPI.AssistantDeleteResponse; - export import AssistantCreateParams = AssistantsAPI.AssistantCreateParams; - export import AssistantListParams = AssistantsAPI.AssistantListParams; +export declare namespace Assistants { + export { + type AssistantObject as AssistantObject, + type AssistantListResponse as AssistantListResponse, + type AssistantDeleteResponse as AssistantDeleteResponse, + type AssistantCreateParams as AssistantCreateParams, + type AssistantListParams as AssistantListParams, + }; } diff --git a/src/resources/audio/audio.ts b/src/resources/audio/audio.ts index 647efd1..c07ff7e 100644 --- a/src/resources/audio/audio.ts +++ b/src/resources/audio/audio.ts @@ -2,9 +2,10 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as AudioAPI from './audio'; import * as TranscriptionsAPI from './transcriptions'; +import { TranscriptionCreateParams, TranscriptionCreateResponse, Transcriptions } from './transcriptions'; import * as TranslationsAPI from './translations'; +import { TranslationCreateParams, TranslationCreateResponse, Translations } from './translations'; import { type Response } from '../../_shims/index'; export class Audio extends APIResource { @@ -51,12 +52,21 @@ export interface AudioSpeechParams { speed?: number; } -export namespace Audio { - export import AudioSpeechParams = AudioAPI.AudioSpeechParams; - export import Transcriptions = TranscriptionsAPI.Transcriptions; - export import TranscriptionCreateResponse = TranscriptionsAPI.TranscriptionCreateResponse; - export import TranscriptionCreateParams = TranscriptionsAPI.TranscriptionCreateParams; - export import Translations = TranslationsAPI.Translations; - export import TranslationCreateResponse = TranslationsAPI.TranslationCreateResponse; - export import TranslationCreateParams = TranslationsAPI.TranslationCreateParams; +Audio.Transcriptions = Transcriptions; +Audio.Translations = Translations; + +export declare namespace Audio { + export { type AudioSpeechParams as AudioSpeechParams }; + + export { + Transcriptions as Transcriptions, + type TranscriptionCreateResponse as TranscriptionCreateResponse, + type TranscriptionCreateParams as TranscriptionCreateParams, + }; + + export { + Translations as Translations, + type TranslationCreateResponse as TranslationCreateResponse, + type TranslationCreateParams as TranslationCreateParams, + }; } diff --git a/src/resources/audio/index.ts b/src/resources/audio/index.ts index 430b5e7..531c114 100644 --- a/src/resources/audio/index.ts +++ b/src/resources/audio/index.ts @@ -1,5 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { AudioSpeechParams, Audio } from './audio'; -export { TranscriptionCreateResponse, TranscriptionCreateParams, Transcriptions } from './transcriptions'; -export { TranslationCreateResponse, TranslationCreateParams, Translations } from './translations'; +export { Audio, type AudioSpeechParams } from './audio'; +export { + Transcriptions, + type TranscriptionCreateResponse, + type TranscriptionCreateParams, +} from './transcriptions'; +export { Translations, type TranslationCreateResponse, type TranslationCreateParams } from './translations'; diff --git a/src/resources/audio/transcriptions.ts b/src/resources/audio/transcriptions.ts index 601dc45..8f04e46 100644 --- a/src/resources/audio/transcriptions.ts +++ b/src/resources/audio/transcriptions.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TranscriptionsAPI from './transcriptions'; export class Transcriptions extends APIResource { /** @@ -194,7 +193,9 @@ export interface TranscriptionCreateParams { timestamp_granularities?: Array<'word' | 'segment'>; } -export namespace Transcriptions { - export import TranscriptionCreateResponse = TranscriptionsAPI.TranscriptionCreateResponse; - export import TranscriptionCreateParams = TranscriptionsAPI.TranscriptionCreateParams; +export declare namespace Transcriptions { + export { + type TranscriptionCreateResponse as TranscriptionCreateResponse, + type TranscriptionCreateParams as TranscriptionCreateParams, + }; } diff --git a/src/resources/audio/translations.ts b/src/resources/audio/translations.ts index 50ce2d5..299c5b8 100644 --- a/src/resources/audio/translations.ts +++ b/src/resources/audio/translations.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as TranslationsAPI from './translations'; export class Translations extends APIResource { /** @@ -141,7 +140,9 @@ export interface TranslationCreateParams { temperature?: number; } -export namespace Translations { - export import TranslationCreateResponse = TranslationsAPI.TranslationCreateResponse; - export import TranslationCreateParams = TranslationsAPI.TranslationCreateParams; +export declare namespace Translations { + export { + type TranslationCreateResponse as TranslationCreateResponse, + type TranslationCreateParams as TranslationCreateParams, + }; } diff --git a/src/resources/batches.ts b/src/resources/batches.ts index c48bf38..9797059 100644 --- a/src/resources/batches.ts +++ b/src/resources/batches.ts @@ -3,7 +3,6 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; -import * as BatchesAPI from './batches'; export class Batches extends APIResource { /** @@ -268,9 +267,11 @@ export interface BatchListParams { limit?: number; } -export namespace Batches { - export import Batch = BatchesAPI.Batch; - export import BatchListResponse = BatchesAPI.BatchListResponse; - export import BatchCreateParams = BatchesAPI.BatchCreateParams; - export import BatchListParams = BatchesAPI.BatchListParams; +export declare namespace Batches { + export { + type Batch as Batch, + type BatchListResponse as BatchListResponse, + type BatchCreateParams as BatchCreateParams, + type BatchListParams as BatchListParams, + }; } diff --git a/src/resources/chat.ts b/src/resources/chat.ts index a7be117..5bb53a1 100644 --- a/src/resources/chat.ts +++ b/src/resources/chat.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as ChatAPI from './chat'; export class Chat extends APIResource { /** @@ -1049,7 +1048,9 @@ export namespace ChatCompletionsParams { } } -export namespace Chat { - export import ChatCompletionsResponse = ChatAPI.ChatCompletionsResponse; - export import ChatCompletionsParams = ChatAPI.ChatCompletionsParams; +export declare namespace Chat { + export { + type ChatCompletionsResponse as ChatCompletionsResponse, + type ChatCompletionsParams as ChatCompletionsParams, + }; } diff --git a/src/resources/completions.ts b/src/resources/completions.ts index a586aaa..e34c77e 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as CompletionsAPI from './completions'; export class Completions extends APIResource { /** @@ -306,7 +305,9 @@ export namespace CompletionCreateParams { } } -export namespace Completions { - export import CompletionCreateResponse = CompletionsAPI.CompletionCreateResponse; - export import CompletionCreateParams = CompletionsAPI.CompletionCreateParams; +export declare namespace Completions { + export { + type CompletionCreateResponse as CompletionCreateResponse, + type CompletionCreateParams as CompletionCreateParams, + }; } diff --git a/src/resources/embeddings.ts b/src/resources/embeddings.ts index bd50a17..6bab634 100644 --- a/src/resources/embeddings.ts +++ b/src/resources/embeddings.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as EmbeddingsAPI from './embeddings'; export class Embeddings extends APIResource { /** @@ -115,7 +114,9 @@ export interface EmbeddingCreateParams { user?: string; } -export namespace Embeddings { - export import EmbeddingCreateResponse = EmbeddingsAPI.EmbeddingCreateResponse; - export import EmbeddingCreateParams = EmbeddingsAPI.EmbeddingCreateParams; +export declare namespace Embeddings { + export { + type EmbeddingCreateResponse as EmbeddingCreateResponse, + type EmbeddingCreateParams as EmbeddingCreateParams, + }; } diff --git a/src/resources/files/content.ts b/src/resources/files/content.ts index 27f0ab9..6993b46 100644 --- a/src/resources/files/content.ts +++ b/src/resources/files/content.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as ContentAPI from './content'; export class Content extends APIResource { /** @@ -18,6 +17,6 @@ export class Content extends APIResource { export type ContentRetrieveResponse = string; -export namespace Content { - export import ContentRetrieveResponse = ContentAPI.ContentRetrieveResponse; +export declare namespace Content { + export { type ContentRetrieveResponse as ContentRetrieveResponse }; } diff --git a/src/resources/files/files.ts b/src/resources/files/files.ts index 22b65ec..fc38bf8 100644 --- a/src/resources/files/files.ts +++ b/src/resources/files/files.ts @@ -3,8 +3,8 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as FilesAPI from './files'; import * as ContentAPI from './content'; +import { Content, ContentRetrieveResponse } from './content'; export class Files extends APIResource { content: ContentAPI.Content = new ContentAPI.Content(this._client); @@ -156,12 +156,16 @@ export interface FileListParams { purpose?: string; } -export namespace Files { - export import OpenAIFile = FilesAPI.OpenAIFile; - export import FileListResponse = FilesAPI.FileListResponse; - export import FileDeleteResponse = FilesAPI.FileDeleteResponse; - export import FileCreateParams = FilesAPI.FileCreateParams; - export import FileListParams = FilesAPI.FileListParams; - export import Content = ContentAPI.Content; - export import ContentRetrieveResponse = ContentAPI.ContentRetrieveResponse; +Files.Content = Content; + +export declare namespace Files { + export { + type OpenAIFile as OpenAIFile, + type FileListResponse as FileListResponse, + type FileDeleteResponse as FileDeleteResponse, + type FileCreateParams as FileCreateParams, + type FileListParams as FileListParams, + }; + + export { Content as Content, type ContentRetrieveResponse as ContentRetrieveResponse }; } diff --git a/src/resources/files/index.ts b/src/resources/files/index.ts index 538a28a..1b6f989 100644 --- a/src/resources/files/index.ts +++ b/src/resources/files/index.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { ContentRetrieveResponse, Content } from './content'; +export { Content, type ContentRetrieveResponse } from './content'; export { - OpenAIFile, - FileListResponse, - FileDeleteResponse, - FileCreateParams, - FileListParams, Files, + type OpenAIFile, + type FileListResponse, + type FileDeleteResponse, + type FileCreateParams, + type FileListParams, } from './files'; diff --git a/src/resources/fine-tuning/fine-tuning.ts b/src/resources/fine-tuning/fine-tuning.ts index d7f9b8f..6fb958d 100644 --- a/src/resources/fine-tuning/fine-tuning.ts +++ b/src/resources/fine-tuning/fine-tuning.ts @@ -2,15 +2,20 @@ import { APIResource } from '../../resource'; import * as JobsAPI from './jobs/jobs'; +import { FineTuningJob, JobCreateParams, JobListParams, JobListResponse, Jobs } from './jobs/jobs'; export class FineTuning extends APIResource { jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client); } -export namespace FineTuning { - export import Jobs = JobsAPI.Jobs; - export import FineTuningJob = JobsAPI.FineTuningJob; - export import JobListResponse = JobsAPI.JobListResponse; - export import JobCreateParams = JobsAPI.JobCreateParams; - export import JobListParams = JobsAPI.JobListParams; +FineTuning.Jobs = Jobs; + +export declare namespace FineTuning { + export { + Jobs as Jobs, + type FineTuningJob as FineTuningJob, + type JobListResponse as JobListResponse, + type JobCreateParams as JobCreateParams, + type JobListParams as JobListParams, + }; } diff --git a/src/resources/fine-tuning/index.ts b/src/resources/fine-tuning/index.ts index 347c6b1..69e2235 100644 --- a/src/resources/fine-tuning/index.ts +++ b/src/resources/fine-tuning/index.ts @@ -1,4 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { FineTuning } from './fine-tuning'; -export { FineTuningJob, JobListResponse, JobCreateParams, JobListParams, Jobs } from './jobs/index'; +export { + Jobs, + type FineTuningJob, + type JobListResponse, + type JobCreateParams, + type JobListParams, +} from './jobs/index'; diff --git a/src/resources/fine-tuning/jobs/checkpoints.ts b/src/resources/fine-tuning/jobs/checkpoints.ts index 57b1df0..47c534e 100644 --- a/src/resources/fine-tuning/jobs/checkpoints.ts +++ b/src/resources/fine-tuning/jobs/checkpoints.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as CheckpointsAPI from './checkpoints'; export class Checkpoints extends APIResource { /** @@ -115,7 +114,9 @@ export interface CheckpointListParams { limit?: number; } -export namespace Checkpoints { - export import CheckpointListResponse = CheckpointsAPI.CheckpointListResponse; - export import CheckpointListParams = CheckpointsAPI.CheckpointListParams; +export declare namespace Checkpoints { + export { + type CheckpointListResponse as CheckpointListResponse, + type CheckpointListParams as CheckpointListParams, + }; } diff --git a/src/resources/fine-tuning/jobs/events.ts b/src/resources/fine-tuning/jobs/events.ts index 1526d03..2270752 100644 --- a/src/resources/fine-tuning/jobs/events.ts +++ b/src/resources/fine-tuning/jobs/events.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as EventsAPI from './events'; export class Events extends APIResource { /** @@ -62,7 +61,6 @@ export interface EventListParams { limit?: number; } -export namespace Events { - export import EventListResponse = EventsAPI.EventListResponse; - export import EventListParams = EventsAPI.EventListParams; +export declare namespace Events { + export { type EventListResponse as EventListResponse, type EventListParams as EventListParams }; } diff --git a/src/resources/fine-tuning/jobs/index.ts b/src/resources/fine-tuning/jobs/index.ts index b2d659e..c0476bc 100644 --- a/src/resources/fine-tuning/jobs/index.ts +++ b/src/resources/fine-tuning/jobs/index.ts @@ -1,5 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { CheckpointListResponse, CheckpointListParams, Checkpoints } from './checkpoints'; -export { EventListResponse, EventListParams, Events } from './events'; -export { FineTuningJob, JobListResponse, JobCreateParams, JobListParams, Jobs } from './jobs'; +export { Checkpoints, type CheckpointListResponse, type CheckpointListParams } from './checkpoints'; +export { Events, type EventListResponse, type EventListParams } from './events'; +export { + Jobs, + type FineTuningJob, + type JobListResponse, + type JobCreateParams, + type JobListParams, +} from './jobs'; diff --git a/src/resources/fine-tuning/jobs/jobs.ts b/src/resources/fine-tuning/jobs/jobs.ts index 8b9c183..b10be8b 100644 --- a/src/resources/fine-tuning/jobs/jobs.ts +++ b/src/resources/fine-tuning/jobs/jobs.ts @@ -3,9 +3,10 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as JobsAPI from './jobs'; import * as CheckpointsAPI from './checkpoints'; +import { CheckpointListParams, CheckpointListResponse, Checkpoints } from './checkpoints'; import * as EventsAPI from './events'; +import { EventListParams, EventListResponse, Events } from './events'; export class Jobs extends APIResource { events: EventsAPI.Events = new EventsAPI.Events(this._client); @@ -406,15 +407,26 @@ export interface JobListParams { limit?: number; } -export namespace Jobs { - export import FineTuningJob = JobsAPI.FineTuningJob; - export import JobListResponse = JobsAPI.JobListResponse; - export import JobCreateParams = JobsAPI.JobCreateParams; - export import JobListParams = JobsAPI.JobListParams; - export import Events = EventsAPI.Events; - export import EventListResponse = EventsAPI.EventListResponse; - export import EventListParams = EventsAPI.EventListParams; - export import Checkpoints = CheckpointsAPI.Checkpoints; - export import CheckpointListResponse = CheckpointsAPI.CheckpointListResponse; - export import CheckpointListParams = CheckpointsAPI.CheckpointListParams; +Jobs.Events = Events; +Jobs.Checkpoints = Checkpoints; + +export declare namespace Jobs { + export { + type FineTuningJob as FineTuningJob, + type JobListResponse as JobListResponse, + type JobCreateParams as JobCreateParams, + type JobListParams as JobListParams, + }; + + export { + Events as Events, + type EventListResponse as EventListResponse, + type EventListParams as EventListParams, + }; + + export { + Checkpoints as Checkpoints, + type CheckpointListResponse as CheckpointListResponse, + type CheckpointListParams as CheckpointListParams, + }; } diff --git a/src/resources/images/edits.ts b/src/resources/images/edits.ts index 8f27195..9627fd3 100644 --- a/src/resources/images/edits.ts +++ b/src/resources/images/edits.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as EditsAPI from './edits'; import * as Shared from '../shared'; export class Edits extends APIResource { @@ -65,6 +64,6 @@ export interface EditCreateParams { user?: string; } -export namespace Edits { - export import EditCreateParams = EditsAPI.EditCreateParams; +export declare namespace Edits { + export { type EditCreateParams as EditCreateParams }; } diff --git a/src/resources/images/generations.ts b/src/resources/images/generations.ts index da9495e..f24a878 100644 --- a/src/resources/images/generations.ts +++ b/src/resources/images/generations.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as GenerationsAPI from './generations'; import * as Shared from '../shared'; export class Generations extends APIResource { @@ -71,6 +70,6 @@ export interface GenerationCreateParams { user?: string; } -export namespace Generations { - export import GenerationCreateParams = GenerationsAPI.GenerationCreateParams; +export declare namespace Generations { + export { type GenerationCreateParams as GenerationCreateParams }; } diff --git a/src/resources/images/images.ts b/src/resources/images/images.ts index 167039d..6f98ca6 100644 --- a/src/resources/images/images.ts +++ b/src/resources/images/images.ts @@ -2,8 +2,11 @@ import { APIResource } from '../../resource'; import * as EditsAPI from './edits'; +import { EditCreateParams, Edits } from './edits'; import * as GenerationsAPI from './generations'; +import { GenerationCreateParams, Generations } from './generations'; import * as VariationsAPI from './variations'; +import { VariationCreateParams, Variations } from './variations'; export class Images extends APIResource { generations: GenerationsAPI.Generations = new GenerationsAPI.Generations(this._client); @@ -11,11 +14,14 @@ export class Images extends APIResource { variations: VariationsAPI.Variations = new VariationsAPI.Variations(this._client); } -export namespace Images { - export import Generations = GenerationsAPI.Generations; - export import GenerationCreateParams = GenerationsAPI.GenerationCreateParams; - export import Edits = EditsAPI.Edits; - export import EditCreateParams = EditsAPI.EditCreateParams; - export import Variations = VariationsAPI.Variations; - export import VariationCreateParams = VariationsAPI.VariationCreateParams; +Images.Generations = Generations; +Images.Edits = Edits; +Images.Variations = Variations; + +export declare namespace Images { + export { Generations as Generations, type GenerationCreateParams as GenerationCreateParams }; + + export { Edits as Edits, type EditCreateParams as EditCreateParams }; + + export { Variations as Variations, type VariationCreateParams as VariationCreateParams }; } diff --git a/src/resources/images/index.ts b/src/resources/images/index.ts index 70735a0..c792261 100644 --- a/src/resources/images/index.ts +++ b/src/resources/images/index.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { EditCreateParams, Edits } from './edits'; -export { GenerationCreateParams, Generations } from './generations'; +export { Edits, type EditCreateParams } from './edits'; +export { Generations, type GenerationCreateParams } from './generations'; export { Images } from './images'; -export { VariationCreateParams, Variations } from './variations'; +export { Variations, type VariationCreateParams } from './variations'; diff --git a/src/resources/images/variations.ts b/src/resources/images/variations.ts index 3314d92..00dfd8b 100644 --- a/src/resources/images/variations.ts +++ b/src/resources/images/variations.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as VariationsAPI from './variations'; import * as Shared from '../shared'; export class Variations extends APIResource { @@ -53,6 +52,6 @@ export interface VariationCreateParams { user?: string; } -export namespace Variations { - export import VariationCreateParams = VariationsAPI.VariationCreateParams; +export declare namespace Variations { + export { type VariationCreateParams as VariationCreateParams }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index e82432f..66386cf 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -2,53 +2,66 @@ export * from './shared'; export { - AssistantObject, - AssistantListResponse, - AssistantDeleteResponse, - AssistantCreateParams, - AssistantListParams, Assistants, + type AssistantObject, + type AssistantListResponse, + type AssistantDeleteResponse, + type AssistantCreateParams, + type AssistantListParams, } from './assistants'; -export { AudioSpeechParams, Audio } from './audio/audio'; -export { Batch, BatchListResponse, BatchCreateParams, BatchListParams, Batches } from './batches'; -export { ChatCompletionsResponse, ChatCompletionsParams, Chat } from './chat'; -export { CompletionCreateResponse, CompletionCreateParams, Completions } from './completions'; -export { EmbeddingCreateResponse, EmbeddingCreateParams, Embeddings } from './embeddings'; -export { FineTuning } from './fine-tuning/fine-tuning'; -export { Images } from './images/images'; -export { Invite, InviteDeleteResponse, InviteCreateParams, Invites } from './invites'; -export { Model, ModelListResponse, ModelDeleteResponse, Models } from './models'; -export { ModerationCreateResponse, ModerationCreateParams, Moderations } from './moderations'; +export { Audio, type AudioSpeechParams } from './audio/audio'; +export { + Batches, + type Batch, + type BatchListResponse, + type BatchCreateParams, + type BatchListParams, +} from './batches'; +export { Chat, type ChatCompletionsResponse, type ChatCompletionsParams } from './chat'; +export { Completions, type CompletionCreateResponse, type CompletionCreateParams } from './completions'; +export { Embeddings, type EmbeddingCreateResponse, type EmbeddingCreateParams } from './embeddings'; export { - OpenAIFile, - FileListResponse, - FileDeleteResponse, - FileCreateParams, - FileListParams, Files, + type OpenAIFile, + type FileListResponse, + type FileDeleteResponse, + type FileCreateParams, + type FileListParams, } from './files/files'; +export { FineTuning } from './fine-tuning/fine-tuning'; +export { Images } from './images/images'; +export { Invites, type Invite, type InviteDeleteResponse, type InviteCreateParams } from './invites'; +export { Models, type Model, type ModelListResponse, type ModelDeleteResponse } from './models'; +export { Moderations, type ModerationCreateResponse, type ModerationCreateParams } from './moderations'; export { Organization } from './organization/organization'; export { - Project, - ProjectListResponse, - ProjectCreateParams, - ProjectListParams, Projects, + type Project, + type ProjectListResponse, + type ProjectCreateParams, + type ProjectListParams, } from './projects/projects'; export { - ThreadObject, - ThreadDeleteResponse, - ThreadCreateParams, - ThreadUpdateParams, Threads, + type ThreadObject, + type ThreadDeleteResponse, + type ThreadCreateParams, + type ThreadUpdateParams, } from './threads/threads'; -export { Upload, UploadCreateParams, UploadCompleteParams, Uploads } from './uploads/uploads'; -export { User, UserListResponse, UserDeleteResponse, UserCreateParams, UserListParams, Users } from './users'; +export { Uploads, type Upload, type UploadCreateParams, type UploadCompleteParams } from './uploads/uploads'; +export { + Users, + type User, + type UserListResponse, + type UserDeleteResponse, + type UserCreateParams, + type UserListParams, +} from './users'; export { - VectorStoreObject, - VectorStoreListResponse, - VectorStoreDeleteResponse, - VectorStoreCreateParams, - VectorStoreListParams, VectorStores, + type VectorStoreObject, + type VectorStoreListResponse, + type VectorStoreDeleteResponse, + type VectorStoreCreateParams, + type VectorStoreListParams, } from './vector-stores/vector-stores'; diff --git a/src/resources/invites.ts b/src/resources/invites.ts index 7d77c28..4fcd30d 100644 --- a/src/resources/invites.ts +++ b/src/resources/invites.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as InvitesAPI from './invites'; export class Invites extends APIResource { /** @@ -96,8 +95,10 @@ export interface InviteCreateParams { role: 'reader' | 'owner'; } -export namespace Invites { - export import Invite = InvitesAPI.Invite; - export import InviteDeleteResponse = InvitesAPI.InviteDeleteResponse; - export import InviteCreateParams = InvitesAPI.InviteCreateParams; +export declare namespace Invites { + export { + type Invite as Invite, + type InviteDeleteResponse as InviteDeleteResponse, + type InviteCreateParams as InviteCreateParams, + }; } diff --git a/src/resources/models.ts b/src/resources/models.ts index 4d7bfb0..6e85149 100644 --- a/src/resources/models.ts +++ b/src/resources/models.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as ModelsAPI from './models'; export class Models extends APIResource { /** @@ -69,8 +68,10 @@ export interface ModelDeleteResponse { object: string; } -export namespace Models { - export import Model = ModelsAPI.Model; - export import ModelListResponse = ModelsAPI.ModelListResponse; - export import ModelDeleteResponse = ModelsAPI.ModelDeleteResponse; +export declare namespace Models { + export { + type Model as Model, + type ModelListResponse as ModelListResponse, + type ModelDeleteResponse as ModelDeleteResponse, + }; } diff --git a/src/resources/moderations.ts b/src/resources/moderations.ts index 60ee43c..67bc815 100644 --- a/src/resources/moderations.ts +++ b/src/resources/moderations.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as ModerationsAPI from './moderations'; export class Moderations extends APIResource { /** @@ -357,7 +356,9 @@ export namespace ModerationCreateParams { } } -export namespace Moderations { - export import ModerationCreateResponse = ModerationsAPI.ModerationCreateResponse; - export import ModerationCreateParams = ModerationsAPI.ModerationCreateParams; +export declare namespace Moderations { + export { + type ModerationCreateResponse as ModerationCreateResponse, + type ModerationCreateParams as ModerationCreateParams, + }; } diff --git a/src/resources/organization/audit-logs.ts b/src/resources/organization/audit-logs.ts index 2ec0323..ae493e8 100644 --- a/src/resources/organization/audit-logs.ts +++ b/src/resources/organization/audit-logs.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as AuditLogsAPI from './audit-logs'; export class AuditLogs extends APIResource { /** @@ -808,7 +807,6 @@ export namespace AuditLogListParams { } } -export namespace AuditLogs { - export import AuditLogListResponse = AuditLogsAPI.AuditLogListResponse; - export import AuditLogListParams = AuditLogsAPI.AuditLogListParams; +export declare namespace AuditLogs { + export { type AuditLogListResponse as AuditLogListResponse, type AuditLogListParams as AuditLogListParams }; } diff --git a/src/resources/organization/index.ts b/src/resources/organization/index.ts index 5dfc28f..8ee38ec 100644 --- a/src/resources/organization/index.ts +++ b/src/resources/organization/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { AuditLogListResponse, AuditLogListParams, AuditLogs } from './audit-logs'; -export { InviteListResponse, InviteListParams, Invites } from './invites'; +export { AuditLogs, type AuditLogListResponse, type AuditLogListParams } from './audit-logs'; +export { Invites, type InviteListResponse, type InviteListParams } from './invites'; export { Organization } from './organization'; diff --git a/src/resources/organization/invites.ts b/src/resources/organization/invites.ts index eb445f5..150b581 100644 --- a/src/resources/organization/invites.ts +++ b/src/resources/organization/invites.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as OrganizationInvitesAPI from './invites'; import * as InvitesAPI from '../invites'; export class Invites extends APIResource { @@ -64,7 +63,6 @@ export interface InviteListParams { limit?: number; } -export namespace Invites { - export import InviteListResponse = OrganizationInvitesAPI.InviteListResponse; - export import InviteListParams = OrganizationInvitesAPI.InviteListParams; +export declare namespace Invites { + export { type InviteListResponse as InviteListResponse, type InviteListParams as InviteListParams }; } diff --git a/src/resources/organization/organization.ts b/src/resources/organization/organization.ts index 225a78d..77571fc 100644 --- a/src/resources/organization/organization.ts +++ b/src/resources/organization/organization.ts @@ -2,18 +2,28 @@ import { APIResource } from '../../resource'; import * as AuditLogsAPI from './audit-logs'; +import { AuditLogListParams, AuditLogListResponse, AuditLogs } from './audit-logs'; import * as InvitesAPI from './invites'; +import { InviteListParams, InviteListResponse, Invites } from './invites'; export class Organization extends APIResource { auditLogs: AuditLogsAPI.AuditLogs = new AuditLogsAPI.AuditLogs(this._client); invites: InvitesAPI.Invites = new InvitesAPI.Invites(this._client); } -export namespace Organization { - export import AuditLogs = AuditLogsAPI.AuditLogs; - export import AuditLogListResponse = AuditLogsAPI.AuditLogListResponse; - export import AuditLogListParams = AuditLogsAPI.AuditLogListParams; - export import Invites = InvitesAPI.Invites; - export import InviteListResponse = InvitesAPI.InviteListResponse; - export import InviteListParams = InvitesAPI.InviteListParams; +Organization.AuditLogs = AuditLogs; +Organization.Invites = Invites; + +export declare namespace Organization { + export { + AuditLogs as AuditLogs, + type AuditLogListResponse as AuditLogListResponse, + type AuditLogListParams as AuditLogListParams, + }; + + export { + Invites as Invites, + type InviteListResponse as InviteListResponse, + type InviteListParams as InviteListParams, + }; } diff --git a/src/resources/projects/api-keys.ts b/src/resources/projects/api-keys.ts index 68f6e86..25edb4d 100644 --- a/src/resources/projects/api-keys.ts +++ b/src/resources/projects/api-keys.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as APIKeysAPI from './api-keys'; import * as ServiceAccountsAPI from './service-accounts'; import * as UsersAPI from './users'; @@ -134,9 +133,11 @@ export interface APIKeyListParams { limit?: number; } -export namespace APIKeys { - export import ProjectAPIKey = APIKeysAPI.ProjectAPIKey; - export import APIKeyListResponse = APIKeysAPI.APIKeyListResponse; - export import APIKeyDeleteResponse = APIKeysAPI.APIKeyDeleteResponse; - export import APIKeyListParams = APIKeysAPI.APIKeyListParams; +export declare namespace APIKeys { + export { + type ProjectAPIKey as ProjectAPIKey, + type APIKeyListResponse as APIKeyListResponse, + type APIKeyDeleteResponse as APIKeyDeleteResponse, + type APIKeyListParams as APIKeyListParams, + }; } diff --git a/src/resources/projects/index.ts b/src/resources/projects/index.ts index 6f4826b..daad241 100644 --- a/src/resources/projects/index.ts +++ b/src/resources/projects/index.ts @@ -1,27 +1,33 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Project, ProjectListResponse, ProjectCreateParams, ProjectListParams, Projects } from './projects'; export { - ProjectAPIKey, - APIKeyListResponse, - APIKeyDeleteResponse, - APIKeyListParams, APIKeys, + type ProjectAPIKey, + type APIKeyListResponse, + type APIKeyDeleteResponse, + type APIKeyListParams, } from './api-keys'; export { - ProjectServiceAccount, - ServiceAccountCreateResponse, - ServiceAccountListResponse, - ServiceAccountDeleteResponse, - ServiceAccountCreateParams, - ServiceAccountListParams, + Projects, + type Project, + type ProjectListResponse, + type ProjectCreateParams, + type ProjectListParams, +} from './projects'; +export { ServiceAccounts, + type ProjectServiceAccount, + type ServiceAccountCreateResponse, + type ServiceAccountListResponse, + type ServiceAccountDeleteResponse, + type ServiceAccountCreateParams, + type ServiceAccountListParams, } from './service-accounts'; export { - ProjectUser, - UserListResponse, - UserDeleteResponse, - UserCreateParams, - UserListParams, Users, + type ProjectUser, + type UserListResponse, + type UserDeleteResponse, + type UserCreateParams, + type UserListParams, } from './users'; diff --git a/src/resources/projects/projects.ts b/src/resources/projects/projects.ts index 737e7aa..84aac65 100644 --- a/src/resources/projects/projects.ts +++ b/src/resources/projects/projects.ts @@ -3,10 +3,33 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as ProjectsAPI from './projects'; import * as APIKeysAPI from './api-keys'; +import { + APIKeyDeleteResponse, + APIKeyListParams, + APIKeyListResponse, + APIKeys, + ProjectAPIKey, +} from './api-keys'; import * as ServiceAccountsAPI from './service-accounts'; +import { + ProjectServiceAccount, + ServiceAccountCreateParams, + ServiceAccountCreateResponse, + ServiceAccountDeleteResponse, + ServiceAccountListParams, + ServiceAccountListResponse, + ServiceAccounts, +} from './service-accounts'; import * as UsersAPI from './users'; +import { + ProjectUser, + UserCreateParams, + UserDeleteResponse, + UserListParams, + UserListResponse, + Users, +} from './users'; export class Projects extends APIResource { users: UsersAPI.Users = new UsersAPI.Users(this._client); @@ -131,27 +154,42 @@ export interface ProjectListParams { limit?: number; } -export namespace Projects { - export import Project = ProjectsAPI.Project; - export import ProjectListResponse = ProjectsAPI.ProjectListResponse; - export import ProjectCreateParams = ProjectsAPI.ProjectCreateParams; - export import ProjectListParams = ProjectsAPI.ProjectListParams; - export import Users = UsersAPI.Users; - export import ProjectUser = UsersAPI.ProjectUser; - export import UserListResponse = UsersAPI.UserListResponse; - export import UserDeleteResponse = UsersAPI.UserDeleteResponse; - export import UserCreateParams = UsersAPI.UserCreateParams; - export import UserListParams = UsersAPI.UserListParams; - export import ServiceAccounts = ServiceAccountsAPI.ServiceAccounts; - export import ProjectServiceAccount = ServiceAccountsAPI.ProjectServiceAccount; - export import ServiceAccountCreateResponse = ServiceAccountsAPI.ServiceAccountCreateResponse; - export import ServiceAccountListResponse = ServiceAccountsAPI.ServiceAccountListResponse; - export import ServiceAccountDeleteResponse = ServiceAccountsAPI.ServiceAccountDeleteResponse; - export import ServiceAccountCreateParams = ServiceAccountsAPI.ServiceAccountCreateParams; - export import ServiceAccountListParams = ServiceAccountsAPI.ServiceAccountListParams; - export import APIKeys = APIKeysAPI.APIKeys; - export import ProjectAPIKey = APIKeysAPI.ProjectAPIKey; - export import APIKeyListResponse = APIKeysAPI.APIKeyListResponse; - export import APIKeyDeleteResponse = APIKeysAPI.APIKeyDeleteResponse; - export import APIKeyListParams = APIKeysAPI.APIKeyListParams; +Projects.Users = Users; +Projects.ServiceAccounts = ServiceAccounts; +Projects.APIKeys = APIKeys; + +export declare namespace Projects { + export { + type Project as Project, + type ProjectListResponse as ProjectListResponse, + type ProjectCreateParams as ProjectCreateParams, + type ProjectListParams as ProjectListParams, + }; + + export { + Users as Users, + type ProjectUser as ProjectUser, + type UserListResponse as UserListResponse, + type UserDeleteResponse as UserDeleteResponse, + type UserCreateParams as UserCreateParams, + type UserListParams as UserListParams, + }; + + export { + ServiceAccounts as ServiceAccounts, + type ProjectServiceAccount as ProjectServiceAccount, + type ServiceAccountCreateResponse as ServiceAccountCreateResponse, + type ServiceAccountListResponse as ServiceAccountListResponse, + type ServiceAccountDeleteResponse as ServiceAccountDeleteResponse, + type ServiceAccountCreateParams as ServiceAccountCreateParams, + type ServiceAccountListParams as ServiceAccountListParams, + }; + + export { + APIKeys as APIKeys, + type ProjectAPIKey as ProjectAPIKey, + type APIKeyListResponse as APIKeyListResponse, + type APIKeyDeleteResponse as APIKeyDeleteResponse, + type APIKeyListParams as APIKeyListParams, + }; } diff --git a/src/resources/projects/service-accounts.ts b/src/resources/projects/service-accounts.ts index 12bd249..8e4992b 100644 --- a/src/resources/projects/service-accounts.ts +++ b/src/resources/projects/service-accounts.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as ServiceAccountsAPI from './service-accounts'; export class ServiceAccounts extends APIResource { /** @@ -174,11 +173,13 @@ export interface ServiceAccountListParams { limit?: number; } -export namespace ServiceAccounts { - export import ProjectServiceAccount = ServiceAccountsAPI.ProjectServiceAccount; - export import ServiceAccountCreateResponse = ServiceAccountsAPI.ServiceAccountCreateResponse; - export import ServiceAccountListResponse = ServiceAccountsAPI.ServiceAccountListResponse; - export import ServiceAccountDeleteResponse = ServiceAccountsAPI.ServiceAccountDeleteResponse; - export import ServiceAccountCreateParams = ServiceAccountsAPI.ServiceAccountCreateParams; - export import ServiceAccountListParams = ServiceAccountsAPI.ServiceAccountListParams; +export declare namespace ServiceAccounts { + export { + type ProjectServiceAccount as ProjectServiceAccount, + type ServiceAccountCreateResponse as ServiceAccountCreateResponse, + type ServiceAccountListResponse as ServiceAccountListResponse, + type ServiceAccountDeleteResponse as ServiceAccountDeleteResponse, + type ServiceAccountCreateParams as ServiceAccountCreateParams, + type ServiceAccountListParams as ServiceAccountListParams, + }; } diff --git a/src/resources/projects/users.ts b/src/resources/projects/users.ts index ce39c31..8b7f1f6 100644 --- a/src/resources/projects/users.ts +++ b/src/resources/projects/users.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as UsersAPI from './users'; export class Users extends APIResource { /** @@ -135,10 +134,12 @@ export interface UserListParams { limit?: number; } -export namespace Users { - export import ProjectUser = UsersAPI.ProjectUser; - export import UserListResponse = UsersAPI.UserListResponse; - export import UserDeleteResponse = UsersAPI.UserDeleteResponse; - export import UserCreateParams = UsersAPI.UserCreateParams; - export import UserListParams = UsersAPI.UserListParams; +export declare namespace Users { + export { + type ProjectUser as ProjectUser, + type UserListResponse as UserListResponse, + type UserDeleteResponse as UserDeleteResponse, + type UserCreateParams as UserCreateParams, + type UserListParams as UserListParams, + }; } diff --git a/src/resources/threads/index.ts b/src/resources/threads/index.ts index 1c3ceeb..068bd00 100644 --- a/src/resources/threads/index.ts +++ b/src/resources/threads/index.ts @@ -1,25 +1,25 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - MessageObject, - MessageListResponse, - MessageDeleteResponse, - MessageCreateParams, - MessageListParams, Messages, + type MessageObject, + type MessageListResponse, + type MessageDeleteResponse, + type MessageCreateParams, + type MessageListParams, } from './messages'; export { - RunObject, - RunListResponse, - RunCreateParams, - RunListParams, - RunSubmitToolOutputsParams, Runs, + type RunObject, + type RunListResponse, + type RunCreateParams, + type RunListParams, + type RunSubmitToolOutputsParams, } from './runs/index'; export { - ThreadObject, - ThreadDeleteResponse, - ThreadCreateParams, - ThreadUpdateParams, Threads, + type ThreadObject, + type ThreadDeleteResponse, + type ThreadCreateParams, + type ThreadUpdateParams, } from './threads'; diff --git a/src/resources/threads/messages.ts b/src/resources/threads/messages.ts index 8b9222b..9a4e7eb 100644 --- a/src/resources/threads/messages.ts +++ b/src/resources/threads/messages.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as MessagesAPI from './messages'; export class Messages extends APIResource { /** @@ -414,10 +413,12 @@ export interface MessageListParams { run_id?: string; } -export namespace Messages { - export import MessageObject = MessagesAPI.MessageObject; - export import MessageListResponse = MessagesAPI.MessageListResponse; - export import MessageDeleteResponse = MessagesAPI.MessageDeleteResponse; - export import MessageCreateParams = MessagesAPI.MessageCreateParams; - export import MessageListParams = MessagesAPI.MessageListParams; +export declare namespace Messages { + export { + type MessageObject as MessageObject, + type MessageListResponse as MessageListResponse, + type MessageDeleteResponse as MessageDeleteResponse, + type MessageCreateParams as MessageCreateParams, + type MessageListParams as MessageListParams, + }; } diff --git a/src/resources/threads/runs/index.ts b/src/resources/threads/runs/index.ts index 6b3f1e2..2b15b85 100644 --- a/src/resources/threads/runs/index.ts +++ b/src/resources/threads/runs/index.ts @@ -1,11 +1,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - RunObject, - RunListResponse, - RunCreateParams, - RunListParams, - RunSubmitToolOutputsParams, Runs, + type RunObject, + type RunListResponse, + type RunCreateParams, + type RunListParams, + type RunSubmitToolOutputsParams, } from './runs'; -export { RunStepObject, StepListResponse, StepRetrieveParams, StepListParams, Steps } from './steps'; +export { + Steps, + type RunStepObject, + type StepListResponse, + type StepRetrieveParams, + type StepListParams, +} from './steps'; diff --git a/src/resources/threads/runs/runs.ts b/src/resources/threads/runs/runs.ts index ed60c5a..0b9ff00 100644 --- a/src/resources/threads/runs/runs.ts +++ b/src/resources/threads/runs/runs.ts @@ -3,8 +3,8 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as RunsAPI from './runs'; import * as StepsAPI from './steps'; +import { RunStepObject, StepListParams, StepListResponse, StepRetrieveParams, Steps } from './steps'; export class Runs extends APIResource { steps: StepsAPI.Steps = new StepsAPI.Steps(this._client); @@ -682,15 +682,22 @@ export namespace RunSubmitToolOutputsParams { } } -export namespace Runs { - export import RunObject = RunsAPI.RunObject; - export import RunListResponse = RunsAPI.RunListResponse; - export import RunCreateParams = RunsAPI.RunCreateParams; - export import RunListParams = RunsAPI.RunListParams; - export import RunSubmitToolOutputsParams = RunsAPI.RunSubmitToolOutputsParams; - export import Steps = StepsAPI.Steps; - export import RunStepObject = StepsAPI.RunStepObject; - export import StepListResponse = StepsAPI.StepListResponse; - export import StepRetrieveParams = StepsAPI.StepRetrieveParams; - export import StepListParams = StepsAPI.StepListParams; +Runs.Steps = Steps; + +export declare namespace Runs { + export { + type RunObject as RunObject, + type RunListResponse as RunListResponse, + type RunCreateParams as RunCreateParams, + type RunListParams as RunListParams, + type RunSubmitToolOutputsParams as RunSubmitToolOutputsParams, + }; + + export { + Steps as Steps, + type RunStepObject as RunStepObject, + type StepListResponse as StepListResponse, + type StepRetrieveParams as StepRetrieveParams, + type StepListParams as StepListParams, + }; } diff --git a/src/resources/threads/runs/steps.ts b/src/resources/threads/runs/steps.ts index c6f3fa2..41fc5c2 100644 --- a/src/resources/threads/runs/steps.ts +++ b/src/resources/threads/runs/steps.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as StepsAPI from './steps'; export class Steps extends APIResource { /** @@ -515,9 +514,11 @@ export interface StepListParams { order?: 'asc' | 'desc'; } -export namespace Steps { - export import RunStepObject = StepsAPI.RunStepObject; - export import StepListResponse = StepsAPI.StepListResponse; - export import StepRetrieveParams = StepsAPI.StepRetrieveParams; - export import StepListParams = StepsAPI.StepListParams; +export declare namespace Steps { + export { + type RunStepObject as RunStepObject, + type StepListResponse as StepListResponse, + type StepRetrieveParams as StepRetrieveParams, + type StepListParams as StepListParams, + }; } diff --git a/src/resources/threads/threads.ts b/src/resources/threads/threads.ts index 9e7094e..65ef35d 100644 --- a/src/resources/threads/threads.ts +++ b/src/resources/threads/threads.ts @@ -3,9 +3,24 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as ThreadsAPI from './threads'; import * as MessagesAPI from './messages'; +import { + MessageCreateParams, + MessageDeleteResponse, + MessageListParams, + MessageListResponse, + MessageObject, + Messages, +} from './messages'; import * as RunsAPI from './runs/runs'; +import { + RunCreateParams, + RunListParams, + RunListResponse, + RunObject, + RunSubmitToolOutputsParams, + Runs, +} from './runs/runs'; export class Threads extends APIResource { messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client); @@ -301,7 +316,7 @@ export namespace ThreadCreateParams { export interface ToolResources { code_interpreter?: ToolResources.CodeInterpreter; - file_search?: ToolResources.UnionMember0 | ToolResources.UnionMember1; + file_search?: ToolResources.FileSearch; } export namespace ToolResources { @@ -314,100 +329,22 @@ export namespace ThreadCreateParams { file_ids?: Array; } - export interface UnionMember0 { + export interface FileSearch { /** * The [vector store](/docs/api-reference/vector-stores/object) attached to this * thread. There can be a maximum of 1 vector store attached to the thread. */ - vector_store_ids: Array; - - /** - * A helper to create a [vector store](/docs/api-reference/vector-stores/object) - * with file_ids and attach it to this thread. There can be a maximum of 1 vector - * store attached to the thread. - */ - vector_stores?: Array; - } - - export namespace UnionMember0 { - export interface VectorStore { - /** - * The chunking strategy used to chunk the file(s). If not set, will use the `auto` - * strategy. - */ - chunking_strategy?: VectorStore.AutoChunkingStrategy | VectorStore.StaticChunkingStrategy; - - /** - * A list of [file](/docs/api-reference/files) IDs to add to the vector store. - * There can be a maximum of 10000 files in a vector store. - */ - file_ids?: Array; - - /** - * Set of 16 key-value pairs that can be attached to a vector store. This can be - * useful for storing additional information about the vector store in a structured - * format. Keys can be a maximum of 64 characters long and values can be a maximum - * of 512 characters long. - */ - metadata?: unknown; - } - - export namespace VectorStore { - /** - * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of - * `800` and `chunk_overlap_tokens` of `400`. - */ - export interface AutoChunkingStrategy { - /** - * Always `auto`. - */ - type: 'auto'; - } - - export interface StaticChunkingStrategy { - static: StaticChunkingStrategy.Static; - - /** - * Always `static`. - */ - type: 'static'; - } - - export namespace StaticChunkingStrategy { - export interface Static { - /** - * The number of tokens that overlap between chunks. The default value is `400`. - * - * Note that the overlap must not exceed half of `max_chunk_size_tokens`. - */ - chunk_overlap_tokens: number; - - /** - * The maximum number of tokens in each chunk. The default value is `800`. The - * minimum value is `100` and the maximum value is `4096`. - */ - max_chunk_size_tokens: number; - } - } - } - } + vector_store_ids?: Array; - export interface UnionMember1 { /** * A helper to create a [vector store](/docs/api-reference/vector-stores/object) * with file_ids and attach it to this thread. There can be a maximum of 1 vector * store attached to the thread. */ - vector_stores: Array; - - /** - * The [vector store](/docs/api-reference/vector-stores/object) attached to this - * thread. There can be a maximum of 1 vector store attached to the thread. - */ - vector_store_ids?: Array; + vector_stores?: Array; } - export namespace UnionMember1 { + export namespace FileSearch { export interface VectorStore { /** * The chunking strategy used to chunk the file(s). If not set, will use the `auto` @@ -523,21 +460,32 @@ export namespace ThreadUpdateParams { } } -export namespace Threads { - export import ThreadObject = ThreadsAPI.ThreadObject; - export import ThreadDeleteResponse = ThreadsAPI.ThreadDeleteResponse; - export import ThreadCreateParams = ThreadsAPI.ThreadCreateParams; - export import ThreadUpdateParams = ThreadsAPI.ThreadUpdateParams; - export import Messages = MessagesAPI.Messages; - export import MessageObject = MessagesAPI.MessageObject; - export import MessageListResponse = MessagesAPI.MessageListResponse; - export import MessageDeleteResponse = MessagesAPI.MessageDeleteResponse; - export import MessageCreateParams = MessagesAPI.MessageCreateParams; - export import MessageListParams = MessagesAPI.MessageListParams; - export import Runs = RunsAPI.Runs; - export import RunObject = RunsAPI.RunObject; - export import RunListResponse = RunsAPI.RunListResponse; - export import RunCreateParams = RunsAPI.RunCreateParams; - export import RunListParams = RunsAPI.RunListParams; - export import RunSubmitToolOutputsParams = RunsAPI.RunSubmitToolOutputsParams; +Threads.Messages = Messages; +Threads.Runs = Runs; + +export declare namespace Threads { + export { + type ThreadObject as ThreadObject, + type ThreadDeleteResponse as ThreadDeleteResponse, + type ThreadCreateParams as ThreadCreateParams, + type ThreadUpdateParams as ThreadUpdateParams, + }; + + export { + Messages as Messages, + type MessageObject as MessageObject, + type MessageListResponse as MessageListResponse, + type MessageDeleteResponse as MessageDeleteResponse, + type MessageCreateParams as MessageCreateParams, + type MessageListParams as MessageListParams, + }; + + export { + Runs as Runs, + type RunObject as RunObject, + type RunListResponse as RunListResponse, + type RunCreateParams as RunCreateParams, + type RunListParams as RunListParams, + type RunSubmitToolOutputsParams as RunSubmitToolOutputsParams, + }; } diff --git a/src/resources/uploads/index.ts b/src/resources/uploads/index.ts index 1a353d3..200d356 100644 --- a/src/resources/uploads/index.ts +++ b/src/resources/uploads/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Upload, UploadCreateParams, UploadCompleteParams, Uploads } from './uploads'; -export { UploadPart, PartCreateParams, Parts } from './parts'; +export { Parts, type UploadPart, type PartCreateParams } from './parts'; +export { Uploads, type Upload, type UploadCreateParams, type UploadCompleteParams } from './uploads'; diff --git a/src/resources/uploads/parts.ts b/src/resources/uploads/parts.ts index e9d2731..943cfb3 100644 --- a/src/resources/uploads/parts.ts +++ b/src/resources/uploads/parts.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as PartsAPI from './parts'; export class Parts extends APIResource { /** @@ -61,7 +60,6 @@ export interface PartCreateParams { data: Core.Uploadable; } -export namespace Parts { - export import UploadPart = PartsAPI.UploadPart; - export import PartCreateParams = PartsAPI.PartCreateParams; +export declare namespace Parts { + export { type UploadPart as UploadPart, type PartCreateParams as PartCreateParams }; } diff --git a/src/resources/uploads/uploads.ts b/src/resources/uploads/uploads.ts index 1627290..8c1a240 100644 --- a/src/resources/uploads/uploads.ts +++ b/src/resources/uploads/uploads.ts @@ -2,9 +2,9 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as UploadsAPI from './uploads'; import * as FilesAPI from '../files/files'; import * as PartsAPI from './parts'; +import { PartCreateParams, Parts, UploadPart } from './parts'; export class Uploads extends APIResource { parts: PartsAPI.Parts = new PartsAPI.Parts(this._client); @@ -155,11 +155,14 @@ export interface UploadCompleteParams { md5?: string; } -export namespace Uploads { - export import Upload = UploadsAPI.Upload; - export import UploadCreateParams = UploadsAPI.UploadCreateParams; - export import UploadCompleteParams = UploadsAPI.UploadCompleteParams; - export import Parts = PartsAPI.Parts; - export import UploadPart = PartsAPI.UploadPart; - export import PartCreateParams = PartsAPI.PartCreateParams; +Uploads.Parts = Parts; + +export declare namespace Uploads { + export { + type Upload as Upload, + type UploadCreateParams as UploadCreateParams, + type UploadCompleteParams as UploadCompleteParams, + }; + + export { Parts as Parts, type UploadPart as UploadPart, type PartCreateParams as PartCreateParams }; } diff --git a/src/resources/users.ts b/src/resources/users.ts index af45ad2..f7406c5 100644 --- a/src/resources/users.ts +++ b/src/resources/users.ts @@ -3,7 +3,6 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; -import * as UsersAPI from './users'; export class Users extends APIResource { /** @@ -121,10 +120,12 @@ export interface UserListParams { limit?: number; } -export namespace Users { - export import User = UsersAPI.User; - export import UserListResponse = UsersAPI.UserListResponse; - export import UserDeleteResponse = UsersAPI.UserDeleteResponse; - export import UserCreateParams = UsersAPI.UserCreateParams; - export import UserListParams = UsersAPI.UserListParams; +export declare namespace Users { + export { + type User as User, + type UserListResponse as UserListResponse, + type UserDeleteResponse as UserDeleteResponse, + type UserCreateParams as UserCreateParams, + type UserListParams as UserListParams, + }; } diff --git a/src/resources/vector-stores/file-batches/file-batches.ts b/src/resources/vector-stores/file-batches/file-batches.ts index 18c3dd5..1320040 100644 --- a/src/resources/vector-stores/file-batches/file-batches.ts +++ b/src/resources/vector-stores/file-batches/file-batches.ts @@ -2,8 +2,8 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as FileBatchesAPI from './file-batches'; import * as FilesAPI from './files'; +import { FileListParams, FileListResponse, Files } from './files'; export class FileBatches extends APIResource { files: FilesAPI.Files = new FilesAPI.Files(this._client); @@ -162,10 +162,13 @@ export namespace FileBatchCreateParams { } } -export namespace FileBatches { - export import VectorStoreFileBatchObject = FileBatchesAPI.VectorStoreFileBatchObject; - export import FileBatchCreateParams = FileBatchesAPI.FileBatchCreateParams; - export import Files = FilesAPI.Files; - export import FileListResponse = FilesAPI.FileListResponse; - export import FileListParams = FilesAPI.FileListParams; +FileBatches.Files = Files; + +export declare namespace FileBatches { + export { + type VectorStoreFileBatchObject as VectorStoreFileBatchObject, + type FileBatchCreateParams as FileBatchCreateParams, + }; + + export { Files as Files, type FileListResponse as FileListResponse, type FileListParams as FileListParams }; } diff --git a/src/resources/vector-stores/file-batches/files.ts b/src/resources/vector-stores/file-batches/files.ts index 23d2345..5f4af79 100644 --- a/src/resources/vector-stores/file-batches/files.ts +++ b/src/resources/vector-stores/file-batches/files.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as FileBatchesFilesAPI from './files'; import * as FilesAPI from '../files'; export class Files extends APIResource { @@ -84,7 +83,6 @@ export interface FileListParams { order?: 'asc' | 'desc'; } -export namespace Files { - export import FileListResponse = FileBatchesFilesAPI.FileListResponse; - export import FileListParams = FileBatchesFilesAPI.FileListParams; +export declare namespace Files { + export { type FileListResponse as FileListResponse, type FileListParams as FileListParams }; } diff --git a/src/resources/vector-stores/file-batches/index.ts b/src/resources/vector-stores/file-batches/index.ts index 7c4b126..c3d79b0 100644 --- a/src/resources/vector-stores/file-batches/index.ts +++ b/src/resources/vector-stores/file-batches/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { FileListResponse, FileListParams, Files } from './files'; -export { VectorStoreFileBatchObject, FileBatchCreateParams, FileBatches } from './file-batches'; +export { FileBatches, type VectorStoreFileBatchObject, type FileBatchCreateParams } from './file-batches'; +export { Files, type FileListResponse, type FileListParams } from './files'; diff --git a/src/resources/vector-stores/files.ts b/src/resources/vector-stores/files.ts index d5eeb20..f3c4d64 100644 --- a/src/resources/vector-stores/files.ts +++ b/src/resources/vector-stores/files.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as FilesAPI from './files'; export class Files extends APIResource { /** @@ -281,10 +280,12 @@ export interface FileListParams { order?: 'asc' | 'desc'; } -export namespace Files { - export import VectorStoreFileObject = FilesAPI.VectorStoreFileObject; - export import FileListResponse = FilesAPI.FileListResponse; - export import FileDeleteResponse = FilesAPI.FileDeleteResponse; - export import FileCreateParams = FilesAPI.FileCreateParams; - export import FileListParams = FilesAPI.FileListParams; +export declare namespace Files { + export { + type VectorStoreFileObject as VectorStoreFileObject, + type FileListResponse as FileListResponse, + type FileDeleteResponse as FileDeleteResponse, + type FileCreateParams as FileCreateParams, + type FileListParams as FileListParams, + }; } diff --git a/src/resources/vector-stores/index.ts b/src/resources/vector-stores/index.ts index 744af6c..e299837 100644 --- a/src/resources/vector-stores/index.ts +++ b/src/resources/vector-stores/index.ts @@ -1,19 +1,23 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { VectorStoreFileBatchObject, FileBatchCreateParams, FileBatches } from './file-batches/index'; export { - VectorStoreFileObject, - FileListResponse, - FileDeleteResponse, - FileCreateParams, - FileListParams, + FileBatches, + type VectorStoreFileBatchObject, + type FileBatchCreateParams, +} from './file-batches/index'; +export { Files, + type VectorStoreFileObject, + type FileListResponse, + type FileDeleteResponse, + type FileCreateParams, + type FileListParams, } from './files'; export { - VectorStoreObject, - VectorStoreListResponse, - VectorStoreDeleteResponse, - VectorStoreCreateParams, - VectorStoreListParams, VectorStores, + type VectorStoreObject, + type VectorStoreListResponse, + type VectorStoreDeleteResponse, + type VectorStoreCreateParams, + type VectorStoreListParams, } from './vector-stores'; diff --git a/src/resources/vector-stores/vector-stores.ts b/src/resources/vector-stores/vector-stores.ts index 53ba39a..250faea 100644 --- a/src/resources/vector-stores/vector-stores.ts +++ b/src/resources/vector-stores/vector-stores.ts @@ -3,9 +3,17 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as VectorStoresAPI from './vector-stores'; import * as FilesAPI from './files'; +import { + FileCreateParams, + FileDeleteResponse, + FileListParams, + FileListResponse, + Files, + VectorStoreFileObject, +} from './files'; import * as FileBatchesAPI from './file-batches/file-batches'; +import { FileBatchCreateParams, FileBatches, VectorStoreFileBatchObject } from './file-batches/file-batches'; export class VectorStores extends APIResource { files: FilesAPI.Files = new FilesAPI.Files(this._client); @@ -251,19 +259,30 @@ export interface VectorStoreListParams { order?: 'asc' | 'desc'; } -export namespace VectorStores { - export import VectorStoreObject = VectorStoresAPI.VectorStoreObject; - export import VectorStoreListResponse = VectorStoresAPI.VectorStoreListResponse; - export import VectorStoreDeleteResponse = VectorStoresAPI.VectorStoreDeleteResponse; - export import VectorStoreCreateParams = VectorStoresAPI.VectorStoreCreateParams; - export import VectorStoreListParams = VectorStoresAPI.VectorStoreListParams; - export import Files = FilesAPI.Files; - export import VectorStoreFileObject = FilesAPI.VectorStoreFileObject; - export import FileListResponse = FilesAPI.FileListResponse; - export import FileDeleteResponse = FilesAPI.FileDeleteResponse; - export import FileCreateParams = FilesAPI.FileCreateParams; - export import FileListParams = FilesAPI.FileListParams; - export import FileBatches = FileBatchesAPI.FileBatches; - export import VectorStoreFileBatchObject = FileBatchesAPI.VectorStoreFileBatchObject; - export import FileBatchCreateParams = FileBatchesAPI.FileBatchCreateParams; +VectorStores.Files = Files; +VectorStores.FileBatches = FileBatches; + +export declare namespace VectorStores { + export { + type VectorStoreObject as VectorStoreObject, + type VectorStoreListResponse as VectorStoreListResponse, + type VectorStoreDeleteResponse as VectorStoreDeleteResponse, + type VectorStoreCreateParams as VectorStoreCreateParams, + type VectorStoreListParams as VectorStoreListParams, + }; + + export { + Files as Files, + type VectorStoreFileObject as VectorStoreFileObject, + type FileListResponse as FileListResponse, + type FileDeleteResponse as FileDeleteResponse, + type FileCreateParams as FileCreateParams, + type FileListParams as FileListParams, + }; + + export { + FileBatches as FileBatches, + type VectorStoreFileBatchObject as VectorStoreFileBatchObject, + type FileBatchCreateParams as FileBatchCreateParams, + }; } diff --git a/tsconfig.deno.json b/tsconfig.deno.json index 378c18a..849e070 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -1,19 +1,14 @@ { "extends": "./tsconfig.json", - "include": ["deno"], + "include": ["dist-deno"], "exclude": [], "compilerOptions": { - "rootDir": "./deno", + "rootDir": "./dist-deno", "lib": ["es2020", "DOM"], - "paths": { - "argot-stainless-openai/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "argot-stainless-openai/*": ["deno/*"], - "argot-stainless-openai": ["deno/index.ts"], - }, "noEmit": true, "declaration": true, "declarationMap": true, - "outDir": "deno", + "outDir": "dist-deno", "pretty": true, "sourceMap": true } diff --git a/tsconfig.json b/tsconfig.json index 10fcc4c..4f60780 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "paths": { "argot-stainless-openai/_shims/auto/*": ["src/_shims/auto/*-node"], "argot-stainless-openai/*": ["src/*"], - "argot-stainless-openai": ["src/index.ts"], + "argot-stainless-openai": ["src/index.ts"] }, "noEmit": true, @@ -32,6 +32,7 @@ "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, + "isolatedModules": false, "skipLibCheck": true } diff --git a/yarn.lock b/yarn.lock index 10ebd6d..14e8a75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -322,9 +322,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.5.1": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.0.tgz#7ccb5f58703fa61ffdcbf39e2c604a109e781162" - integrity sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ== + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== "@eslint-community/regexpp@^4.6.1": version "4.6.2" @@ -857,9 +857,9 @@ pretty-format "^29.0.0" "@types/json-schema@^7.0.12": - version "7.0.13" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" - integrity sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ== + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": version "2.6.4" @@ -882,9 +882,9 @@ integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/semver@^7.5.0": - version "7.5.3" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.3.tgz#9a726e116beb26c24f1ccd6850201e1246122e04" - integrity sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw== + version "7.5.8" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== "@types/stack-utils@^2.0.0": version "2.0.3" @@ -904,15 +904,15 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz#d98046e9f7102d49a93d944d413c6055c47fafd7" - integrity sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA== + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" + integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/type-utils" "6.7.3" - "@typescript-eslint/utils" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/type-utils" "6.21.0" + "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -921,71 +921,72 @@ ts-api-utils "^1.0.1" "@typescript-eslint/parser@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.3.tgz#aaf40092a32877439e5957e18f2d6a91c82cc2fd" - integrity sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ== - dependencies: - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" + integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== + dependencies: + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz#07e5709c9bdae3eaf216947433ef97b3b8b7d755" - integrity sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ== +"@typescript-eslint/scope-manager@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" + integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/type-utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz#c2c165c135dda68a5e70074ade183f5ad68f3400" - integrity sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw== +"@typescript-eslint/type-utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" + integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== dependencies: - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/utils" "6.7.3" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/utils" "6.21.0" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.3.tgz#0402b5628a63f24f2dc9d4a678e9a92cc50ea3e9" - integrity sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw== +"@typescript-eslint/types@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" + integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== -"@typescript-eslint/typescript-estree@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz#ec5bb7ab4d3566818abaf0e4a8fa1958561b7279" - integrity sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g== +"@typescript-eslint/typescript-estree@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" + integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" + minimatch "9.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.3.tgz#96c655816c373135b07282d67407cb577f62e143" - integrity sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg== +"@typescript-eslint/utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" + integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" semver "^7.5.4" -"@typescript-eslint/visitor-keys@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz#83809631ca12909bd2083558d2f93f5747deebb2" - integrity sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg== +"@typescript-eslint/visitor-keys@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" + integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== dependencies: - "@typescript-eslint/types" "6.7.3" + "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" abort-controller@^3.0.0: @@ -1392,13 +1393,20 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@^4.3.4: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + dedent@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" @@ -1546,12 +1554,7 @@ eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" - integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== - -eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -1709,18 +1712,7 @@ fast-glob@^3.2.12: merge2 "^1.3.0" micromatch "^4.0.4" -fast-glob@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.3.0: +fast-glob@^3.2.9, fast-glob@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -1742,9 +1734,9 @@ fast-levenshtein@^2.0.6: integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + version "1.17.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" + integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== dependencies: reusify "^1.0.4" @@ -1967,9 +1959,9 @@ iconv-lite@^0.6.3: safer-buffer ">= 2.1.2 < 3.0.0" ignore@^5.2.0, ignore@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== import-fresh@^3.2.1: version "3.3.0" @@ -2674,6 +2666,13 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -2703,7 +2702,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0: +ms@^2.0.0, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -3058,13 +3057,18 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3, semver@^7.5.4: +semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3261,9 +3265,9 @@ tr46@~0.0.3: integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= ts-api-utils@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" - integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== ts-jest@^29.1.0: version "29.1.1" From 6af23e2b584129014300e7bd6230e9f0efe6b612 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:10:36 +0000 Subject: [PATCH 02/24] chore: rebuild project due to codegen change (#8) --- src/index.ts | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/index.ts b/src/index.ts index 46f2c4b..c884656 100644 --- a/src/index.ts +++ b/src/index.ts @@ -242,25 +242,6 @@ export class ArgotOpenAI extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export { - ArgotOpenAIError, - APIError, - APIConnectionError, - APIConnectionTimeoutError, - APIUserAbortError, - NotFoundError, - ConflictError, - RateLimitError, - BadRequestError, - AuthenticationError, - InternalServerError, - PermissionDeniedError, - UnprocessableEntityError, -} from './error'; - -export import toFile = Uploads.toFile; -export import fileFromPath = Uploads.fileFromPath; - ArgotOpenAI.Chat = Chat; ArgotOpenAI.Completions = Completions; ArgotOpenAI.Images = Images; @@ -279,7 +260,6 @@ ArgotOpenAI.Organization = Organization; ArgotOpenAI.Invites = Invites; ArgotOpenAI.Users = Users; ArgotOpenAI.Projects = Projects; - export declare namespace ArgotOpenAI { export type RequestOptions = Core.RequestOptions; @@ -399,4 +379,21 @@ export declare namespace ArgotOpenAI { export type ImagesResponse = API.ImagesResponse; } +export { toFile, fileFromPath } from 'argot-stainless-openai/uploads'; +export { + ArgotOpenAIError, + APIError, + APIConnectionError, + APIConnectionTimeoutError, + APIUserAbortError, + NotFoundError, + ConflictError, + RateLimitError, + BadRequestError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, +} from 'argot-stainless-openai/error'; + export default ArgotOpenAI; From b2020fae8a1a9a0c9777fb310fdb4f9bb1e828a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:03:33 +0000 Subject: [PATCH 03/24] chore: rebuild project due to codegen change (#9) --- package.json | 1 - src/index.ts | 4 ++-- yarn.lock | 40 ---------------------------------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 58f1a95..6bf7f51 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", "ts-node": "^10.5.0", "tsc-multi": "^1.1.0", "tsconfig-paths": "^4.0.0", diff --git a/src/index.ts b/src/index.ts index c884656..df36e48 100644 --- a/src/index.ts +++ b/src/index.ts @@ -379,7 +379,7 @@ export declare namespace ArgotOpenAI { export type ImagesResponse = API.ImagesResponse; } -export { toFile, fileFromPath } from 'argot-stainless-openai/uploads'; +export { toFile, fileFromPath } from './uploads'; export { ArgotOpenAIError, APIError, @@ -394,6 +394,6 @@ export { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} from 'argot-stainless-openai/error'; +} from './error'; export default ArgotOpenAI; diff --git a/yarn.lock b/yarn.lock index 14e8a75..bfd47d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -759,16 +759,6 @@ dependencies: "@swc/counter" "^0.1.3" -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== - dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" - "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -1315,11 +1305,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - collect-v8-coverage@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" @@ -2680,23 +2665,11 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2860,11 +2833,6 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3283,14 +3251,6 @@ ts-jest@^29.1.0: semver "^7.5.3" yargs-parser "^21.0.1" -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - ts-node@^10.5.0: version "10.7.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" From 605042411e5de37ca1c1ff8600cf62356bac7da9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 20:02:27 +0000 Subject: [PATCH 04/24] chore: rebuild project due to codegen change (#10) --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0334fe1..027aca8 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,15 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: +- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) +- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. +- Deno v1.28.0 or higher, using `import ArgotOpenAI from "npm:argot-stainless-openai"`. +- Bun 1.0 or later. +- Cloudflare Workers. +- Vercel Edge Runtime. +- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). +- Nitro v2.6 or greater. + Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. From fe3f1bc5c04fe8940e4470bbad3047540b861227 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:54:19 +0000 Subject: [PATCH 05/24] chore: rebuild project due to codegen change (#11) --- .../audio/transcriptions.test.ts | 2 +- tests/api-resources/chat.test.ts | 8 -- .../fine-tuning/jobs/jobs.test.ts | 25 +---- .../organization/audit-logs.test.ts | 10 +- tests/api-resources/threads/runs/runs.test.ts | 8 +- tests/api-resources/threads/threads.test.ts | 99 +------------------ tests/api-resources/uploads/uploads.test.ts | 9 +- 7 files changed, 14 insertions(+), 147 deletions(-) diff --git a/tests/api-resources/audio/transcriptions.test.ts b/tests/api-resources/audio/transcriptions.test.ts index bb9ef6d..004f3c9 100644 --- a/tests/api-resources/audio/transcriptions.test.ts +++ b/tests/api-resources/audio/transcriptions.test.ts @@ -31,7 +31,7 @@ describe('resource transcriptions', () => { prompt: 'prompt', response_format: 'json', temperature: 0, - timestamp_granularities: ['word', 'segment'], + timestamp_granularities: ['word'], }); }); }); diff --git a/tests/api-resources/chat.test.ts b/tests/api-resources/chat.test.ts index c94e152..08c7a75 100644 --- a/tests/api-resources/chat.test.ts +++ b/tests/api-resources/chat.test.ts @@ -50,14 +50,6 @@ describe('resource chat', () => { function: { name: 'name', description: 'description', parameters: { foo: 'bar' }, strict: true }, type: 'function', }, - { - function: { name: 'name', description: 'description', parameters: { foo: 'bar' }, strict: true }, - type: 'function', - }, - { - function: { name: 'name', description: 'description', parameters: { foo: 'bar' }, strict: true }, - type: 'function', - }, ], top_logprobs: 0, top_p: 1, diff --git a/tests/api-resources/fine-tuning/jobs/jobs.test.ts b/tests/api-resources/fine-tuning/jobs/jobs.test.ts index f9ba96d..8756b5e 100644 --- a/tests/api-resources/fine-tuning/jobs/jobs.test.ts +++ b/tests/api-resources/fine-tuning/jobs/jobs.test.ts @@ -31,30 +31,7 @@ describe('resource jobs', () => { integrations: [ { type: 'wandb', - wandb: { - project: 'my-wandb-project', - entity: 'entity', - name: 'name', - tags: ['custom-tag', 'custom-tag', 'custom-tag'], - }, - }, - { - type: 'wandb', - wandb: { - project: 'my-wandb-project', - entity: 'entity', - name: 'name', - tags: ['custom-tag', 'custom-tag', 'custom-tag'], - }, - }, - { - type: 'wandb', - wandb: { - project: 'my-wandb-project', - entity: 'entity', - name: 'name', - tags: ['custom-tag', 'custom-tag', 'custom-tag'], - }, + wandb: { project: 'my-wandb-project', entity: 'entity', name: 'name', tags: ['custom-tag'] }, }, ], seed: 42, diff --git a/tests/api-resources/organization/audit-logs.test.ts b/tests/api-resources/organization/audit-logs.test.ts index 2b5999e..9174f53 100644 --- a/tests/api-resources/organization/audit-logs.test.ts +++ b/tests/api-resources/organization/audit-logs.test.ts @@ -32,15 +32,15 @@ describe('resource auditLogs', () => { await expect( client.organization.auditLogs.list( { - actor_emails: ['string', 'string', 'string'], - actor_ids: ['string', 'string', 'string'], + actor_emails: ['string'], + actor_ids: ['string'], after: 'after', before: 'before', effective_at: { gt: 0, gte: 0, lt: 0, lte: 0 }, - event_types: ['api_key.created', 'api_key.updated', 'api_key.deleted'], + event_types: ['api_key.created'], limit: 0, - project_ids: ['string', 'string', 'string'], - resource_ids: ['string', 'string', 'string'], + project_ids: ['string'], + resource_ids: ['string'], }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/threads/runs/runs.test.ts b/tests/api-resources/threads/runs/runs.test.ts index db51fd9..ca3b95b 100644 --- a/tests/api-resources/threads/runs/runs.test.ts +++ b/tests/api-resources/threads/runs/runs.test.ts @@ -87,7 +87,7 @@ describe('resource runs', () => { test('submitToolOutputs: only required params', async () => { const responsePromise = client.threads.runs.submitToolOutputs('thread_id', 'run_id', { - tool_outputs: [{}, {}, {}], + tool_outputs: [{}], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -100,11 +100,7 @@ describe('resource runs', () => { test('submitToolOutputs: required and optional params', async () => { const response = await client.threads.runs.submitToolOutputs('thread_id', 'run_id', { - tool_outputs: [ - { output: 'output', tool_call_id: 'tool_call_id' }, - { output: 'output', tool_call_id: 'tool_call_id' }, - { output: 'output', tool_call_id: 'tool_call_id' }, - ], + tool_outputs: [{ output: 'output', tool_call_id: 'tool_call_id' }], stream: true, }); }); diff --git a/tests/api-resources/threads/threads.test.ts b/tests/api-resources/threads/threads.test.ts index c6efb4f..4035262 100644 --- a/tests/api-resources/threads/threads.test.ts +++ b/tests/api-resources/threads/threads.test.ts @@ -36,109 +36,16 @@ describe('resource threads', () => { { content: 'string', role: 'user', - attachments: [ - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - ], - metadata: {}, - }, - { - content: 'string', - role: 'user', - attachments: [ - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - ], - metadata: {}, - }, - { - content: 'string', - role: 'user', - attachments: [ - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - { - file_id: 'file_id', - tools: [ - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - { type: 'code_interpreter' }, - ], - }, - ], + attachments: [{ file_id: 'file_id', tools: [{ type: 'code_interpreter' }] }], metadata: {}, }, ], metadata: {}, tool_resources: { - code_interpreter: { file_ids: ['string', 'string', 'string'] }, + code_interpreter: { file_ids: ['string'] }, file_search: { vector_store_ids: ['string'], - vector_stores: [ - { - chunking_strategy: { type: 'auto' }, - file_ids: ['string', 'string', 'string'], - metadata: {}, - }, - ], + vector_stores: [{ chunking_strategy: { type: 'auto' }, file_ids: ['string'], metadata: {} }], }, }, }, diff --git a/tests/api-resources/uploads/uploads.test.ts b/tests/api-resources/uploads/uploads.test.ts index c711ae7..8d4006c 100644 --- a/tests/api-resources/uploads/uploads.test.ts +++ b/tests/api-resources/uploads/uploads.test.ts @@ -53,9 +53,7 @@ describe('resource uploads', () => { }); test('complete: only required params', async () => { - const responsePromise = client.uploads.complete('upload_abc123', { - part_ids: ['string', 'string', 'string'], - }); + const responsePromise = client.uploads.complete('upload_abc123', { part_ids: ['string'] }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -66,9 +64,6 @@ describe('resource uploads', () => { }); test('complete: required and optional params', async () => { - const response = await client.uploads.complete('upload_abc123', { - part_ids: ['string', 'string', 'string'], - md5: 'md5', - }); + const response = await client.uploads.complete('upload_abc123', { part_ids: ['string'], md5: 'md5' }); }); }); From 3b489d6b255f74a829fb27cfd12daf6a5d2ca556 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 05:04:34 +0000 Subject: [PATCH 06/24] docs: remove suggestion to use `npm` call out (#12) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 027aca8..d5fccc6 100644 --- a/README.md +++ b/README.md @@ -289,7 +289,7 @@ The following runtimes are supported: - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import ArgotOpenAI from "npm:argot-stainless-openai"`. +- Deno v1.28.0 or higher. - Bun 1.0 or later. - Cloudflare Workers. - Vercel Edge Runtime. From 841b092383f30939083f63a62f5a3fe40b791bbd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 05:19:09 +0000 Subject: [PATCH 07/24] chore: remove redundant word in comment (#13) --- scripts/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build b/scripts/build index ac5f898..ef783f7 100755 --- a/scripts/build +++ b/scripts/build @@ -32,7 +32,7 @@ npm exec tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto -# we need to add exports = module.exports = Argot OpenAI Node to index.js; +# we need to add exports = module.exports = ArgotOpenAI to index.js; # No way to get that from index.ts because it would cause compile errors # when building .mjs node scripts/utils/fix-index-exports.cjs From c3b082040cca78f89db1eab85f73028830579ed5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 03:33:16 +0000 Subject: [PATCH 08/24] feat(internal): make git install file structure match npm (#14) --- package.json | 2 +- scripts/utils/check-is-in-git-install.sh | 2 +- scripts/utils/git-swap.sh | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 scripts/utils/git-swap.sh diff --git a/package.json b/package.json index 6bf7f51..0d27fd6 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "./scripts/build", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi", "tsn": "ts-node -r tsconfig-paths/register", "lint": "./scripts/lint", "fix": "./scripts/format" diff --git a/scripts/utils/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh index 36bcedc..1354eb4 100755 --- a/scripts/utils/check-is-in-git-install.sh +++ b/scripts/utils/check-is-in-git-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if you happen to call prepare for a repository that's already in node_modules. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] || # The name of the containing directory that 'npm` uses, which looks like diff --git a/scripts/utils/git-swap.sh b/scripts/utils/git-swap.sh new file mode 100755 index 0000000..79d1888 --- /dev/null +++ b/scripts/utils/git-swap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -exuo pipefail +# the package is published to NPM from ./dist +# we want the final file structure for git installs to match the npm installs, so we + +# delete everything except ./dist and ./node_modules +find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' + + +# move everything from ./dist to . +mv dist/* . + +# delete the now-empty ./dist +rmdir dist From 410700f2d8669ea95e423706a4ca897182a5640b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:48:10 +0000 Subject: [PATCH 09/24] chore(internal): remove unnecessary getRequestClient function (#15) --- src/core.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core.ts b/src/core.ts index 6b7a5c8..158b5e8 100644 --- a/src/core.ts +++ b/src/core.ts @@ -523,19 +523,13 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); return ( - this.getRequestClient() - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - .fetch.call(undefined, url, { signal: controller.signal as any, ...options }) - .finally(() => { - clearTimeout(timeout); - }) + // use undefined this binding; fetch errors if bound to something else in browser/cloudflare + this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + clearTimeout(timeout); + }) ); } - protected getRequestClient(): RequestClient { - return { fetch: this.fetch }; - } - private shouldRetry(response: Response): boolean { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); From 101ef918167839d6d13cd5c0a9c1a7f17120edde Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 03:24:21 +0000 Subject: [PATCH 10/24] chore(internal): bump cross-spawn to v7.0.6 (#16) Note: it is a dev transitive dependency. --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bfd47d8..bb17942 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1370,9 +1370,9 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" From ce16bc99d0e6a7a92324a4746548842854605b2d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 03:29:43 +0000 Subject: [PATCH 11/24] chore(types): nicer error class types + jsdocs (#17) --- src/error.ts | 64 ++++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/error.ts b/src/error.ts index 0e2c096..d0edd3d 100644 --- a/src/error.ts +++ b/src/error.ts @@ -4,17 +4,19 @@ import { castToError, Headers } from './core'; export class ArgotOpenAIError extends Error {} -export class APIError extends ArgotOpenAIError { - readonly status: number | undefined; - readonly headers: Headers | undefined; - readonly error: Object | undefined; - - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { +export class APIError< + TStatus extends number | undefined = number | undefined, + THeaders extends Headers | undefined = Headers | undefined, + TError extends Object | undefined = Object | undefined, +> extends ArgotOpenAIError { + /** HTTP status for the response that caused the error */ + readonly status: TStatus; + /** HTTP headers for the response that caused the error */ + readonly headers: THeaders; + /** JSON body of the response that caused the error */ + readonly error: TError; + + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; @@ -48,7 +50,7 @@ export class APIError extends ArgotOpenAIError { message: string | undefined, headers: Headers | undefined, ): APIError { - if (!status) { + if (!status || !headers) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } @@ -90,17 +92,13 @@ export class APIError extends ArgotOpenAIError { } } -export class APIUserAbortError extends APIError { - override readonly status: undefined = undefined; - +export class APIUserAbortError extends APIError { constructor({ message }: { message?: string } = {}) { super(undefined, undefined, message || 'Request was aborted.', undefined); } } -export class APIConnectionError extends APIError { - override readonly status: undefined = undefined; - +export class APIConnectionError extends APIError { constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared @@ -115,32 +113,18 @@ export class APIConnectionTimeoutError extends APIConnectionError { } } -export class BadRequestError extends APIError { - override readonly status: 400 = 400; -} +export class BadRequestError extends APIError<400, Headers> {} -export class AuthenticationError extends APIError { - override readonly status: 401 = 401; -} +export class AuthenticationError extends APIError<401, Headers> {} -export class PermissionDeniedError extends APIError { - override readonly status: 403 = 403; -} +export class PermissionDeniedError extends APIError<403, Headers> {} -export class NotFoundError extends APIError { - override readonly status: 404 = 404; -} +export class NotFoundError extends APIError<404, Headers> {} -export class ConflictError extends APIError { - override readonly status: 409 = 409; -} +export class ConflictError extends APIError<409, Headers> {} -export class UnprocessableEntityError extends APIError { - override readonly status: 422 = 422; -} +export class UnprocessableEntityError extends APIError<422, Headers> {} -export class RateLimitError extends APIError { - override readonly status: 429 = 429; -} +export class RateLimitError extends APIError<429, Headers> {} -export class InternalServerError extends APIError {} +export class InternalServerError extends APIError {} From 86c928a7d28179be9b1653a67c678c0a422c3525 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 03:27:36 +0000 Subject: [PATCH 12/24] chore(internal): update isAbsoluteURL (#18) --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index 158b5e8..c548111 100644 --- a/src/core.ts +++ b/src/core.ts @@ -970,8 +970,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); }; From 90d10b677b82f57c39aeb0f8368281c9f756cc0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 03:42:45 +0000 Subject: [PATCH 13/24] chore(internal): fix some typos (#19) --- src/core.ts | 4 ++-- tests/index.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.ts b/src/core.ts index c548111..ab8260c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -163,7 +163,7 @@ export abstract class APIClient { maxRetries = 2, timeout = 60000, // 1 minute httpAgent, - fetch: overridenFetch, + fetch: overriddenFetch, }: { baseURL: string; maxRetries?: number | undefined; @@ -176,7 +176,7 @@ export abstract class APIClient { this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; - this.fetch = overridenFetch ?? fetch; + this.fetch = overriddenFetch ?? fetch; } protected authHeaders(opts: FinalRequestOptions): Headers { diff --git a/tests/index.test.ts b/tests/index.test.ts index 0ae45b6..d404715 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -177,7 +177,7 @@ describe('instantiate client', () => { expect(client.apiKey).toBe('My API Key'); }); - test('with overriden environment variable arguments', () => { + test('with overridden environment variable arguments', () => { // set options via env var process.env['API_KEY'] = 'another My API Key'; const client = new ArgotOpenAI({ apiKey: 'My API Key' }); From 6e53df187ab17fc9b5acd95b3f360df2a9d5cf5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 03:31:26 +0000 Subject: [PATCH 14/24] chore(internal): codegen related update (#20) --- src/core.ts | 12 +++++++++++- tests/index.test.ts | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index ab8260c..4de8c11 100644 --- a/src/core.ts +++ b/src/core.ts @@ -522,9 +522,19 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); + const fetchOptions = { + signal: controller.signal as any, + ...options, + }; + if (fetchOptions.method) { + // Custom methods like 'patch' need to be uppercased + // See https://github.com/nodejs/undici/issues/2294 + fetchOptions.method = fetchOptions.method.toUpperCase(); + } + return ( // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + this.fetch.call(undefined, url, fetchOptions).finally(() => { clearTimeout(timeout); }) ); diff --git a/tests/index.test.ts b/tests/index.test.ts index d404715..ffa1dc1 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -122,6 +122,23 @@ describe('instantiate client', () => { expect(spy).toHaveBeenCalledTimes(1); }); + test('normalized method', async () => { + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + capturedRequest = init; + return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new ArgotOpenAI({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: testFetch, + }); + + await client.patch('/foo'); + expect(capturedRequest?.method).toEqual('PATCH'); + }); + describe('baseUrl', () => { test('trailing slash', () => { const client = new ArgotOpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' }); From 63242fe510869b809f9cfa8d8af61a8cc5aa1099 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 03:26:11 +0000 Subject: [PATCH 15/24] chore(internal): codegen related update (#21) --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6981045..0dea204 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source From 36886375e986fa7d119ba692c59910d7a82744bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 03:27:19 +0000 Subject: [PATCH 16/24] chore(internal): codegen related update (#22) --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0dea204..6981045 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -```sh -$ chmod +x examples/.ts +``` +chmod +x examples/.ts # run the example against your api -$ yarn tsn -T examples/.ts +yarn tsn -T examples/.ts ``` ## Using the repository from source From 56770302e8c268d7d84d1b4643c31071337e5925 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 03:27:58 +0000 Subject: [PATCH 17/24] docs: minor formatting changes (#23) --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6981045..0dea204 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source From a32882583a927af3e7308fdc6b26754d2c521a6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 03:26:32 +0000 Subject: [PATCH 18/24] chore(internal): codegen related update (#24) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index a196326..eb26fe2 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Argot OpenAI + Copyright 2025 Argot OpenAI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From e83008087bc1459242122be71bfb2a03a7047e98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 03:39:49 +0000 Subject: [PATCH 19/24] chore(internal): codegen related update (#25) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d5fccc6..a7cfda0 100644 --- a/README.md +++ b/README.md @@ -274,7 +274,7 @@ await client.completions.create( This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. From 848c16616984deecdf2d9d93c79b70a64bf9f977 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 03:35:27 +0000 Subject: [PATCH 20/24] fix: send correct Accept header for certain endpoints (#26) --- src/resources/audio/audio.ts | 7 ++++++- src/resources/files/content.ts | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/resources/audio/audio.ts b/src/resources/audio/audio.ts index c07ff7e..430a3e4 100644 --- a/src/resources/audio/audio.ts +++ b/src/resources/audio/audio.ts @@ -16,7 +16,12 @@ export class Audio extends APIResource { * Generates audio from the input text. */ speech(body: AudioSpeechParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/audio/speech', { body, ...options, __binaryResponse: true }); + return this._client.post('/audio/speech', { + body, + ...options, + headers: { Accept: 'application/octet-stream', ...options?.headers }, + __binaryResponse: true, + }); } } diff --git a/src/resources/files/content.ts b/src/resources/files/content.ts index 6993b46..f1ce9b0 100644 --- a/src/resources/files/content.ts +++ b/src/resources/files/content.ts @@ -8,10 +8,7 @@ export class Content extends APIResource { * Returns the contents of the specified file. */ retrieve(fileId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/files/${fileId}/content`, { - ...options, - headers: { Accept: 'application/json', ...options?.headers }, - }); + return this._client.get(`/files/${fileId}/content`, options); } } From 96158a4f08d6693e8264cc885757d97216582e22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 03:34:48 +0000 Subject: [PATCH 21/24] chore(internal): codegen related update (#27) --- src/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index df36e48..516e6ea 100644 --- a/src/index.ts +++ b/src/index.ts @@ -90,7 +90,7 @@ export interface ClientOptions { * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. */ - timeout?: number; + timeout?: number | undefined; /** * An HTTP agent used to manage HTTP(S) connections. @@ -98,7 +98,7 @@ export interface ClientOptions { * If not provided, an agent will be constructed by default in the Node.js environment, * otherwise no agent is used. */ - httpAgent?: Agent; + httpAgent?: Agent | undefined; /** * Specify a custom `fetch` function implementation. @@ -114,7 +114,7 @@ export interface ClientOptions { * * @default 2 */ - maxRetries?: number; + maxRetries?: number | undefined; /** * Default headers to include with every request to the API. @@ -122,7 +122,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * header to `undefined` or `null` in request options. */ - defaultHeaders?: Core.Headers; + defaultHeaders?: Core.Headers | undefined; /** * Default query parameters to include with every request to the API. @@ -130,7 +130,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ - defaultQuery?: Core.DefaultQuery; + defaultQuery?: Core.DefaultQuery | undefined; } /** From 806f949936d37e8e8d1722a1ffc54d1a0b01d7d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 03:32:09 +0000 Subject: [PATCH 22/24] chore(internal): codegen related update (#28) --- tests/index.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/index.test.ts b/tests/index.test.ts index ffa1dc1..4dcc909 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -96,6 +96,15 @@ describe('instantiate client', () => { expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true }); }); + test('explicit global fetch', async () => { + // make sure the global fetch type is assignable to our Fetch type + const client = new ArgotOpenAI({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: defaultFetch, + }); + }); + test('custom signal', async () => { const client = new ArgotOpenAI({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', From 5111f1e4d0e2fa03ab2bab61a1c17fc656f8fdcc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 06:34:49 +0000 Subject: [PATCH 23/24] chore(internal): codegen related update (#29) --- src/resources/chat.ts | 16 ++++++++-------- src/resources/files/files.ts | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/resources/chat.ts b/src/resources/chat.ts index 5bb53a1..c32cfd1 100644 --- a/src/resources/chat.ts +++ b/src/resources/chat.ts @@ -238,8 +238,8 @@ export namespace ChatCompletionsResponse { role: 'assistant'; /** - * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of - * a function that should be called, as generated by the model. + * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a + * function that should be called, as generated by the model. */ function_call?: Message.FunctionCall; @@ -251,8 +251,8 @@ export namespace ChatCompletionsResponse { export namespace Message { /** - * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of - * a function that should be called, as generated by the model. + * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a + * function that should be called, as generated by the model. */ export interface FunctionCall { /** @@ -722,8 +722,8 @@ export namespace ChatCompletionsParams { | null; /** - * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of - * a function that should be called, as generated by the model. + * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a + * function that should be called, as generated by the model. */ function_call?: ChatCompletionRequestAssistantMessage.FunctionCall | null; @@ -770,8 +770,8 @@ export namespace ChatCompletionsParams { } /** - * @deprecated: Deprecated and replaced by `tool_calls`. The name and arguments of - * a function that should be called, as generated by the model. + * @deprecated Deprecated and replaced by `tool_calls`. The name and arguments of a + * function that should be called, as generated by the model. */ export interface FunctionCall { /** diff --git a/src/resources/files/files.ts b/src/resources/files/files.ts index fc38bf8..5e76751 100644 --- a/src/resources/files/files.ts +++ b/src/resources/files/files.ts @@ -106,13 +106,13 @@ export interface OpenAIFile { | 'vision'; /** - * @deprecated: Deprecated. The current status of the file, which can be either + * @deprecated Deprecated. The current status of the file, which can be either * `uploaded`, `processed`, or `error`. */ status: 'uploaded' | 'processed' | 'error'; /** - * @deprecated: Deprecated. For details on why a fine-tuning training file failed + * @deprecated Deprecated. For details on why a fine-tuning training file failed * validation, see the `error` field on `fine_tuning.job`. */ status_details?: string; From 10f2d08a047184d0375b531f77c06d3ef6478a79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 06:35:09 +0000 Subject: [PATCH 24/24] release: 0.1.0-alpha.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 42 +++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d7a8735..c5e8a3e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7447176..172ec69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,47 @@ # Changelog +## 0.1.0-alpha.2 (2025-01-23) + +Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/argotdev/argot-stainless-openai/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) + +### Features + +* **internal:** make git install file structure match npm ([#14](https://github.com/argotdev/argot-stainless-openai/issues/14)) ([c3b0820](https://github.com/argotdev/argot-stainless-openai/commit/c3b082040cca78f89db1eab85f73028830579ed5)) + + +### Bug Fixes + +* send correct Accept header for certain endpoints ([#26](https://github.com/argotdev/argot-stainless-openai/issues/26)) ([848c166](https://github.com/argotdev/argot-stainless-openai/commit/848c16616984deecdf2d9d93c79b70a64bf9f977)) + + +### Chores + +* **internal:** bump cross-spawn to v7.0.6 ([#16](https://github.com/argotdev/argot-stainless-openai/issues/16)) ([101ef91](https://github.com/argotdev/argot-stainless-openai/commit/101ef918167839d6d13cd5c0a9c1a7f17120edde)) +* **internal:** codegen related update ([#20](https://github.com/argotdev/argot-stainless-openai/issues/20)) ([6e53df1](https://github.com/argotdev/argot-stainless-openai/commit/6e53df187ab17fc9b5acd95b3f360df2a9d5cf5e)) +* **internal:** codegen related update ([#21](https://github.com/argotdev/argot-stainless-openai/issues/21)) ([63242fe](https://github.com/argotdev/argot-stainless-openai/commit/63242fe510869b809f9cfa8d8af61a8cc5aa1099)) +* **internal:** codegen related update ([#22](https://github.com/argotdev/argot-stainless-openai/issues/22)) ([3688637](https://github.com/argotdev/argot-stainless-openai/commit/36886375e986fa7d119ba692c59910d7a82744bb)) +* **internal:** codegen related update ([#24](https://github.com/argotdev/argot-stainless-openai/issues/24)) ([a328825](https://github.com/argotdev/argot-stainless-openai/commit/a32882583a927af3e7308fdc6b26754d2c521a6c)) +* **internal:** codegen related update ([#25](https://github.com/argotdev/argot-stainless-openai/issues/25)) ([e830080](https://github.com/argotdev/argot-stainless-openai/commit/e83008087bc1459242122be71bfb2a03a7047e98)) +* **internal:** codegen related update ([#27](https://github.com/argotdev/argot-stainless-openai/issues/27)) ([96158a4](https://github.com/argotdev/argot-stainless-openai/commit/96158a4f08d6693e8264cc885757d97216582e22)) +* **internal:** codegen related update ([#28](https://github.com/argotdev/argot-stainless-openai/issues/28)) ([806f949](https://github.com/argotdev/argot-stainless-openai/commit/806f949936d37e8e8d1722a1ffc54d1a0b01d7d5)) +* **internal:** codegen related update ([#29](https://github.com/argotdev/argot-stainless-openai/issues/29)) ([5111f1e](https://github.com/argotdev/argot-stainless-openai/commit/5111f1e4d0e2fa03ab2bab61a1c17fc656f8fdcc)) +* **internal:** fix some typos ([#19](https://github.com/argotdev/argot-stainless-openai/issues/19)) ([90d10b6](https://github.com/argotdev/argot-stainless-openai/commit/90d10b677b82f57c39aeb0f8368281c9f756cc0c)) +* **internal:** remove unnecessary getRequestClient function ([#15](https://github.com/argotdev/argot-stainless-openai/issues/15)) ([410700f](https://github.com/argotdev/argot-stainless-openai/commit/410700f2d8669ea95e423706a4ca897182a5640b)) +* **internal:** update isAbsoluteURL ([#18](https://github.com/argotdev/argot-stainless-openai/issues/18)) ([86c928a](https://github.com/argotdev/argot-stainless-openai/commit/86c928a7d28179be9b1653a67c678c0a422c3525)) +* rebuild project due to codegen change ([#10](https://github.com/argotdev/argot-stainless-openai/issues/10)) ([6050424](https://github.com/argotdev/argot-stainless-openai/commit/605042411e5de37ca1c1ff8600cf62356bac7da9)) +* rebuild project due to codegen change ([#11](https://github.com/argotdev/argot-stainless-openai/issues/11)) ([fe3f1bc](https://github.com/argotdev/argot-stainless-openai/commit/fe3f1bc5c04fe8940e4470bbad3047540b861227)) +* rebuild project due to codegen change ([#6](https://github.com/argotdev/argot-stainless-openai/issues/6)) ([8890e6d](https://github.com/argotdev/argot-stainless-openai/commit/8890e6d9c18d9e17d9de51832eee911b2af50f6d)) +* rebuild project due to codegen change ([#8](https://github.com/argotdev/argot-stainless-openai/issues/8)) ([6af23e2](https://github.com/argotdev/argot-stainless-openai/commit/6af23e2b584129014300e7bd6230e9f0efe6b612)) +* rebuild project due to codegen change ([#9](https://github.com/argotdev/argot-stainless-openai/issues/9)) ([b2020fa](https://github.com/argotdev/argot-stainless-openai/commit/b2020fae8a1a9a0c9777fb310fdb4f9bb1e828a0)) +* remove redundant word in comment ([#13](https://github.com/argotdev/argot-stainless-openai/issues/13)) ([841b092](https://github.com/argotdev/argot-stainless-openai/commit/841b092383f30939083f63a62f5a3fe40b791bbd)) +* **types:** nicer error class types + jsdocs ([#17](https://github.com/argotdev/argot-stainless-openai/issues/17)) ([ce16bc9](https://github.com/argotdev/argot-stainless-openai/commit/ce16bc99d0e6a7a92324a4746548842854605b2d)) + + +### Documentation + +* minor formatting changes ([#23](https://github.com/argotdev/argot-stainless-openai/issues/23)) ([5677030](https://github.com/argotdev/argot-stainless-openai/commit/56770302e8c268d7d84d1b4643c31071337e5925)) +* remove suggestion to use `npm` call out ([#12](https://github.com/argotdev/argot-stainless-openai/issues/12)) ([3b489d6](https://github.com/argotdev/argot-stainless-openai/commit/3b489d6b255f74a829fb27cfd12daf6a5d2ca556)) + ## 0.1.0-alpha.1 (2024-10-18) Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/argotdev/argot-stainless-openai/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) diff --git a/package.json b/package.json index 0d27fd6..39752fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "argot-stainless-openai", - "version": "0.1.0-alpha.1", + "version": "0.1.0-alpha.2", "description": "The official TypeScript library for the Argot OpenAI API", "author": "Argot OpenAI ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index b0bfd9e..a528f63 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.1'; // x-release-please-version +export const VERSION = '0.1.0-alpha.2'; // x-release-please-version