From 05ff8f7671fe6ce5d9517034f76a166a0bd27803 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:27:15 -0400 Subject: [PATCH 1/4] docs: fix typo in CONTRIBUTING.md (#722) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9e64025d..9e8f669a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ pnpm link -—global openai Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```bash -npx prism path/to/your/openapi.yml +npx prism mock path/to/your/openapi.yml ``` ```bash From 139e205ed1ed30cb1df982d852a093dcea945aba Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:42:30 -0400 Subject: [PATCH 2/4] chore(internal): update generated pragma comment (#724) --- src/error.ts | 2 +- src/index.ts | 2 +- src/pagination.ts | 2 +- src/resource.ts | 2 +- src/resources/audio/audio.ts | 2 +- src/resources/audio/index.ts | 2 +- src/resources/audio/speech.ts | 2 +- src/resources/audio/transcriptions.ts | 2 +- src/resources/audio/translations.ts | 2 +- src/resources/beta/assistants/assistants.ts | 2 +- src/resources/beta/assistants/files.ts | 2 +- src/resources/beta/assistants/index.ts | 2 +- src/resources/beta/beta.ts | 2 +- src/resources/beta/chat/chat.ts | 2 +- src/resources/beta/chat/completions.ts | 2 +- src/resources/beta/chat/index.ts | 2 +- src/resources/beta/index.ts | 2 +- src/resources/beta/threads/index.ts | 2 +- src/resources/beta/threads/messages/files.ts | 2 +- src/resources/beta/threads/messages/index.ts | 2 +- src/resources/beta/threads/messages/messages.ts | 2 +- src/resources/beta/threads/runs/index.ts | 2 +- src/resources/beta/threads/runs/runs.ts | 2 +- src/resources/beta/threads/runs/steps.ts | 2 +- src/resources/beta/threads/threads.ts | 2 +- src/resources/chat/chat.ts | 2 +- src/resources/chat/completions.ts | 2 +- src/resources/chat/index.ts | 2 +- src/resources/completions.ts | 2 +- src/resources/embeddings.ts | 2 +- src/resources/files.ts | 2 +- src/resources/fine-tuning/fine-tuning.ts | 2 +- src/resources/fine-tuning/index.ts | 2 +- src/resources/fine-tuning/jobs.ts | 2 +- src/resources/images.ts | 2 +- src/resources/index.ts | 2 +- src/resources/models.ts | 2 +- src/resources/moderations.ts | 2 +- src/resources/shared.ts | 2 +- tests/api-resources/audio/speech.test.ts | 2 +- tests/api-resources/audio/transcriptions.test.ts | 2 +- tests/api-resources/audio/translations.test.ts | 2 +- tests/api-resources/beta/assistants/assistants.test.ts | 2 +- tests/api-resources/beta/assistants/files.test.ts | 2 +- tests/api-resources/beta/threads/messages/files.test.ts | 2 +- tests/api-resources/beta/threads/messages/messages.test.ts | 2 +- tests/api-resources/beta/threads/runs/runs.test.ts | 2 +- tests/api-resources/beta/threads/runs/steps.test.ts | 2 +- tests/api-resources/beta/threads/threads.test.ts | 2 +- tests/api-resources/chat/completions.test.ts | 2 +- tests/api-resources/completions.test.ts | 2 +- tests/api-resources/embeddings.test.ts | 2 +- tests/api-resources/files.test.ts | 2 +- tests/api-resources/fine-tuning/jobs.test.ts | 2 +- tests/api-resources/images.test.ts | 2 +- tests/api-resources/models.test.ts | 2 +- tests/api-resources/moderations.test.ts | 2 +- tests/index.test.ts | 2 +- 58 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/error.ts b/src/error.ts index fd7477ad2..deac34c5d 100644 --- a/src/error.ts +++ b/src/error.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { castToError, Headers } from './core'; diff --git a/src/index.ts b/src/index.ts index 7b3033fa9..9a2b2eaad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from './core'; import * as Errors from './error'; diff --git a/src/pagination.ts b/src/pagination.ts index 5d890a140..63644e333 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core'; diff --git a/src/resource.ts b/src/resource.ts index 0bf87cf33..87847c879 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import type { OpenAI } from './index'; diff --git a/src/resources/audio/audio.ts b/src/resources/audio/audio.ts index 960577b0d..f3fcba4c3 100644 --- a/src/resources/audio/audio.ts +++ b/src/resources/audio/audio.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'openai/resource'; import * as SpeechAPI from 'openai/resources/audio/speech'; diff --git a/src/resources/audio/index.ts b/src/resources/audio/index.ts index 17c81d3bb..31732a267 100644 --- a/src/resources/audio/index.ts +++ b/src/resources/audio/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Audio } from './audio'; export { SpeechCreateParams, Speech } from './speech'; diff --git a/src/resources/audio/speech.ts b/src/resources/audio/speech.ts index 7d0ee2195..4b83bae3e 100644 --- a/src/resources/audio/speech.ts +++ b/src/resources/audio/speech.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/audio/transcriptions.ts b/src/resources/audio/transcriptions.ts index ab2079ed6..f01e8556d 100644 --- a/src/resources/audio/transcriptions.ts +++ b/src/resources/audio/transcriptions.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/audio/translations.ts b/src/resources/audio/translations.ts index e68a714fb..234933236 100644 --- a/src/resources/audio/translations.ts +++ b/src/resources/audio/translations.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/assistants/assistants.ts b/src/resources/beta/assistants/assistants.ts index b4e92fd92..1e8ca6ee9 100644 --- a/src/resources/beta/assistants/assistants.ts +++ b/src/resources/beta/assistants/assistants.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/assistants/files.ts b/src/resources/beta/assistants/files.ts index 7de700e50..51fd0c0d8 100644 --- a/src/resources/beta/assistants/files.ts +++ b/src/resources/beta/assistants/files.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/assistants/index.ts b/src/resources/beta/assistants/index.ts index 0ae8c9c67..c191d338b 100644 --- a/src/resources/beta/assistants/index.ts +++ b/src/resources/beta/assistants/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Assistant, diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index 74056ed1d..43ee8c7e7 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'openai/resource'; import * as AssistantsAPI from 'openai/resources/beta/assistants/assistants'; diff --git a/src/resources/beta/chat/chat.ts b/src/resources/beta/chat/chat.ts index a9cadc681..2b4a7a404 100644 --- a/src/resources/beta/chat/chat.ts +++ b/src/resources/beta/chat/chat.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'openai/resource'; import * as CompletionsAPI from 'openai/resources/beta/chat/completions'; diff --git a/src/resources/beta/chat/completions.ts b/src/resources/beta/chat/completions.ts index e7f89f5cf..95fd0ac79 100644 --- a/src/resources/beta/chat/completions.ts +++ b/src/resources/beta/chat/completions.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/chat/index.ts b/src/resources/beta/chat/index.ts index 8d0ee40ae..23b1b8ff3 100644 --- a/src/resources/beta/chat/index.ts +++ b/src/resources/beta/chat/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Chat } from './chat'; export { Completions } from './completions'; diff --git a/src/resources/beta/index.ts b/src/resources/beta/index.ts index d8770c29a..7f35730fb 100644 --- a/src/resources/beta/index.ts +++ b/src/resources/beta/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Assistant, diff --git a/src/resources/beta/threads/index.ts b/src/resources/beta/threads/index.ts index 3585be846..097a52819 100644 --- a/src/resources/beta/threads/index.ts +++ b/src/resources/beta/threads/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Annotation, diff --git a/src/resources/beta/threads/messages/files.ts b/src/resources/beta/threads/messages/files.ts index 72c01bb97..994b09d5f 100644 --- a/src/resources/beta/threads/messages/files.ts +++ b/src/resources/beta/threads/messages/files.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/threads/messages/index.ts b/src/resources/beta/threads/messages/index.ts index f68edbbd4..ef446d012 100644 --- a/src/resources/beta/threads/messages/index.ts +++ b/src/resources/beta/threads/messages/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Annotation, diff --git a/src/resources/beta/threads/messages/messages.ts b/src/resources/beta/threads/messages/messages.ts index b38a4bbf0..a2f2aaf1c 100644 --- a/src/resources/beta/threads/messages/messages.ts +++ b/src/resources/beta/threads/messages/messages.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/threads/runs/index.ts b/src/resources/beta/threads/runs/index.ts index 7fa34637a..636b5d850 100644 --- a/src/resources/beta/threads/runs/index.ts +++ b/src/resources/beta/threads/runs/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { CodeInterpreterLogs, diff --git a/src/resources/beta/threads/runs/runs.ts b/src/resources/beta/threads/runs/runs.ts index 8fe09ecc6..a28dd9ae9 100644 --- a/src/resources/beta/threads/runs/runs.ts +++ b/src/resources/beta/threads/runs/runs.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIPromise } from 'openai/core'; diff --git a/src/resources/beta/threads/runs/steps.ts b/src/resources/beta/threads/runs/steps.ts index 4218e9769..f0816fdb2 100644 --- a/src/resources/beta/threads/runs/steps.ts +++ b/src/resources/beta/threads/runs/steps.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/beta/threads/threads.ts b/src/resources/beta/threads/threads.ts index cbde41f89..266f6709e 100644 --- a/src/resources/beta/threads/threads.ts +++ b/src/resources/beta/threads/threads.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIPromise } from 'openai/core'; diff --git a/src/resources/chat/chat.ts b/src/resources/chat/chat.ts index 07c7700dc..6c7bccb22 100644 --- a/src/resources/chat/chat.ts +++ b/src/resources/chat/chat.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'openai/resource'; import * as CompletionsAPI from 'openai/resources/chat/completions'; diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index 41216a8e3..8119639f2 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIPromise } from 'openai/core'; diff --git a/src/resources/chat/index.ts b/src/resources/chat/index.ts index b8b69e453..78a7516ed 100644 --- a/src/resources/chat/index.ts +++ b/src/resources/chat/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Chat } from './chat'; export { diff --git a/src/resources/completions.ts b/src/resources/completions.ts index 83ecb3e99..b64c3a166 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIPromise } from 'openai/core'; diff --git a/src/resources/embeddings.ts b/src/resources/embeddings.ts index 3f59d2a7c..208ceb240 100644 --- a/src/resources/embeddings.ts +++ b/src/resources/embeddings.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/files.ts b/src/resources/files.ts index cda487a63..820c7a1fa 100644 --- a/src/resources/files.ts +++ b/src/resources/files.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/fine-tuning/fine-tuning.ts b/src/resources/fine-tuning/fine-tuning.ts index 5d2d27ac3..e62f8f09c 100644 --- a/src/resources/fine-tuning/fine-tuning.ts +++ b/src/resources/fine-tuning/fine-tuning.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'openai/resource'; import * as JobsAPI from 'openai/resources/fine-tuning/jobs'; diff --git a/src/resources/fine-tuning/index.ts b/src/resources/fine-tuning/index.ts index c2cac49ac..2885f62f4 100644 --- a/src/resources/fine-tuning/index.ts +++ b/src/resources/fine-tuning/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { FineTuning } from './fine-tuning'; export { diff --git a/src/resources/fine-tuning/jobs.ts b/src/resources/fine-tuning/jobs.ts index 7bc216d7c..eb77405ca 100644 --- a/src/resources/fine-tuning/jobs.ts +++ b/src/resources/fine-tuning/jobs.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/images.ts b/src/resources/images.ts index bc5b9edc0..95f0b6ff2 100644 --- a/src/resources/images.ts +++ b/src/resources/images.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/index.ts b/src/resources/index.ts index 16ce85123..a9741f5fd 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export * from './chat/index'; export * from './shared'; diff --git a/src/resources/models.ts b/src/resources/models.ts index 6c6c3379c..4d5bc57e9 100644 --- a/src/resources/models.ts +++ b/src/resources/models.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/moderations.ts b/src/resources/moderations.ts index a43006ccf..b9b9d7fc6 100644 --- a/src/resources/moderations.ts +++ b/src/resources/moderations.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'openai/core'; import { APIResource } from 'openai/resource'; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index a6b2c11bd..93fa05fa4 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export interface ErrorObject { code: string | null; diff --git a/tests/api-resources/audio/speech.test.ts b/tests/api-resources/audio/speech.test.ts index b0cf1a71c..18302ce9a 100644 --- a/tests/api-resources/audio/speech.test.ts +++ b/tests/api-resources/audio/speech.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; diff --git a/tests/api-resources/audio/transcriptions.test.ts b/tests/api-resources/audio/transcriptions.test.ts index 33652af53..3fc4ca22b 100644 --- a/tests/api-resources/audio/transcriptions.test.ts +++ b/tests/api-resources/audio/transcriptions.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI, { toFile } from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/audio/translations.test.ts b/tests/api-resources/audio/translations.test.ts index 723625f6e..0853bedfb 100644 --- a/tests/api-resources/audio/translations.test.ts +++ b/tests/api-resources/audio/translations.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI, { toFile } from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/assistants/assistants.test.ts b/tests/api-resources/beta/assistants/assistants.test.ts index 60ca0a6e2..b11075d06 100644 --- a/tests/api-resources/beta/assistants/assistants.test.ts +++ b/tests/api-resources/beta/assistants/assistants.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/assistants/files.test.ts b/tests/api-resources/beta/assistants/files.test.ts index 8db328442..e285b4664 100644 --- a/tests/api-resources/beta/assistants/files.test.ts +++ b/tests/api-resources/beta/assistants/files.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/threads/messages/files.test.ts b/tests/api-resources/beta/threads/messages/files.test.ts index b4a00a868..58c8813fe 100644 --- a/tests/api-resources/beta/threads/messages/files.test.ts +++ b/tests/api-resources/beta/threads/messages/files.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/threads/messages/messages.test.ts b/tests/api-resources/beta/threads/messages/messages.test.ts index 35538efb9..3a80bfe1e 100644 --- a/tests/api-resources/beta/threads/messages/messages.test.ts +++ b/tests/api-resources/beta/threads/messages/messages.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/threads/runs/runs.test.ts b/tests/api-resources/beta/threads/runs/runs.test.ts index 45f17040a..5e1b363fd 100644 --- a/tests/api-resources/beta/threads/runs/runs.test.ts +++ b/tests/api-resources/beta/threads/runs/runs.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/threads/runs/steps.test.ts b/tests/api-resources/beta/threads/runs/steps.test.ts index 76eec269a..76495a1a3 100644 --- a/tests/api-resources/beta/threads/runs/steps.test.ts +++ b/tests/api-resources/beta/threads/runs/steps.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/beta/threads/threads.test.ts b/tests/api-resources/beta/threads/threads.test.ts index 9243dc11c..24cb815a7 100644 --- a/tests/api-resources/beta/threads/threads.test.ts +++ b/tests/api-resources/beta/threads/threads.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 49f3562b0..e0ccb3910 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/completions.test.ts b/tests/api-resources/completions.test.ts index 85fc68498..2641bf7e3 100644 --- a/tests/api-resources/completions.test.ts +++ b/tests/api-resources/completions.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/embeddings.test.ts b/tests/api-resources/embeddings.test.ts index bcb5ffbba..d4e1f3240 100644 --- a/tests/api-resources/embeddings.test.ts +++ b/tests/api-resources/embeddings.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/files.test.ts b/tests/api-resources/files.test.ts index 9e6373aba..514f42e3a 100644 --- a/tests/api-resources/files.test.ts +++ b/tests/api-resources/files.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI, { toFile } from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/fine-tuning/jobs.test.ts b/tests/api-resources/fine-tuning/jobs.test.ts index 22f457303..d8f230abd 100644 --- a/tests/api-resources/fine-tuning/jobs.test.ts +++ b/tests/api-resources/fine-tuning/jobs.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/images.test.ts b/tests/api-resources/images.test.ts index 418a55eb0..33d633a63 100644 --- a/tests/api-resources/images.test.ts +++ b/tests/api-resources/images.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI, { toFile } from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/models.test.ts b/tests/api-resources/models.test.ts index 91eb0d055..ca1f98365 100644 --- a/tests/api-resources/models.test.ts +++ b/tests/api-resources/models.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/moderations.test.ts b/tests/api-resources/moderations.test.ts index ad315df5d..ef7298fa9 100644 --- a/tests/api-resources/moderations.test.ts +++ b/tests/api-resources/moderations.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { Response } from 'node-fetch'; diff --git a/tests/index.test.ts b/tests/index.test.ts index 3fb42a80a..cd5f2a0a9 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import OpenAI from 'openai'; import { APIUserAbortError } from 'openai'; From 6a2c41b0ce833eba0cdea6a7d221697f3be26abb Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:13:42 -0400 Subject: [PATCH 3/4] docs: assistant improvements (#725) --- README.md | 31 +++++++++++++++++++++++++++++++ helpers.md | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 68d337e81..1eca06c85 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,37 @@ Documentation for each method, request param, and response field are available i > [!IMPORTANT] > Previous versions of this SDK used a `Configuration` class. See the [v3 to v4 migration guide](https://github.com/openai/openai-node/discussions/217). +### Streaming Helpers + +The SDK also includes helpers to process streams and handle the incoming events. + +```ts +const run = openai.beta.threads.runs + .createAndStream(thread.id, { + assistant_id: assistant.id, + }) + .on('textCreated', (text) => process.stdout.write('\nassistant > ')) + .on('textDelta', (textDelta, snapshot) => process.stdout.write(textDelta.value)) + .on('toolCallCreated', (toolCall) => process.stdout.write(`\nassistant > ${toolCall.type}\n\n`)) + .on('toolCallDelta', (toolCallDelta, snapshot) => { + if (toolCallDelta.type === 'code_interpreter') { + if (toolCallDelta.code_interpreter.input) { + process.stdout.write(toolCallDelta.code_interpreter.input); + } + if (toolCallDelta.code_interpreter.outputs) { + process.stdout.write('\noutput >\n'); + toolCallDelta.code_interpreter.outputs.forEach((output) => { + if (output.type === 'logs') { + process.stdout.write(`\n${output.logs}\n`); + } + }); + } + } + }); +``` + +More information on streaming helpers can be found in the dedicated documentation: [helpers.md](helpers.md) + ### Streaming responses This library provides several conveniences for streaming chat completions, for example: diff --git a/helpers.md b/helpers.md index 9f01a126a..9a94a618e 100644 --- a/helpers.md +++ b/helpers.md @@ -36,6 +36,29 @@ const run = openai.beta.threads.runs }); ``` +### Starting a stream + +There are three helper methods for creating streams: + +```ts +openai.beta.threads.runs.createAndStream(); +``` + +This method can be used to start and stream the response to an existing run with an associated thread +that is already populated with messages. + +```ts +openai.beta.threads.createAndRunStream(); +``` + +This method can be used to add a message to a thread, start a run and then stream the response. + +```ts +openai.beta.threads.runs.submitToolOutputsStream(); +``` + +This method can be used to submit a tool output to a run waiting on the output and start a stream. + ### Assistant Events The assistant API provides events you can subscribe to for the following events. @@ -108,25 +131,25 @@ The last event send when a stream ends. The assistant streaming object also provides a few methods for convenience: ```ts -.currentEvent() +.currentEvent(): AssistantStreamEvent | undefined -.currentRun() +.currentRun(): Run | undefined -.currentMessageSnapshot() +.currentMessageSnapshot(): Message -.currentRunStepSnapshot() +.currentRunStepSnapshot(): Runs.RunStep ``` These methods are provided to allow you to access additional context from within event handlers. In many cases the handlers should include all the information you need for processing, but if additional context is required it can be accessed. -Note: There is not always a relevant context in certain situations (these will be undefined in those cases). +Note: There is not always a relevant context in certain situations (these will be `undefined` in those cases). ```ts -await.finalMessages(); +await .finalMessages() : Promise -await.finalRunSteps(); +await .finalRunSteps(): Promise ``` These methods are provided for convenience to collect information at the end of a stream. Calling these events From dda3f6890cf6a6b8f885a6470240b3036eab3b09 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:14:03 -0400 Subject: [PATCH 4/4] release: 4.29.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ README.md | 2 +- build-deno | 2 +- package.json | 2 +- src/version.ts | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ded4849c4..fc4efb3a0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.29.1" + ".": "4.29.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 741a701b3..497a341af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 4.29.2 (2024-03-19) + +Full Changelog: [v4.29.1...v4.29.2](https://github.com/openai/openai-node/compare/v4.29.1...v4.29.2) + +### Chores + +* **internal:** update generated pragma comment ([#724](https://github.com/openai/openai-node/issues/724)) ([139e205](https://github.com/openai/openai-node/commit/139e205ed1ed30cb1df982d852a093dcea945aba)) + + +### Documentation + +* assistant improvements ([#725](https://github.com/openai/openai-node/issues/725)) ([6a2c41b](https://github.com/openai/openai-node/commit/6a2c41b0ce833eba0cdea6a7d221697f3be26abb)) +* fix typo in CONTRIBUTING.md ([#722](https://github.com/openai/openai-node/issues/722)) ([05ff8f7](https://github.com/openai/openai-node/commit/05ff8f7671fe6ce5d9517034f76a166a0bd27803)) + ## 4.29.1 (2024-03-15) Full Changelog: [v4.29.0...v4.29.1](https://github.com/openai/openai-node/compare/v4.29.0...v4.29.1) diff --git a/README.md b/README.md index 1eca06c85..9699fca42 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ You can import in Deno via: ```ts -import OpenAI from 'https://deno.land/x/openai@v4.29.1/mod.ts'; +import OpenAI from 'https://deno.land/x/openai@v4.29.2/mod.ts'; ``` diff --git a/build-deno b/build-deno index c08e26dbc..25569475f 100755 --- a/build-deno +++ b/build-deno @@ -14,7 +14,7 @@ This is a build produced from https://github.com/openai/openai-node – please g Usage: \`\`\`ts -import OpenAI from "https://deno.land/x/openai@v4.29.1/mod.ts"; +import OpenAI from "https://deno.land/x/openai@v4.29.2/mod.ts"; const client = new OpenAI(); \`\`\` diff --git a/package.json b/package.json index 8a6398765..25994c236 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "4.29.1", + "version": "4.29.2", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 8acef11c3..a9177ff54 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.29.1'; // x-release-please-version +export const VERSION = '4.29.2'; // x-release-please-version