diff --git a/apps/web/tests/document-content.test.ts b/apps/web/tests/document-content.test.ts index 1a58c4b..ba761d3 100644 --- a/apps/web/tests/document-content.test.ts +++ b/apps/web/tests/document-content.test.ts @@ -1,7 +1,8 @@ import assert from "node:assert/strict"; -import { readFile } from "node:fs/promises"; +import { readFile, readdir } from "node:fs/promises"; import { resolve } from "node:path"; import test from "node:test"; +import { fileURLToPath } from "node:url"; import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; @@ -18,6 +19,34 @@ import { syncReleases, } from "../lib/documents.js"; +interface SourceManifest { + pages: Record< + string, + { sourceUrl: string; status: "active" | "removed" } + >; +} + +interface TranslationManifest { + pages: Record; +} + +interface SyncReleaseEntry { + path: string; + route: string; + sourceUrl: string; + title: string; +} + +interface SyncReleaseRecord { + added: SyncReleaseEntry[]; + generatedAt: string; + id: string; + modified: SyncReleaseEntry[]; + removed: SyncReleaseEntry[]; +} + +const repositoryRoot = fileURLToPath(new URL("../../..", import.meta.url)); + test("removes the official llms.txt and Markdown boilerplate notice", () => { const markdown = [ "# GPT Actions 库", @@ -41,9 +70,13 @@ test("keeps unrelated blockquotes", () => { }); test("exposes source pull and translation timestamps for localized pages", () => { + const localizedDocument = generatedDocuments.find( + (document) => document.locale === "zh", + ); + assert.ok(localizedDocument); const document = documentMetadataForRoute( "zh", - "/api/docs/actions/actions-library", + localizedDocument.route, ); assert.ok(document?.sourceUpdatedAt); @@ -52,12 +85,41 @@ test("exposes source pull and translation timestamps for localized pages", () => assert.ok(Number.isFinite(Date.parse(document.translatedAt))); }); -test("never derives Chinese page metadata descriptions from article body text", () => { +test("never derives Chinese page metadata descriptions from article body text", async () => { const localizedDocuments = generatedDocuments.filter( (document) => document.locale === "zh", ); + const [sourceManifest, translationManifest] = await Promise.all([ + readFile(resolve(repositoryRoot, "docs/en/.source-manifest.json"), "utf8").then( + (value) => JSON.parse(value) as SourceManifest, + ), + readFile( + resolve(repositoryRoot, "docs/zh/.translation-manifest.json"), + "utf8", + ).then((value) => JSON.parse(value) as TranslationManifest), + ]); + const expectedLocalizedPageCount = Object.values( + translationManifest.pages, + ).filter((page) => sourceManifest.pages[page.sourceUrl]?.status === "active") + .length; + for (const [sourceUrl, page] of Object.entries(sourceManifest.pages)) { + assert.equal(page.sourceUrl, sourceUrl); + } + for (const [sourceUrl, page] of Object.entries(translationManifest.pages)) { + assert.equal(page.sourceUrl, sourceUrl); + } + const expectedSourceUrls = Object.values(translationManifest.pages) + .filter((page) => sourceManifest.pages[page.sourceUrl]?.status === "active") + .map((page) => page.sourceUrl) + .sort(); + const actualSourceUrls = localizedDocuments + .map((document) => document.sourceUrl) + .sort(); - assert.ok(localizedDocuments.length > 400); + assert.ok(expectedLocalizedPageCount > 0); + assert.equal(localizedDocuments.length, expectedLocalizedPageCount); + assert.equal(new Set(actualSourceUrls).size, actualSourceUrls.length); + assert.deepEqual(actualSourceUrls, expectedSourceUrls); for (const document of localizedDocuments) { assert.equal( document.description, @@ -68,9 +130,13 @@ test("never derives Chinese page metadata descriptions from article body text", }); test("renders every document header in title, timestamps, source notice, body order", async () => { + const localizedDocument = generatedDocuments + .filter((document) => document.locale === "zh") + .sort((left, right) => left.sourceUrl.localeCompare(right.sourceUrl))[0]; + assert.ok(localizedDocument); const document = await loadDocumentForRoute( "zh", - "/api/docs/actions/getting-started", + localizedDocument.route, ); assert.ok(document); @@ -84,14 +150,15 @@ test("renders every document header in title, timestamps, source notice, body or assert.ok(titleIndex < timestampsIndex); assert.ok(timestampsIndex < sourceNoticeIndex); assert.ok(sourceNoticeIndex < bodyIndex); - const firstBodyParagraph = /

([\s\S]*?)<\/p>/u - .exec(html.slice(bodyIndex))?.[1] - ?.replace(/<[^>]+>/gu, "") - .trim(); - assert.ok(firstBodyParagraph); - assert.ok(firstBodyParagraph.length >= 20); + const representativeBodyParagraph = [ + ...html.slice(bodyIndex).matchAll(/

([\s\S]*?)<\/p>/gu), + ] + .map((match) => (match[1] ?? "").replace(/<[^>]+>/gu, "").trim()) + .filter((paragraph) => paragraph.length > 0) + .sort((left, right) => right.length - left.length)[0]; + assert.ok(representativeBodyParagraph); assert.equal( - html.slice(0, bodyIndex).includes(firstBodyParagraph), + html.slice(0, bodyIndex).includes(representativeBodyParagraph), false, "article body must not be duplicated into the document header", ); @@ -112,19 +179,73 @@ test("keeps external document bundles out of the ordinary article sidebar", () = } }); -test("ships update batches with article-level change details", () => { +test("ships update batches with article-level change details", async () => { const release = syncReleases()[0]; + const updateDirectory = resolve(repositoryRoot, "docs/updates"); + const sourceReleases = await Promise.all( + (await readdir(updateDirectory)) + .filter((fileName) => fileName.endsWith(".json")) + .map((fileName) => + readFile(resolve(updateDirectory, fileName), "utf8").then( + (value) => { + const sourceRelease = JSON.parse(value) as SyncReleaseRecord; + const timestamp = Date.parse(sourceRelease.generatedAt); + assert.ok(Number.isFinite(timestamp)); + const expectedId = new Date(timestamp) + .toISOString() + .replace(/[.:]/gu, "-"); + assert.equal(sourceRelease.id, expectedId); + assert.equal(fileName, `${expectedId}.json`); + return { release: sourceRelease, timestamp }; + }, + ), + ), + ); + assert.equal( + new Set(sourceReleases.map(({ release: item }) => item.id)).size, + sourceReleases.length, + ); + assert.equal( + new Set(sourceReleases.map(({ timestamp }) => timestamp)).size, + sourceReleases.length, + ); + const expectedRelease = sourceReleases.reduce< + { release: SyncReleaseRecord; timestamp: number } | undefined + >( + (latest, candidate) => + !latest || candidate.timestamp > latest.timestamp ? candidate : latest, + undefined, + )?.release; + assert.ok(release); - assert.equal(release.added.length, 1); - assert.equal(release.modified.length, 56); - assert.equal(release.removed.length, 0); - assert.equal(release.added[0]?.title, "Mutual TLS"); + assert.ok(expectedRelease); + assert.deepEqual(release, expectedRelease); + + const entries = [...release.added, ...release.modified, ...release.removed]; + assert.ok(entries.length > 0); + assert.equal(new Set(entries.map((entry) => entry.path)).size, entries.length); + assert.equal(new Set(entries.map((entry) => entry.route)).size, entries.length); + assert.equal(new Set(entries.map((entry) => entry.sourceUrl)).size, entries.length); + for (const entry of entries) { + assert.match(entry.path, /^docs\/en\/api\/(?:docs|reference)\/.+\.md$/u); + const source = new URL(entry.sourceUrl); + assert.equal(source.origin, "https://developers.openai.com"); + assert.equal(source.search, ""); + assert.equal(source.hash, ""); + assert.equal(entry.sourceUrl, `${source.origin}${source.pathname}`); + assert.equal(entry.path, `docs/en${source.pathname}`); + assert.equal(entry.route, source.pathname.replace(/\.md$/u, "")); + assert.ok(entry.title.trim()); + } }); test("keeps the requested contact image and analytics identifiers", async () => { const [contact, layout] = await Promise.all([ - readFile(resolve("components/contact-popover.tsx"), "utf8"), - readFile(resolve("app/layout.tsx"), "utf8"), + readFile( + resolve(repositoryRoot, "apps/web/components/contact-popover.tsx"), + "utf8", + ), + readFile(resolve(repositoryRoot, "apps/web/app/layout.tsx"), "utf8"), ]); assert.match( diff --git a/apps/web/tests/links.test.ts b/apps/web/tests/links.test.ts index e67413b..b9a2e11 100644 --- a/apps/web/tests/links.test.ts +++ b/apps/web/tests/links.test.ts @@ -2,6 +2,7 @@ import assert from "node:assert/strict"; import { readFile } from "node:fs/promises"; import { resolve } from "node:path"; import { describe, it } from "node:test"; +import { fileURLToPath } from "node:url"; import { generatedDocuments, @@ -23,6 +24,7 @@ import { rewriteDocumentLink } from "../lib/links.js"; const SOURCE = "https://developers.openai.com/api/docs/guides/agents/quickstart.md"; +const repositoryRoot = fileURLToPath(new URL("../../..", import.meta.url)); describe("document link rewriting", () => { it("rewrites absolute official Markdown links to the current local language", () => { @@ -74,17 +76,66 @@ describe("document link rewriting", () => { }); it("ships all English sources while retaining translated Chinese pages", async () => { - assert.equal( - generatedDocuments.filter((document) => document.locale === "en").length, - sourcePageCount, + const [sourceManifest, translationManifest] = await Promise.all([ + readFile(resolve(repositoryRoot, "docs/en/.source-manifest.json"), "utf8").then( + (value) => JSON.parse(value) as { + pages: Record< + string, + { sourceUrl: string; status: "active" | "removed" } + >; + }, + ), + readFile( + resolve(repositoryRoot, "docs/zh/.translation-manifest.json"), + "utf8", + ).then((value) => JSON.parse(value) as { + pages: Record; + }), + ]); + for (const [sourceUrl, page] of Object.entries(sourceManifest.pages)) { + assert.equal(page.sourceUrl, sourceUrl); + } + for (const [sourceUrl, page] of Object.entries(translationManifest.pages)) { + assert.equal(page.sourceUrl, sourceUrl); + } + const activeSourceUrls = new Set( + Object.values(sourceManifest.pages) + .filter((page) => page.status === "active") + .map((page) => page.sourceUrl), + ); + const activeTranslationSourceUrls = Object.values(translationManifest.pages) + .filter((page) => activeSourceUrls.has(page.sourceUrl)) + .map((page) => page.sourceUrl) + .sort(); + const generatedEnglishSourceUrls = generatedDocuments + .filter((document) => document.locale === "en") + .map((document) => document.sourceUrl) + .sort(); + const generatedChineseSourceUrls = generatedDocuments + .filter((document) => document.locale === "zh") + .map((document) => document.sourceUrl) + .sort(); + + assert.ok(activeSourceUrls.size > 0); + assert.ok(activeTranslationSourceUrls.length > 0); + assert.equal(new Set(generatedEnglishSourceUrls).size, generatedEnglishSourceUrls.length); + assert.equal(new Set(generatedChineseSourceUrls).size, generatedChineseSourceUrls.length); + assert.deepEqual(generatedEnglishSourceUrls, [...activeSourceUrls].sort()); + assert.deepEqual(generatedChineseSourceUrls, activeTranslationSourceUrls); + assert.equal(sourcePageCount, activeSourceUrls.size); + assert.equal(bilingualPageCount, activeTranslationSourceUrls.length); + + const representativeSourceUrl = activeTranslationSourceUrls[0]; + assert.ok(representativeSourceUrl); + const representativeRoute = new URL(representativeSourceUrl).pathname.replace( + /\.md$/u, + "", ); - assert.ok(bilingualPageCount >= 3); - assert.ok(sourcePageCount >= 400); - assert.ok(documentMetadataForRoute("zh", "/api/docs/models")); - assert.ok(documentMetadataForRoute("en", "/api/docs/guides/tools")); - const loaded = await loadDocumentForRoute("en", "/api/docs/guides/tools"); + assert.ok(documentMetadataForRoute("zh", representativeRoute)); + assert.ok(documentMetadataForRoute("en", representativeRoute)); + const loaded = await loadDocumentForRoute("en", representativeRoute); assert.match(loaded?.markdown ?? "", /^#/u); - assert.ok(catalogDocumentForRoute("/api/docs/guides/tools")); + assert.ok(catalogDocumentForRoute(representativeRoute)); }); it("preserves the complete official grouping and order", () => { @@ -103,7 +154,6 @@ describe("document link rewriting", () => { }); it("derives homepage timestamps and schedule from repository facts", async () => { - const repositoryRoot = resolve(process.cwd(), "../.."); const [sourceManifest, translationManifest, workflow] = await Promise.all([ readFile(resolve(repositoryRoot, "docs/en/.source-manifest.json"), "utf8").then(JSON.parse), readFile(resolve(repositoryRoot, "docs/zh/.translation-manifest.json"), "utf8").then(JSON.parse), @@ -153,7 +203,7 @@ describe("document link rewriting", () => { it("leaves Vercel output detection to the Next.js preset", async () => { const vercelConfig = JSON.parse( - await readFile(resolve(process.cwd(), "vercel.json"), "utf8"), + await readFile(resolve(repositoryRoot, "apps/web/vercel.json"), "utf8"), ) as Record; assert.equal(vercelConfig.framework, "nextjs"); assert.equal(vercelConfig.buildCommand, "pnpm build"); diff --git a/docs/en/.source-manifest.json b/docs/en/.source-manifest.json index 643a205..032bd31 100644 --- a/docs/en/.source-manifest.json +++ b/docs/en/.source-manifest.json @@ -1,22 +1,22 @@ { "indexes": { "guides": { - "bytes": 34432, + "bytes": 33743, "localPath": "docs/en/api/docs/llms.txt", - "sha256": "0aa410a434d8d9aee774604964af30869fe3e9118fdfb7a130496d43f3a5d68a", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "1963134bddf9c962ba9c56e24549cbc7b93c14e67ae88bc4e5b711ffb96409eb", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "sourceUrl": "https://developers.openai.com/api/docs/llms.txt", - "etag": "W/\"a7a8969e05ceb91b37187edcff88902a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:20 GMT" + "etag": "W/\"2aa51de06cc463589d265a6e160614ea\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:43:17 GMT" }, "reference": { - "bytes": 40273, + "bytes": 35224, "localPath": "docs/en/api/reference/llms.txt", - "sha256": "a56ec159922bd35ddcc51a30314ec80d2780e234b1dee86bf79b6b2ba71a27d3", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "8c2a627a44ead3d486eb16f4db1ef3ea41da37c293ce1ca669bb4554d387ebef", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "sourceUrl": "https://developers.openai.com/api/reference/llms.txt", - "etag": "W/\"173ede015d66db2d0ad7f3ebd93ee5a9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:32 GMT" + "etag": "W/\"ccb972a4e2d6e1b29b604a717e50cad0\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:05:08 GMT" } }, "pages": { @@ -32,7 +32,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ed1694b39d6fb172398088549725f6b8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:11 GMT" }, "https://developers.openai.com/api/docs/actions/authentication.md": { "description": "Learn about authentication options for GPT actions, including no authentication, API key, and OAuth methods.", @@ -46,7 +46,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a4d9b2375b6f2205502883b9369e3b29\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:39:49 GMT" }, "https://developers.openai.com/api/docs/actions/data-retrieval.md": { "description": "Learn about performing data retrieval using APIs, relational databases, and vector databases with GPT Actions.", @@ -60,7 +60,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ecd8c9dbb0378c97ab77ad0622d16288\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:09 GMT" }, "https://developers.openai.com/api/docs/actions/getting-started.md": { "description": "Learn how to set up and test GPT actions from scratch with the OpenAI API.", @@ -74,7 +74,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a26b83fa0d1ed063e9552db7f77b5818\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:09 GMT" }, "https://developers.openai.com/api/docs/actions/introduction.md": { "description": "Learn about GPT Actions for customizing ChatGPT and interacting with external applications via APIs.", @@ -88,7 +88,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"aac0dc139f0da94d289e26af2cf4dfd1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:11 GMT" }, "https://developers.openai.com/api/docs/actions/production.md": { "description": "Guidelines for deploying GPT Actions in a production environment, including rate limits, timeouts, and security measures.", @@ -102,7 +102,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"de64ae029ee2cf49bbfd82f9b1f9b941\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:12 GMT" }, "https://developers.openai.com/api/docs/actions/sending-files.md": { "description": "Learn how to send and return files using GPT Actions in the OpenAI API.", @@ -116,7 +116,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"d089b30c2f807e02aac327ad06844ca6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:12 GMT" }, "https://developers.openai.com/api/docs/assistants/deep-dive.md": { "description": "A detailed guide to creating and managing assistants with the Assistants API on the OpenAI platform.", @@ -128,23 +128,24 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "3595bcf3551b6578ca8569b857c4099bed350251a664885803d7061e194c2ad4", "sourceUpdatedAt": "2026-08-24T09:37:37Z", - "status": "active", + "status": "removed", "etag": "W/\"e454ed2ab8d4551b3fe26804a2f33a0a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:49 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/docs/assistants/migration.md": { - "description": "Guidance for migrating from the Assistants API to the Responses API, including side-by-side comparisons and updated patterns.", + "description": "Migrate from the retired Assistants API to the Responses API, with side-by-side comparisons and updated patterns.", "localPath": "docs/en/api/docs/assistants/migration.md", "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/assistants/migration.md", "title": "Assistants migration guide", - "bytes": 14303, + "bytes": 15837, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "0d866515c0d406e6e5a402baad1fe0ad50c10369a5929a47b74e60e487b77775", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "19c12ad46bff4e6f7cabcdf3dc14224a4e95fb4941c5f3f835aef02040e3b4b6", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"604fbc9d2ba37ac1d09e0c04e7ded5f5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "etag": "W/\"81757a2578f5c25bda8bdbb6edaf4f87\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:50:30 GMT" }, "https://developers.openai.com/api/docs/assistants/tools.md": { "description": "Learn about the tools available for OpenAI Assistants, including file search, code interpreter, and function calling.", @@ -156,9 +157,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "6af0d20d95e77ae5fe5ebba561dd6825aef87987e94ada92e0a281b68152889e", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"6f505e28a701306e162613150bee1cb9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/docs/assistants/tools/code-interpreter.md": { "description": "Allow assistants to run Python code with the Code Interpreter tool.", @@ -170,9 +172,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "5675100d4aebb1b32aabb52e440ba23869951e7b0d7505456d7df83699f1c601", "sourceUpdatedAt": "2026-08-24T09:37:37Z", - "status": "active", + "status": "removed", "etag": "W/\"0f3680862007b68cf3ec68417ceaf1da\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/docs/assistants/tools/file-search.md": { "description": "Use File Search as a built-in RAG tool for assistants.", @@ -184,9 +187,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "175831c6e9ef97a3081ce89a2a455187440df7343a99523cd320d6bff078611b", "sourceUpdatedAt": "2026-08-24T09:37:37Z", - "status": "active", + "status": "removed", "etag": "W/\"7bd35bc72c2f4b5066b49f7f06696737\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/docs/assistants/tools/function-calling.md": { "description": "Use function calling to extend assistants with your own tools.", @@ -198,9 +202,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "a40da41963930ca065d7464b3dd5e0b9c8de3859dc685c42fd47910579875a73", "sourceUpdatedAt": "2026-08-24T09:37:37Z", - "status": "active", + "status": "removed", "etag": "W/\"3061f77547aff40fcb92edaefb7d14ef\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/docs/bots.md": { "description": "", @@ -214,7 +219,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"7135ec97066fbf6098abdc496973c2e4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:33 GMT" }, "https://developers.openai.com/api/docs/changelog.md": { "description": "Customer-visible changes to the OpenAI API and models.", @@ -222,13 +227,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/changelog.md", "title": "API changelog", - "bytes": 60941, + "bytes": 60947, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "4c92f24e77e07aaeb6df9f5c9ffe674863082d8c6cfe52c4f9f0ca943ba1ba09", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "073cf2a4d515e7eef0267b37d25e14d42a7e4d7c6adecf9cf83996334f197807", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"8611260b0742f7bab0be9016cc15e30a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:05 GMT" + "etag": "W/\"0316c2da924a372142903d3d286c492b\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:36:28 GMT" }, "https://developers.openai.com/api/docs/concepts.md": { "description": "Key concepts to understand when working with the OpenAI API.", @@ -242,7 +247,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"aba8172ef2730efc6a436054b5c2a90e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:14 GMT" }, "https://developers.openai.com/api/docs/deprecations.md": { "description": "Find information about OpenAI API deprecations and recommended replacements.", @@ -250,13 +255,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/deprecations.md", "title": "Deprecations", - "bytes": 36252, + "bytes": 36222, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "91292bb80f7eb37873c8ee83a02458effc0bf2e770a00ae1567da2faa7e5837a", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "3621f1373634166aab04223355c2a7b55b64f71964da79cf836f0d5e6cb38042", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"657d5bfa655b3260877a0a3bf4a344e1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "etag": "W/\"246018d112af263e6ed78ef5f41ac3e1\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:40:17 GMT" }, "https://developers.openai.com/api/docs/gpts/release-notes.md": { "description": "Keep track of updates to OpenAI GPTs and explore new features and capabilities in the release notes.", @@ -270,7 +275,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"644aa62ec8015e5cb3edf00daae75e13\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:15 GMT" }, "https://developers.openai.com/api/docs/guides/admin-apis.md": { "description": "Use Admin APIs and Admin API keys to automate organization management tasks such as invitations and audit log retrieval.", @@ -284,7 +289,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"01b1749db4863159fc0ef48fd91245be\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:16 GMT" }, "https://developers.openai.com/api/docs/guides/advanced-usage.md": { "description": "Discover advanced usage techniques for OpenAI's API, including reproducible outputs, token management, and parameter settings.", @@ -292,13 +297,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/advanced-usage.md", "title": "Advanced usage", - "bytes": 10814, + "bytes": 11061, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "a696685d4d6359c33739f40e240f54f319c8d08f83fbd73778a705aa31d1313b", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "83ab62ea9f48844a3a2ca9738eb7330733585bebed9bfa367b41590da398f93f", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"cf6186230bbb0c8013a24212451d1f3c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "etag": "W/\"d493ec097edb0f3d60fba0d67798f877\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:54:32 GMT" }, "https://developers.openai.com/api/docs/guides/agent-builder-safety.md": { "description": "Minimize prompt injections and other risks when building agent workflows with OpenAI Agent Builder.", @@ -312,7 +317,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"3861fa90102bf2280557a83e6941185e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:33 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:18 GMT" }, "https://developers.openai.com/api/docs/guides/agent-builder.md": { "description": "Use the OpenAI Agent Builder to start from templates, compose nodes, preview runs, and export workflows to code.", @@ -326,7 +331,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"31a3dae8f85ccfbd6a2be124c6458cc1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:37:31 GMT" }, "https://developers.openai.com/api/docs/guides/agent-builder/migrate-from-agent-builder.md": { "description": "Learn how to export an Agent Builder workflow and continue with ChatGPT Workspace Agents or the Agents SDK.", @@ -340,7 +345,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ce1e2f9dbe6091846fae695ca25cf9e6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:54 GMT" }, "https://developers.openai.com/api/docs/guides/agent-evals.md": { "description": "Learn how to evaluate agent workflows with traces, graders, datasets, and evaluation runs on the OpenAI platform.", @@ -354,7 +359,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c8a77f17374b247f7111edf3488ed8fa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:02:26 GMT" }, "https://developers.openai.com/api/docs/guides/agents.md": { "description": "Learn how the OpenAI Agents SDK fits together and which docs to read next.", @@ -368,7 +373,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"1600da769afb3b87dcf4045dcc9486f9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:49:26 GMT" }, "https://developers.openai.com/api/docs/guides/agents/define-agents.md": { "description": "Learn how to define an agent's instructions, model, tools, and local context in the OpenAI Agents SDK.", @@ -382,7 +387,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9f41f0e68079f62e7fc613ff5f06b343\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:39:32 GMT" }, "https://developers.openai.com/api/docs/guides/agents/guardrails-approvals.md": { "description": "Learn how to use guardrails and human review in the OpenAI Agents SDK for safer, more controlled workflows.", @@ -396,7 +401,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"af854da75d62fce6385f563164e69ea7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:55:27 GMT" }, "https://developers.openai.com/api/docs/guides/agents/integrations-observability.md": { "description": "Learn how to integrate MCP into Agents SDK workflows and how to trace and debug runs.", @@ -410,7 +415,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"40217fc1a75037a37bb53b5af1f0d944\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:55:29 GMT" }, "https://developers.openai.com/api/docs/guides/agents/models.md": { "description": "Learn how to choose models, set defaults, and think about providers and transport in the OpenAI Agents SDK.", @@ -424,7 +429,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c990aa02902a3b4324ab3df2cfe6ef54\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:55:31 GMT" }, "https://developers.openai.com/api/docs/guides/agents/orchestration.md": { "description": "Learn how to orchestrate multiple agents with handoffs and agents-as-tools in the OpenAI Agents SDK.", @@ -438,7 +443,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"abd4d675226ec5bfcc823b17fe33e3db\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:50 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:12 GMT" }, "https://developers.openai.com/api/docs/guides/agents/quickstart.md": { "description": "Build your first agent with the OpenAI Agents SDK, add tools and handoffs, and understand where to go next.", @@ -452,7 +457,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"e1f6d1d7821b4034e6efe17a9d471f6b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:06 GMT" }, "https://developers.openai.com/api/docs/guides/agents/results.md": { "description": "Learn which result surfaces matter most in the OpenAI Agents SDK and how they connect to resumable workflow state.", @@ -466,7 +471,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"16b7a9c58fdb94a0647b4dca9a4321d4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:55:12 GMT" }, "https://developers.openai.com/api/docs/guides/agents/running-agents.md": { "description": "Learn how to run agents, stream output, and choose the right conversation-state strategy in the OpenAI Agents SDK.", @@ -480,7 +485,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"08a8c10c5c9f4429b06f083fc6c54fab\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:55:09 GMT" }, "https://developers.openai.com/api/docs/guides/agents/sandboxes.md": { "description": "Learn how sandboxes fit into Agents SDK workflows, when to use them, and how orchestration stays separate from execution.", @@ -494,7 +499,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"89f7c77caebd3b3c226cae262bccc2fa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:18 GMT" }, "https://developers.openai.com/api/docs/guides/amazon-bedrock.md": { "description": "Learn how Amazon Bedrock availability differs from the OpenAI API, including supported capabilities, AWS-managed controls, and pricing considerations.", @@ -508,7 +513,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"b30af8a9375274a29fd348f6b77cb121\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:00 GMT" }, "https://developers.openai.com/api/docs/guides/audio.md": { "description": "Learn core audio and speech concepts for building with the OpenAI API.", @@ -522,7 +527,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"f868a873003d5a17b186611cf8693989\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:21 GMT" }, "https://developers.openai.com/api/docs/guides/background.md": { "description": "Run long running tasks asynchronously in the background.", @@ -530,13 +535,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/background.md", "title": "Background mode", - "bytes": 15628, + "bytes": 19790, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "8e92a07ac95cbd20c8306bbe762fa314c202bf18ef59a51f43a029bb4529a9dd", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "85c1ac845ec392362fe3a57b367331190bac520c5dd3083aca59ba1b32d2e245", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"b157cade0ce4c48d4b5ffbe534893a8b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"e8543a524ce8e191f6c240f3f865ffb5\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:57:34 GMT" }, "https://developers.openai.com/api/docs/guides/batch.md": { "description": "Learn how to use OpenAI's Batch API for processing jobs with asynchronous requests, increased rate limits, and cost efficiency.", @@ -550,7 +555,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"a5ddfa36f85b9af966e0f18d9b553f2e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:56:20 GMT" }, "https://developers.openai.com/api/docs/guides/chatkit-actions.md": { "description": "Embed a widget to build your own chat experiences.", @@ -564,7 +569,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"023d7230b40abb818661bee0cd62f312\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:15 GMT" }, "https://developers.openai.com/api/docs/guides/chatkit-themes.md": { "description": "Configure colors, typography, density, and component variants in your ChatKit implementation.", @@ -578,7 +583,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c790b0b8613d0c3e3aad105eac0a62d4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:00:21 GMT" }, "https://developers.openai.com/api/docs/guides/chatkit-widgets.md": { "description": "Learn how to design widgets in your chat experience with ChatKit.", @@ -592,7 +597,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c18d2ae218e45f8ae8953b99a709dd65\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:00:21 GMT" }, "https://developers.openai.com/api/docs/guides/chatkit.md": { "description": "Embed a widget to build your own chat experiences.", @@ -606,7 +611,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"1f98c0e3a3b3e737cf0bf658fd666bc7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:22 GMT" }, "https://developers.openai.com/api/docs/guides/citation-formatting.md": { "description": "Learn practical citation formatting patterns that help models generate reliable citations.", @@ -620,7 +625,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"dd5d81683947379ff1024e53907bbf51\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:00:21 GMT" }, "https://developers.openai.com/api/docs/guides/code-generation.md": { "description": "Learn how to use OpenAI models and Codex to generate code.", @@ -628,13 +633,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/code-generation.md", "title": "Code generation", - "bytes": 6128, + "bytes": 6874, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "27805a76ea9f0ee0a3a1cc8d3586e5b045841b5db2ba6083dd043cc4ae502a3f", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "adcf223025d8065b53b40477856a0034c3eaa0cb6669de2dce952603146689f1", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"f96120f847a52d936cd0ead73bcec3f3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"fe829260e7c47247cf37e4aabf19cad5\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:47:57 GMT" }, "https://developers.openai.com/api/docs/guides/compaction.md": { "description": "Manage long-running conversations with server-side and standalone compaction.", @@ -642,13 +647,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/compaction.md", "title": "Compaction", - "bytes": 13029, + "bytes": 14476, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "1b36d27be4df9b975bbce0d172fe2ffc2994a6fd874cf47f879088e3f6e98a2e", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "45e443e2aeba120c9bd1e3428dfc818429a54f955e190589ebe6e3288119c15e", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"65c1966fca6be9dfa58d6c612b41e59b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"cc6ae0776c956b6615de85ccac4e3ac8\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:46:10 GMT" }, "https://developers.openai.com/api/docs/guides/completions.md": { "description": "", @@ -662,7 +667,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4d695e853af478a0875af4429af886a1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:27 GMT" }, "https://developers.openai.com/api/docs/guides/content-provenance.md": { "description": "Learn how to verify images and audio, interpret content credentials and watermarks, and use provenance results responsibly.", @@ -670,13 +675,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/content-provenance.md", "title": "Content provenance", - "bytes": 9782, + "bytes": 10116, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "368645d44bb8c2a7c28d5b1c40efe236db635bdead823787c900ed18bde2a204", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "4cc0eda35cbe96cee0d5105d4f00b5208bc226dbb2b070ebf7e2e2ab3f1c1db9", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"cc5d24a784793123651769d8872e3545\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"0df0b69862ab29e43dc000b0a49a4496\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:05:33 GMT" }, "https://developers.openai.com/api/docs/guides/conversation-state.md": { "description": "Learn how to manage conversation state during a model interaction with the OpenAI API.", @@ -684,13 +689,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/conversation-state.md", "title": "Conversation state", - "bytes": 28167, + "bytes": 28469, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "e6ccb2f4aac5b98b25e344f07a16d4b0284db2615305b5b1ae00ca60077ec847", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "37bf280f1d5e85a48f303c2cec2f113fec45bc5fad9ce9ce42039aeb5924ab22", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"9bfb54b0a6fd881e1aa37a9d22712587\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"ec4f409eecbc04af9703b4546e873125\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:51:28 GMT" }, "https://developers.openai.com/api/docs/guides/cost-optimization.md": { "description": "Lower your OpenAI model costs by trying our tools and strategies.", @@ -704,7 +709,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"e4a3c881630441310c7ad2508eb5d8ca\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:34 GMT" }, "https://developers.openai.com/api/docs/guides/csam-guidance.md": { "description": "Learn practical guidance for addressing CSAM risks in products built with OpenAI.", @@ -718,7 +723,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"db5556e32beaa6f6be0e5960e8a739b2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:38:15 GMT" }, "https://developers.openai.com/api/docs/guides/custom-chatkit.md": { "description": "Use your own server with ChatKit to integrate agent workflows into your product with more customization.", @@ -732,7 +737,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"267192b1d29f20b30c53c6d42fab9b56\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:16 GMT" }, "https://developers.openai.com/api/docs/guides/deep-research.md": { "description": "Use deep research models for complex analysis and research tasks.", @@ -740,13 +745,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/deep-research.md", "title": "Deep research", - "bytes": 50586, + "bytes": 56868, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "62e1d33cc41f538f948e0930400084eac2a06a9fcf5c33edf77cb2c4cb1315d7", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "82eecc11dc5ad7df1dd088f417b04dd8d71906ad42dab4edf420d46f4be9725c", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"18367e39a8655159e08bee699bb7f563\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"b2f0f3a4bc3be1b88d65fd824b6971b1\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:51:10 GMT" }, "https://developers.openai.com/api/docs/guides/deployment-checklist.md": { "description": "Review commonly underused Responses API design choices that improve deployment quality, speed, cost, and reliability.", @@ -754,13 +759,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/deployment-checklist.md", "title": "API deployment checklist", - "bytes": 58370, + "bytes": 58959, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "3665bc3c3eb3fea2095ffc9c30305defc01c3ae1e125a4fed2c38efb9c9ed1bb", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "1f4f9eeb277fd0053bba810fe2a9821d179f28fd9363098637fcd7d54ec59741", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"031166e9cd5c1d33c8dada5506257874\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "etag": "W/\"a56e0808f4dc9d76e4baaa3f2c25610d\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:03:52 GMT" }, "https://developers.openai.com/api/docs/guides/developer-mode.md": { "description": "Full MCP client access for apps and tools.", @@ -774,7 +779,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4c8f9d81829676177379e00b9130d5cf\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:51 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:43:11 GMT" }, "https://developers.openai.com/api/docs/guides/direct-preference-optimization.md": { "description": "Fine-tune models for subjective decision-making by comparing model outputs.", @@ -788,7 +793,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"6f818410bb0a9d54f2530b3db9d3e211\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:38 GMT" }, "https://developers.openai.com/api/docs/guides/embeddings.md": { "description": "Learn how to turn text into numbers, unlocking use cases like search, clustering, and more with OpenAI API embeddings.", @@ -796,13 +801,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/embeddings.md", "title": "Vector embeddings", - "bytes": 32321, + "bytes": 37255, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "d42bb95b61394de8e0671129d11514c6b20afb66ad2ab6d0e24bac7324f3b0a8", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "70ce9fdc92b2dc017477085baaa50e39a1386def8e0993948dc4f8deaa7403ad", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"a686dfac9a2471bed2d0f9506349406e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"980fd9c4c3bceb5a2804805b07ea9472\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:34 GMT" }, "https://developers.openai.com/api/docs/guides/error-codes.md": { "description": "An overview of error codes from the OpenAI API and Python library, including solutions and guidance.", @@ -810,13 +815,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/error-codes.md", "title": "Error codes", - "bytes": 31056, + "bytes": 31727, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "33465d1a0fc8722b86d33de7c0aa7c9f86469b3144a946bc41aeca7de4e96530", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "efdc2581fd3e5d77fd69adcef7a61481ef1fae1a8f463273fcce88f09c982cf0", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"3559dc61730da2b3824b13cc1032575f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"df3ab8a52f4a517529a846031cb78295\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:55:02 GMT" }, "https://developers.openai.com/api/docs/guides/evals.md": { "description": "Learn how to test and improve AI model outputs through evaluations.", @@ -824,13 +829,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/evals.md", "title": "Working with evals", - "bytes": 27274, + "bytes": 27848, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "f5827a4d00e01de18048886758409b1a6c2fc30aa24922642221b0c01920c32b", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "70b26de9b9dafe94c8780e25917f20b3aabce737f6bfb253c8c61d9241121234", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"034abbe6576edaff6025b65f133dc8af\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"8068a36d00876d8a57e0bcc8bf6ed328\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:38 GMT" }, "https://developers.openai.com/api/docs/guides/evaluation-best-practices.md": { "description": "Learn best practices for designing evals to test and improve model performance in production.", @@ -844,7 +849,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8d832c52739fcb724811d16a60c80ac6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:37:23 GMT" }, "https://developers.openai.com/api/docs/guides/evaluation-getting-started.md": { "description": "Learn how to get started with evals using datasets.", @@ -858,7 +863,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9e07b3edef1997c56d85bb81f27dd48e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:45 GMT" }, "https://developers.openai.com/api/docs/guides/external-models.md": { "description": "Learn how to run evals on non-OpenAI models, using the OpenAI platform.", @@ -872,7 +877,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"59ad87f8cce4bbb89324053f3512f548\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:02:02 GMT" }, "https://developers.openai.com/api/docs/guides/fast-mode.md": { "description": "Get up to 2.5× faster speeds in the API while retaining flexible pay-as-you-go pricing.", @@ -886,7 +891,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"3efdf0f387b4ce029bbceabe9a5097c3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:37 GMT" }, "https://developers.openai.com/api/docs/guides/file-inputs.md": { "description": "Learn how to use files as file inputs in the OpenAI API.", @@ -894,13 +899,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/file-inputs.md", "title": "File inputs", - "bytes": 40533, + "bytes": 41346, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "5600e369c7f581dbec863166f0fb30c825072e94dec86a6102f4afdc192f642c", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "fa8bbb80e13312430eb698bbe18d3accb4c1b582e298df02844413e666c6acc7", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"93ef26dc0c48263a21093c3f91a5c8ed\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"99765d9130831971f7d5c2bf8b0248ba\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:44:35 GMT" }, "https://developers.openai.com/api/docs/guides/fine-tuning-best-practices.md": { "description": "Improve results with practical tips for fine-tuning.", @@ -914,7 +919,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"bc5d3690011a7e9092ad76c5362c8482\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:42 GMT" }, "https://developers.openai.com/api/docs/guides/flex-processing.md": { "description": "Learn how to optimize costs for asynchronous tasks with flex processing.", @@ -922,13 +927,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/flex-processing.md", "title": "Flex processing", - "bytes": 6026, + "bytes": 6840, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "b5a4ac92cdd1cfcd31d923c2516a876f4bdf5ef02517932c7fac6608b4ca9cc2", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "1f0c0e736760fdc63b12f61fe0d6e4e33c8acae1ef5c9d2e7498d61de6e14d85", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"7c08f4830223d82fe45038c8a6ae43aa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"c13cf927f9383b3fa6ae056e0e4d023d\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:04:31 GMT" }, "https://developers.openai.com/api/docs/guides/frontend-prompt.md": { "description": "Example prompt instructions for frontend work, written for GPT-5.5.", @@ -942,7 +947,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"b3d7789d4c70f2c5f6ab6f0e6236e542\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:43 GMT" }, "https://developers.openai.com/api/docs/guides/function-calling.md": { "description": "Learn how function calling enables large language models to connect to external data and systems.", @@ -956,7 +961,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"dfc6f10992df413ec2278fefd2478cb1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:10 GMT" }, "https://developers.openai.com/api/docs/guides/graders.md": { "description": "Learn about graders used for evals and fine-tuning.", @@ -970,7 +975,21 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"d7e4c798a984c378010b751a699241b2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:46:37 GMT" + }, + "https://developers.openai.com/api/docs/guides/image-cost-calculator.md": { + "description": "Estimate image input tokens and API costs for OpenAI vision models by model, image dimensions, and detail level.", + "localPath": "docs/en/api/docs/guides/image-cost-calculator.md", + "section": "guides", + "sourceUrl": "https://developers.openai.com/api/docs/guides/image-cost-calculator.md", + "title": "Image input token and cost calculator", + "bytes": 1396, + "firstSeenAt": "2026-08-31T04:05:07Z", + "sha256": "a2928d5e14093aa2215a2fafd810ddaaa954d041a0baab3018c68c69475ee30f", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", + "status": "active", + "etag": "W/\"7b3b10fb22a1f9db3ae0942a3ff92b07\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:44:53 GMT" }, "https://developers.openai.com/api/docs/guides/image-generation.md": { "description": "Learn how to generate or edit images with the OpenAI API and image generation models.", @@ -978,13 +997,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/image-generation.md", "title": "Image generation", - "bytes": 103326, + "bytes": 107814, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "aaeb6c5b2e147dc723a89295a252501253d7ed91e7887d2efef922fa17968bcc", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "8f6e8be30fc9bf882fe3f6382f8cf2584eb6e14c3f4bc6534072189a221f91ba", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"64868ed2c67216ad94f8bb953330c885\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"adabafd07a149d4239a735dbc3bd9619\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:37:22 GMT" }, "https://developers.openai.com/api/docs/guides/images-vision.md": { "description": "Learn how to understand or generate images with the OpenAI API.", @@ -992,13 +1011,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/images-vision.md", "title": "Images and vision", - "bytes": 39020, + "bytes": 39296, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "974e36ac9e449d0374683ce699a267afa2d66b214aba5a2e4d3f6ad1aa04458f", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "0dbac99f04b383b83e18652a205f6a3e3efd10325b34898714957ba7ebbf2ee8", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"e1f6e6a2f7caec3783d92749638133b5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "etag": "W/\"d1d3259a3644712fc73b861ef1a15de0\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:36:50 GMT" }, "https://developers.openai.com/api/docs/guides/ip-addresses.md": { "description": "Find the published IP egress ranges used by OpenAI products.", @@ -1012,7 +1031,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"33b2b19263b2531540a9e25d6453273c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:50 GMT" }, "https://developers.openai.com/api/docs/guides/ip-allowlist.md": { "description": "Configure organization- or project-level IP allowlists for OpenAI API requests.", @@ -1026,7 +1045,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"0ec943e2838a5a2fae39a14dc8a628a2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:49 GMT" }, "https://developers.openai.com/api/docs/guides/latency-optimization.md": { "description": "Improve latency across a wide variety of LLM-related use cases.", @@ -1040,7 +1059,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"47efbd63b1b121e418ee04133c649ae6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:42:52 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-4.1.md": { "description": "Learn how to use, migrate to, and prompt GPT-4.1 in the OpenAI API.", @@ -1054,7 +1073,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"65c68479ff26af00589693b37978fc58\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:29 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.1.md": { "description": "Learn how to use, migrate to, and prompt GPT-5.1 in the OpenAI API.", @@ -1068,7 +1087,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"00f0405e5274cac235e8a61fa52e3931\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:52 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:29 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.2.md": { "description": "Learn how to use, migrate to, and prompt GPT-5.2 in the OpenAI API.", @@ -1076,13 +1095,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.2.md", "title": "Using GPT-5.2", - "bytes": 48894, + "bytes": 49586, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "974f55e42f77c589b4e78e5bd8365cb0b3de56128aa6f205aa87aadd4ee8a408", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "fb0c87d79a1e00db5f7a7cedb2fd05081c2e49ed62e7480f0539e10c8cc77703", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"595c854ae8fdcd67111a176241b9da03\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"b2ce4db0531b749ab8d0a9eb220e747b\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:30 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.3-codex.md": { "description": "Learn how to use, migrate to, and prompt GPT-5.3-Codex in the Responses API.", @@ -1096,7 +1115,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8dcd53666ed0413546896ea4cddb647b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:53:46 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.4.md": { "description": "Learn how to use, migrate to, and prompt GPT-5.4 in the OpenAI API.", @@ -1104,13 +1123,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.4.md", "title": "Using GPT-5.4", - "bytes": 63464, + "bytes": 64168, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "bb44d568ea4b09d700ef947de6e962c346065b03d726fe70eb0e48d21a25a20f", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "bbf8fc52c2fd49a6a367f4e1a04491b281f706c5c1b608e99868136bbc73e71a", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"d20087bf7efc868edd0cc5944ff74439\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"cf7f899653126abdb8c50f82dde751d8\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:31 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.5.md": { "description": "Learn how to use and migrate to GPT-5.5 in the OpenAI API.", @@ -1124,7 +1143,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f85b4050b7a5fdec9b6508dc56b5fafa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:32 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.6.md": { "description": "Learn how to use and migrate to GPT-5.6, the latest model family in the OpenAI API.", @@ -1132,13 +1151,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.6.md", "title": "Using GPT-5.6", - "bytes": 18668, + "bytes": 18674, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "7591e641abc3cb124b2173843a03d40ea05ee421c8a036f04dda44c79188953e", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "f14333e97bbd94dfec6b622beda1ac76799b426295fbafb4e6874ba91e080c4e", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"2044a7bfb4dcefefffc5eafb03dafbb2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"99a45bf9d5f3ef361c3fa2b17629e164\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:32 GMT" }, "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.md": { "description": "Learn how to use, migrate to, and prompt GPT-5 in the OpenAI API.", @@ -1152,7 +1171,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f8239020457c6939d0e7ff7f7cc59c83\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:29 GMT" }, "https://developers.openai.com/api/docs/guides/migrate-to-responses.md": { "description": "", @@ -1160,13 +1179,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/migrate-to-responses.md", "title": "Migrate to the Responses API", - "bytes": 60130, + "bytes": 61188, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "3aef95e9d0c23bcb78d1a1260a674296458e7d7c523f00aa5a9d52567b0edc28", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "e5ccb01c9d5dba4092c407117f6bd0c25092f3df18b92adff10cbcce7dd5c725", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"a0eb66e37852a8bd9a65233fe769ef1d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"f4c88bec3e4e4cdcfc4fa40e23a6bec7\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:44:30 GMT" }, "https://developers.openai.com/api/docs/guides/model-optimization.md": { "description": "Ensure quality model outputs with evals and fine-tuning in the OpenAI platform.", @@ -1180,7 +1199,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2e614d7ec53fddfaf75573a182ede2ed\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:55 GMT" }, "https://developers.openai.com/api/docs/guides/model-selection.md": { "description": "Learn how to choose the right model by balancing accuracy, latency, and cost for optimal performance.", @@ -1194,7 +1213,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"778f82f850b1e3bdd08a2d86ee442426\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:36 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:56 GMT" }, "https://developers.openai.com/api/docs/guides/moderation.md": { "description": "Learn how to identify harmful content in text and images with OpenAI moderation models.", @@ -1208,7 +1227,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"0238b303a24b58a89039563a81ce029e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:03:49 GMT" }, "https://developers.openai.com/api/docs/guides/mutual-tls.md": { "description": "Configure Mutual TLS trust, certificate verification, CEL filters, rotation, and troubleshooting for OpenAI API requests.", @@ -1222,7 +1241,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"f7126bf4823db8e350add568097e2690\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:59 GMT" }, "https://developers.openai.com/api/docs/guides/node-reference.md": { "description": "Explore all available nodes for composing workflows in Agent Builder.", @@ -1236,7 +1255,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"d2209e1a3e0825c646f9cf31f44a8ac3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:59 GMT" }, "https://developers.openai.com/api/docs/guides/optimizing-llm-accuracy.md": { "description": "Learn strategies to enhance the accuracy of large language models using techniques like prompt engineering, retrieval-augmented generation, and fine-tuning.", @@ -1250,7 +1269,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"dc42b07fece239db3033d2628acdc45b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:00 GMT" }, "https://developers.openai.com/api/docs/guides/predicted-outputs.md": { "description": "Understand how to reduce latency for model responses where much of the response is known ahead of time.", @@ -1258,13 +1277,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/predicted-outputs.md", "title": "Predicted Outputs", - "bytes": 15960, + "bytes": 17707, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "674529a55d94fce022f09aa5bb27edd328f4dd0e11c1f26f4ba15b5504a23ced", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "167b2d24c560b3f28e1875b733d7f71d589edbd71f9f6e97bb5ffb3ac025a3dc", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"f991ea6022cdd52feec5d101530756df\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"0edf28877d456c52925531d1370ab29a\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:01 GMT" }, "https://developers.openai.com/api/docs/guides/private-link.md": { "description": "Configure Azure Private Link endpoints, DNS, health checks, and cross-region routing for the OpenAI API.", @@ -1278,7 +1297,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"5733929fced6d67a356fa212678b01e9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:01 GMT" }, "https://developers.openai.com/api/docs/guides/production-best-practices.md": { "description": "Explore best practices for transitioning your AI projects from prototype to production, including scaling, security, and cost management.", @@ -1292,7 +1311,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"822f4ea757289bb29ce66911d9f7dd5d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:02 GMT" }, "https://developers.openai.com/api/docs/guides/prompt-caching.md": { "description": "Learn how prompt caching reduces latency and cost for long prompts in OpenAI's API.", @@ -1306,7 +1325,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"f1e02f3e963ddf666019c8617058caaf\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:43:32 GMT" }, "https://developers.openai.com/api/docs/guides/prompt-engineering.md": { "description": "Learn strategies and tactics for better results using large language models in the OpenAI API.", @@ -1314,13 +1333,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/prompt-engineering.md", "title": "Prompt engineering", - "bytes": 36835, + "bytes": 37409, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "5e7a437d7492f512ba6e5e15cb8cc71e9bc72e54899e7e5bb4969aa373b2f405", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "90dbc272cb6690b0e83178d0f544a207bb2702362c4da7bc2859f84c2841ef56", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"71d526647b733ade56a2e918b4aec86b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"20c14e17061c138456730b74fb874456\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:56:05 GMT" }, "https://developers.openai.com/api/docs/guides/prompt-generation.md": { "description": "Learn how to generate prompts, functions, and schemas in the OpenAI API's Playground.", @@ -1328,13 +1347,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/prompt-generation.md", "title": "Prompt generation", - "bytes": 81658, + "bytes": 114618, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "abf187993373061e6631dd49a0dc9340a19c899efdb7ba7f6863c7fe8f0703dd", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "18ff37d7c1234b7dde66c66dc75a9e33007c5063e6eab6b285191f61efeae0f8", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"4f9377c32ea91d3e2ea77235a37a1b64\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"ad158ad99a45b226374fcd5cbb481094\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:04 GMT" }, "https://developers.openai.com/api/docs/guides/prompt-guidance-gpt-5p6.md": { "description": "Machine-readable prompting guidance for adapting prompts and agents to GPT-5.6 Sol.", @@ -1348,7 +1367,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"578320d8c07179094d4da89c1a2b76de\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:56:58 GMT" }, "https://developers.openai.com/api/docs/guides/prompt-optimizer.md": { "description": "Learn how to use your dataset to automatically improve your prompts.", @@ -1362,7 +1381,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f8649ceb6497d19abed0e6218cda23fb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:05 GMT" }, "https://developers.openai.com/api/docs/guides/prompting.md": { "description": "Learn how to create, optimize, and maintain prompts with OpenAI models.", @@ -1376,7 +1395,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f66d0968952edb22f58e7feedc21058c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:05 GMT" }, "https://developers.openai.com/api/docs/guides/prompting/migrate-from-prompt-object.md": { "description": "Learn how to migrate from reusable prompt objects to versioned prompts in your application code.", @@ -1384,13 +1403,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/prompting/migrate-from-prompt-object.md", "title": "Migrate from prompt objects", - "bytes": 13827, + "bytes": 15172, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "8e19672fa070abc30cb0e71d73b6be030b98ac2ea984844f619c22e7614a5464", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "db63cd1048d1c71d07d0245e4e15aa135e1ff4e7a34d125a57e7b861f565e727", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"c9edd10e299d84177b707fa06f6bd6c6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:53 GMT" + "etag": "W/\"72f592417d9cdc792fc363a0d5acbc96\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:05:54 GMT" }, "https://developers.openai.com/api/docs/guides/rate-limits.md": { "description": "Rate limits are restrictions that our API imposes on the number of times a user or client can access our services within a specified period of time.", @@ -1404,7 +1423,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"e2ca9335822a37fce9dfa054ba6ddd9d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:44:35 GMT" }, "https://developers.openai.com/api/docs/guides/rbac.md": { "description": "Learn how to use role-based access control to assign permissions, create custom roles, group users, and scope access across both the OpenAI API and dashboard.", @@ -1418,7 +1437,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c82358328b21ddb870ec717054a736e9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:51 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-conversations.md": { "description": "Learn how to manage Realtime speech-to-speech conversations.", @@ -1426,13 +1445,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-conversations.md", "title": "Realtime conversations", - "bytes": 49993, + "bytes": 53456, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "def7d1284bc03ac6f5aa82261a8eb5495f6f19b4889d1ce36d06b8af5adc469c", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "a52eb0f791a94bb30da39e74ac81ea314e9dad35189c0ce4beb8ac1cc110acfd", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"62105bf4e2a05e262c98cfb14b2954f8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "etag": "W/\"f559dfdb7b9e2ab4a333c5974aec6263\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:46:10 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-costs.md": { "description": "Learn how to monitor and optimize your costs when using the Realtime API.", @@ -1446,7 +1465,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"bea73b0e082caa1cf8041ff4c712faf4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:53 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-mcp.md": { "description": "Learn how to configure function tools, MCP tools, and connectors in a Realtime session.", @@ -1454,13 +1473,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-mcp.md", "title": "Realtime with tools", - "bytes": 21128, + "bytes": 25625, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "ac8860845ea70b2d55c6ad847c9c3ac7ae1c0f171a3f8c406fdf00a2ec34ec72", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "28625543b880ff5f8b69c4be8b7541325f95e438746338cc8f47107ea7bf9b42", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"341012de7f8136cf509b4b2358fb3121\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "etag": "W/\"05d44e14086b7f397b2d12aa465507de\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:11 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-models-prompting.md": { "description": "Learn how to use realtime voice models, including Realtime 2 reasoning, preambles, tool use, and migration from earlier realtime models.", @@ -1474,7 +1493,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"e57d64a16496ab0ccb869bb9a9bd36be\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:49:17 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-server-controls.md": { "description": "Learn how to use webhooks and server-side controls with the Realtime API.", @@ -1488,7 +1507,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"b40b3e74d7d8878a57d91a3b165f2479\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:37 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-sip.md": { "description": "Learn how to connect to the Realtime API using SIP.", @@ -1496,13 +1515,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-sip.md", "title": "Realtime API with SIP", - "bytes": 11351, + "bytes": 13365, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "8feb3719c31f7e25e3777d60ed197acafdc41de64aaae76389c84a1562753379", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "8973214ec8a2040e1a6b3ae4709bcaae5ba032c5602d2c9ab51ef110bee97540", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"32dc50b5b9603907442c96b078259691\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "etag": "W/\"81508664c3f77efc01f2893ec0389fbc\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:08 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-transcription.md": { "description": "Learn how to transcribe live audio with realtime transcription sessions.", @@ -1516,7 +1535,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"32a2fff0736e80ce07976e7e72dbcaf7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:37 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:10 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-translation.md": { "description": "Learn how to build live speech translation with Realtime translation sessions.", @@ -1530,7 +1549,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c2b33023f36304c55cc396b6ec8511bc\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:11 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-vad.md": { "description": "Learn about automatic voice activity detection in the Realtime API.", @@ -1544,7 +1563,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"0ea24580431ac24cb0c1df74d1bff404\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:46:18 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-webrtc.md": { "description": "Learn how to connect to the Realtime API using WebRTC.", @@ -1558,7 +1577,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"25725b2e92a48dd357f5359dc88b5c5c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:42 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:09 GMT" }, "https://developers.openai.com/api/docs/guides/realtime-websocket.md": { "description": "Learn how to connect to the Realtime API using WebSocket in a server-to-server application.", @@ -1566,13 +1585,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-websocket.md", "title": "Realtime API with WebSocket", - "bytes": 5644, + "bytes": 6144, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "103b6df2ca0e06b84748971cfb50d28d98826e881e73318343d51fab2d7c5d71", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "49c75279e63841979d5916797bbc21444defbbe01ded41ae922bdb636cfde332", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"eb377496315828cddb21dabd6a0b2bf2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "etag": "W/\"0d56a3d533eecb64b3ffecc6ba0feaf0\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:09 GMT" }, "https://developers.openai.com/api/docs/guides/realtime.md": { "description": "Learn which realtime and audio guide to use for each speech application.", @@ -1586,7 +1605,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a3c968dbdef006ff241f7ca0de0cf472\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:58 GMT" }, "https://developers.openai.com/api/docs/guides/reasoning-best-practices.md": { "description": "Explore best practices for using o-series reasoning models, like o1 and o3-mini, vs. GPT models—including use cases, how to choose a model, and prompting guidance.", @@ -1600,7 +1619,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"d03e20fe5df5656318993379c73b8a1a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:12 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:54:21 GMT" }, "https://developers.openai.com/api/docs/guides/reasoning.md": { "description": "Learn how to use OpenAI reasoning models in the Responses API, choose a reasoning effort, manage reasoning tokens, and keep reasoning state across turns.", @@ -1608,13 +1627,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/reasoning.md", "title": "Reasoning models", - "bytes": 57895, + "bytes": 61847, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "550551822b30550f1e8fb82f2d6a3907c34a7d268692497d23f8b091c575d9ad", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "3e396f12436b8a996789baf2694516927b92658d0e54c38190e429a2e68221f1", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"a9a5ea185412935c141ac4f18d2a9de4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "etag": "W/\"aa7dafed3841f093b8acfc602449e324\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:45:11 GMT" }, "https://developers.openai.com/api/docs/guides/red-teaming.md": { "description": "Learn how red teaming fits into AI evaluation, including Promptfoo open source and OpenAI Red Teaming for enterprise teams.", @@ -1628,7 +1647,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"7355382074023ee4e5aea88d2267b964\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:13 GMT" }, "https://developers.openai.com/api/docs/guides/reinforcement-fine-tuning.md": { "description": "Fine-tune models for expert-level performance within a domain.", @@ -1642,7 +1661,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"a8aa6d01dc698fb5925da19184387a97\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:14 GMT" }, "https://developers.openai.com/api/docs/guides/responses-multi-agent.md": { "description": "Enable Responses API Multi-agent, handle client-side HTTP and WebSocket flows, and read Multi-agent output items.", @@ -1656,7 +1675,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"98476e81e6d249ba0f068e05ae16e3c6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:14 GMT" }, "https://developers.openai.com/api/docs/guides/retrieval.md": { "description": "Learn how to search your data using semantic similarity with the OpenAI API.", @@ -1670,7 +1689,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"5635d2037ac4e685a9d2588e1f7f6bbf\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:15 GMT" }, "https://developers.openai.com/api/docs/guides/rft-use-cases.md": { "description": "Explore best practices and practical use cases for reinforcement fine-tuning (RFT) with OpenAI models.", @@ -1684,7 +1703,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4eeea5490e2dbc77aa5ab0f3ba41d375\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:54 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:14 GMT" }, "https://developers.openai.com/api/docs/guides/safety-best-practices.md": { "description": "Learn how to implement safety measures like moderation, adversarial testing, human oversight, and prompt engineering to ensure responsible AI deployment.", @@ -1692,13 +1711,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/safety-best-practices.md", "title": "Safety best practices", - "bytes": 8420, + "bytes": 8753, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "9d3783fc8fc9d6b3df7e5b4c7804c70cc10d76625d9db6159f3a61822c46edac", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "ee158d926b4ef276527909bf4b79f19de69acb5b53e7ba2d2bb7fa2ceccf9daf", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"312007038e604129a6956f06727f251b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "etag": "W/\"79511508e8f1a2bd577e43ecb8e45d4d\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:17 GMT" }, "https://developers.openai.com/api/docs/guides/safety-checks.md": { "description": "Learn how OpenAI assesses for safety, OpenAI classifiers across safety categories, and implementation tips for how to pass safety checks.", @@ -1706,13 +1725,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/safety-checks.md", "title": "Safety checks", - "bytes": 9225, + "bytes": 9793, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "4d7de34e78a1b0996bcb2ac6d41bd0b318f08d819d1d703cd79cc9b7859e1380", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "76f1704fb7f77e2561b1bac8bb76d2346129c37137deb4b657122665f1337b50", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"99b8f918878027fdaed8c3775a3a3335\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "etag": "W/\"0acb531e62c04761d1451722c1fc587a\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:40:08 GMT" }, "https://developers.openai.com/api/docs/guides/safety-checks/cybersecurity.md": { "description": "", @@ -1726,7 +1745,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f820f684221193707e678a2a8d434ffa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:36 GMT" }, "https://developers.openai.com/api/docs/guides/safety-checks/under-18-api-guidance.md": { "description": "", @@ -1740,7 +1759,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"61b37f298cf52d033a30f9ec3a2b1780\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:26 GMT" }, "https://developers.openai.com/api/docs/guides/secure-mcp-tunnels.md": { "description": "Connect private or on-prem MCP servers to supported OpenAI products with an outbound-only MCP tunnel, without exposing them to the public internet.", @@ -1754,7 +1773,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"aece29a480a1e76ba1e964d475c65070\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:19 GMT" }, "https://developers.openai.com/api/docs/guides/speech-to-text.md": { "description": "Learn how to transcribe recorded audio files, stream file transcripts, and use specialized speech-to-text features.", @@ -1762,13 +1781,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/speech-to-text.md", "title": "File transcription", - "bytes": 37028, + "bytes": 39637, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "edd0e6987ce7c07f7f4d38ab6ab0079cd44e37cd64ede4985407cc90b4a950f5", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "66164f5d16372e452886f1d4239e706fc52279e96afcbeb964e4c124a767f23c", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"cdae7e93efff956003f790312f65060a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "etag": "W/\"aa41196ca60fa41b7526e1f77f422b68\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:02:51 GMT" }, "https://developers.openai.com/api/docs/guides/spend-limits.md": { "description": "Control API spend with organization and project monthly spend limits.", @@ -1782,7 +1801,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"41e7a401f0cc01348301113964e585c1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:20 GMT" }, "https://developers.openai.com/api/docs/guides/streaming-responses.md": { "description": "Learn how to stream model responses from the OpenAI API using server-sent events.", @@ -1790,13 +1809,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/streaming-responses.md", "title": "Streaming API responses", - "bytes": 6764, + "bytes": 7084, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "e5cd3c79f5e1832e6fc4ef30334efb88e09015fcd0778f3ce2c30ccd2cd76aac", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "41abcec6c6be2e0c0603b06dbeed9f3276bb330aec49e7c9e5be664d02c2c2e3", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"4a394776e13ded714451878e0bc4321f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "etag": "W/\"ddb3141db4bc20c478d875c789ac24f8\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:21 GMT" }, "https://developers.openai.com/api/docs/guides/structured-outputs.md": { "description": "Understand how to ensure model responses follow specific JSON Schema you define.", @@ -1804,13 +1823,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/structured-outputs.md", "title": "Structured model outputs", - "bytes": 120228, + "bytes": 134122, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "a6297a60148c1f650cf0f5325c374a95e3dec76fff8045018d1fb7af3015db60", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "2ae5881fd030b9e7af29eb2f00c87d81d11ef34f0aeab2322c1c7537e3953d49", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"e001e9757e7c2799467cedc16a69e89b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "etag": "W/\"20cdad1cc227a755f8e13daece473082\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:40:48 GMT" }, "https://developers.openai.com/api/docs/guides/supervised-fine-tuning.md": { "description": "Fine-tune models with example inputs and known good outputs for better results and efficiency.", @@ -1824,7 +1843,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"89f4315c084ae666f378a23d1fbc4e57\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:24 GMT" }, "https://developers.openai.com/api/docs/guides/terraform.md": { "description": "Configure the OpenAI Terraform provider and manage organization resources through the Administration API.", @@ -1838,7 +1857,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"dd39639a0fa75be3bfb3592ef789fd70\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:22 GMT" }, "https://developers.openai.com/api/docs/guides/terraform/import-and-reconcile.md": { "description": "Import existing OpenAI resources into Terraform, inspect current state, reconcile drift, and understand removal behavior.", @@ -1852,7 +1871,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ede427bc5b5fcaf0629abd11196ba1f4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:48 GMT" }, "https://developers.openai.com/api/docs/guides/terraform/project-controls.md": { "description": "Manage OpenAI project model permissions, hosted-tool permissions, and data-retention controls with Terraform.", @@ -1866,7 +1885,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9d688bbecce8f0fbfc4354b7b61f8093\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:57 GMT" }, "https://developers.openai.com/api/docs/guides/terraform/projects-and-access.md": { "description": "Create an OpenAI project, define least-privilege roles, and manage group and user access with Terraform.", @@ -1880,7 +1899,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"b82965b40a6595001a0f64f4fcaf307c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:52 GMT" }, "https://developers.openai.com/api/docs/guides/terraform/rate-limits-and-spend.md": { "description": "Discover and manage OpenAI project rate limits and create organization or project spend alerts with Terraform.", @@ -1894,7 +1913,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f08a9d8d26bb847257cfd60b2c8f926c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:07 GMT" }, "https://developers.openai.com/api/docs/guides/terraform/service-accounts.md": { "description": "Create OpenAI project service accounts, assign least-privilege roles, and manage API keys outside Terraform state.", @@ -1908,7 +1927,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"7014c204d3f90e8b1e0634003496a072\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:52 GMT" }, "https://developers.openai.com/api/docs/guides/text-to-speech.md": { "description": "Learn how to turn text into lifelike spoken audio with the OpenAI API.", @@ -1922,7 +1941,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"8248faf6fac67683115a11cd793a4331\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:23 GMT" }, "https://developers.openai.com/api/docs/guides/text.md": { "description": "Learn how to use the OpenAI API to generate text from a prompt. Learn about message types and available text formats like JSON and Structured Outputs.", @@ -1936,7 +1955,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"a7afdff075bb58b6273e649a5d0fa543\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:42:27 GMT" }, "https://developers.openai.com/api/docs/guides/token-counting.md": { "description": "Use the Responses API to count input tokens for text, images, files, tools, and more—without estimation or tiktoken.", @@ -1950,7 +1969,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"605812827bfad7b110faa0ef70ad2ea7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:35 GMT" }, "https://developers.openai.com/api/docs/guides/tools-apply-patch.md": { "description": "Allow models to propose structured diffs that your integration applies.", @@ -1958,13 +1977,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/tools-apply-patch.md", "title": "Apply Patch", - "bytes": 18210, + "bytes": 18996, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "798a74c99dd3707d621e5221754213764a26626c6748500f617152f05ded4e2f", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "4460113e32af92c682118ee86c008ae425bda313cc4767a9b36e52365e02af54", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"ca7d971702fbf50c7db8464b520217fd\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "etag": "W/\"206931241c849ea63dd10405ffa7b462\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:05:20 GMT" }, "https://developers.openai.com/api/docs/guides/tools-code-interpreter.md": { "description": "Allow models to write and run Python to solve problems.", @@ -1978,7 +1997,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"782405b2db6657d2ac253fb5cf75ffeb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:25 GMT" }, "https://developers.openai.com/api/docs/guides/tools-computer-use.md": { "description": "Use the Responses API computer tool to click, type, scroll, and inspect screenshots.", @@ -1992,7 +2011,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"9f9a7215a2a360789c52329901ff855e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:55 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:37:25 GMT" }, "https://developers.openai.com/api/docs/guides/tools-connectors-mcp.md": { "description": "Use remote MCP servers and OpenAI-maintained connectors for popular services to give models new capabilities.", @@ -2006,7 +2025,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"9b3a2bf52b760069c5bc22a33329448a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:41:45 GMT" }, "https://developers.openai.com/api/docs/guides/tools-file-search.md": { "description": "Allow models to search your files for relevant information before generating a response.", @@ -2014,13 +2033,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/tools-file-search.md", "title": "File search", - "bytes": 25637, + "bytes": 27817, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "d9e7af10d5a4d7f5b12e90cc7d153e5a35e0c2ae9a0e667c0e07fa8bd39bfd92", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "948c964ccf550b748e655d4b65d0bc6d649c2aad4d0aa1fb55e63af288cd9941", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"0ced3c9ceb0d33fb50d382e257f3b1da\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "etag": "W/\"03e56ff97db70d1f9d204f2ca585dbaa\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:40:55 GMT" }, "https://developers.openai.com/api/docs/guides/tools-image-generation.md": { "description": "Allow models to generate or edit images.", @@ -2028,13 +2047,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/tools-image-generation.md", "title": "Image generation", - "bytes": 30754, + "bytes": 34332, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "a222409ec80180ecc03cfe96cbb0b82896394cedccd8b9346341aadfab9265cd", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "a7dcd85f2cc282c70374c8e195ed037262810ae0d15028006577d419cf6a9bb5", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"234eb55435bc257d38e9563f6bc3d9d5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "etag": "W/\"5ad16c35776fd377ee00c802f2d4d162\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:45:54 GMT" }, "https://developers.openai.com/api/docs/guides/tools-local-shell.md": { "description": "Enable agents to run commands in a local shell.", @@ -2048,7 +2067,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"878fed764727df11a73b88f1c0f484b6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:01:42 GMT" }, "https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling.md": { "description": "Configure Programmatic Tool Calling, control which tools programs can invoke, and resume programs after client-owned function calls.", @@ -2062,7 +2081,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9b761dcd9da3b739b070f87ca6834285\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:03 GMT" }, "https://developers.openai.com/api/docs/guides/tools-shell.md": { "description": "Run shell commands in hosted containers or your own local runtime.", @@ -2076,7 +2095,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"a4ffbc41a3317ea53a34383ca110970c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:19 GMT" }, "https://developers.openai.com/api/docs/guides/tools-skills.md": { "description": "Upload, manage, and attach reusable skills to hosted environments.", @@ -2090,7 +2109,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"3b7b620cfacaacf8a136a2c0722760b1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:49:40 GMT" }, "https://developers.openai.com/api/docs/guides/tools-tool-search.md": { "description": "Use tool search to defer large tool surfaces, group related tools with namespaces, and load only the relevant functions at runtime.", @@ -2104,7 +2123,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"ff6abff61496c3fec9c0571146d39af5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:46:09 GMT" }, "https://developers.openai.com/api/docs/guides/tools-web-search.md": { "description": "Allow models to search the web for the latest information before generating a response.", @@ -2118,7 +2137,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"37ea72c57f38be8723e7768ddd1f248e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:46:30 GMT" }, "https://developers.openai.com/api/docs/guides/tools.md": { "description": "Use powerful tools like remote MCP servers, or built-in tools like web search and file search to extend the model's capabilities.", @@ -2132,7 +2151,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"2b1ed65b0abe96625a01da5a0e5f668c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:45:11 GMT" }, "https://developers.openai.com/api/docs/guides/trace-grading.md": { "description": "Use trace grading to create datasets, configure graders, and track evaluation runs for your models.", @@ -2146,7 +2165,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"91f350aa7470fdfd70fed8d9934bf5a3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:02:27 GMT" }, "https://developers.openai.com/api/docs/guides/transcription.md": { "description": "Choose between file transcription and realtime transcription, then start with the recommended model for your audio.", @@ -2160,7 +2179,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"1fef875b7d71e51806af6c61292ae960\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:26 GMT" }, "https://developers.openai.com/api/docs/guides/upgrading-to-gpt-5p4.md": { "description": "Guidance for upgrading OpenAI API model strings and directly related prompts to GPT-5.4.", @@ -2174,7 +2193,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4c0c549027d867af79b9783835a798d6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:27 GMT" }, "https://developers.openai.com/api/docs/guides/upgrading-to-gpt-5p5.md": { "description": "Guidance for upgrading OpenAI API model strings and directly related prompts to GPT-5.5.", @@ -2188,7 +2207,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"cd18f31d6c356f0f8726d64976d71984\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:27 GMT" }, "https://developers.openai.com/api/docs/guides/upgrading-to-gpt-5p6-sol.md": { "description": "Machine-readable guidance for migrating OpenAI API integrations to GPT-5.6 Sol and the GPT-5.6 family.", @@ -2202,7 +2221,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a286075014b1b3cdafe84b1d9b4f678a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:56:58 GMT" }, "https://developers.openai.com/api/docs/guides/video-generation.md": { "description": "Learn how to generate, refine, and manage videos using the OpenAI Videos API.", @@ -2216,7 +2235,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"a378debf8856b47a523a4e17bed24246\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:36:44 GMT" }, "https://developers.openai.com/api/docs/guides/vision-fine-tuning.md": { "description": "Fine-tune models for better image understanding.", @@ -2230,7 +2249,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"3d08ec05a927c90be57e0529ecc37dc6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:35 GMT" }, "https://developers.openai.com/api/docs/guides/voice-agents.md": { "description": "Learn how to build voice agents with the OpenAI Agents SDK, choose the right architecture, and connect voice workflows to the rest of the agent stack.", @@ -2244,7 +2263,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"05427b18bb7e1a863204b6d7f9644a96\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:36 GMT" }, "https://developers.openai.com/api/docs/guides/webhooks.md": { "description": "Use webhooks to receive real-time updates from the OpenAI API.", @@ -2252,13 +2271,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/webhooks.md", "title": "Webhooks", - "bytes": 11329, + "bytes": 14510, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "c647843e21c03cd1db2ae64aa08325781df71148e48ac9e2e2212c93a7a549ab", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "8d06c770826963a962d001d0b8a6b49ab10493ad0013ce163d50c4dea8163fd0", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"7d35712e2dd62a42ef1d746d1b03a92b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "etag": "W/\"96a90aa5f8b7680f4d419998b3767d31\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:37 GMT" }, "https://developers.openai.com/api/docs/guides/websocket-mode.md": { "description": "Learn how to use Responses API WebSocket mode with response creation, continuation, and multiplexing.", @@ -2272,7 +2291,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"c41e7428450a7b9ee2852b1dd2598583\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:38 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation.md": { "description": "Authenticate trusted workloads to the OpenAI API and Codex with short-lived identity-provider tokens.", @@ -2286,7 +2305,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"15ae073aa813de770b0f67b36a6cfd3a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:39 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/admin-api.md": { "description": "Programmatically create, list, update, disable, and archive Codex workload identity providers and federation rules.", @@ -2300,7 +2319,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"476f8bc30693f089e31f6da76b2dcd46\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:56 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:51 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/aws.md": { "description": "Configure AWS outbound identity federation or Amazon EKS as a workload identity federation token provider.", @@ -2314,7 +2333,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"4abf16388850a3c3bf39f6615dcb25d9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:29 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/federation-rules.md": { "description": "Reference for Codex workload identity subjects, audiences, exact claims, CEL conditions, scopes, token lifetimes, and lifecycle behavior.", @@ -2328,7 +2347,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"bafb3618a57a0da0e8a8013536dfd716\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:25 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/github-actions.md": { "description": "Configure GitHub Actions as a workload identity federation token provider.", @@ -2342,7 +2361,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"4fca608dd05f595f0624ec04a0f17b19\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:29 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/google-cloud.md": { "description": "Configure Google workload identity or GKE as a workload identity federation token provider.", @@ -2356,7 +2375,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"5c9e75ce173506d03bd329a2d26ea0fe\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:29 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/kubernetes.md": { "description": "Configure Kubernetes as a workload identity federation token provider.", @@ -2370,7 +2389,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"d2cdf6897fb6d20ed27a233f428b0175\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:30 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/microsoft-azure.md": { "description": "Configure Azure managed identity or AKS as a workload identity federation token provider.", @@ -2384,7 +2403,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"164806bedb71d5a762b366033018c816\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:31 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/oracle-cloud.md": { "description": "Configure Oracle Cloud Infrastructure instance principals as a workload identity federation token provider.", @@ -2392,13 +2411,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/workload-identity-federation/oracle-cloud.md", "title": "Configuring workload identity federation for Oracle Cloud Infrastructure", - "bytes": 11550, + "bytes": 14848, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "7b0c286b9a02cf478975461c39db4b823c80f4560155dd8c543903b4edb45d8b", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "00b3721a322f66a788d05592f60ce3c215a5044a83f4717d07b5a698c6a72461", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"f3c870f5a563cc0b00cd7fb67e69269e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "etag": "W/\"e5d3aacee6da288e42fcb240715568ea\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:05:31 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/spiffe.md": { "description": "Configure SPIFFE JWT-SVIDs as workload identity federation subject tokens.", @@ -2412,7 +2431,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"0a23f3f242a32e3d5a4ee5868b986899\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:32 GMT" }, "https://developers.openai.com/api/docs/guides/workload-identity-federation/x509.md": { "description": "Configure an X.509 workload identity provider and exchange a TLS client certificate for a short-lived OpenAI access token.", @@ -2426,7 +2445,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"e12342d5c34661029ca010972bcc312a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:05:28 GMT" }, "https://developers.openai.com/api/docs/guides/your-data.md": { "description": "Your data is your data. An overview of how OpenAI uses your data, including retention and usage policies.", @@ -2434,13 +2453,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/guides/your-data.md", "title": "Data controls in the OpenAI platform", - "bytes": 70695, + "bytes": 71176, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "e8abb2995e37c881f3084506702d89af22582b739edd88ef39d6d452a8c4aa91", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "470ba960f71510e9c01ff2cf3f3938c08e08b55eeed98eca128c6bf68e2953eb", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"b6318d20a5ce5811a5ed53cb352c1259\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "etag": "W/\"f3e2e1dd5124fc868de76d44fab020bc\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:37:37 GMT" }, "https://developers.openai.com/api/docs/libraries.md": { "description": "Discover official OpenAI SDKs, the OpenAI CLI, and the Agents SDK.", @@ -2450,11 +2469,11 @@ "title": "SDKs and CLI", "bytes": 12212, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "ea5345918819b7975fbc32d62cfe9b175788c02bef823b363c971191542caabe", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "5dab0c297038e0ee85eaf396b5d14d47681a7e4bfc2c7aff9b3bd08296288925", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"e44a28dc409b2101b346f07a9a16ce76\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "etag": "W/\"cf4f7c065a8bccdb2c6c8df5230590fe\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:06:39 GMT" }, "https://developers.openai.com/api/docs/libraries/openai-cli.md": { "description": "Install and use the generated openai command-line tool for Responses, structured outputs, images, speech, and shell workflows.", @@ -2468,7 +2487,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"b46c73798142c970651bfa98e505abb6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:40 GMT" }, "https://developers.openai.com/api/docs/mcp.md": { "description": "Learn how to build MCP servers for use with plugins, deep research, or API integrations.", @@ -2482,7 +2501,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"a7bcfc8de033c6d5edd5a18503012403\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:40 GMT" }, "https://developers.openai.com/api/docs/models.md": { "description": "Catalog of models available through the OpenAI API.", @@ -2490,10 +2509,10 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/models.md", "title": "Models", - "bytes": 11390, + "bytes": 11391, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "553119298e086b444c081db4f38eef917e77c7f4b3e773e37281e219278496ff", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "9c5ae962e2b9db36b87c9deebf9ffb32c63535f03343aae4d1b7f0fd4b012cc1", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active" }, "https://developers.openai.com/api/docs/models/all.md": { @@ -2502,10 +2521,10 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/models/all.md", "title": "All models", - "bytes": 11390, + "bytes": 11391, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "553119298e086b444c081db4f38eef917e77c7f4b3e773e37281e219278496ff", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "9c5ae962e2b9db36b87c9deebf9ffb32c63535f03343aae4d1b7f0fd4b012cc1", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active" }, "https://developers.openai.com/api/docs/models/compare.md": { @@ -2526,13 +2545,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/pricing.md", "title": "Pricing", - "bytes": 20739, + "bytes": 20885, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "1c54363f719988de1b4382035c9ad70422ad3ea6a99e77a094dd43e15a67169d", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "14ad7ca4328a97587487626a637a60b59235632d6b8d6cbb864bf371120367ae", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"2af75cda69ff2303c40e81d6e575ca37\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:22 GMT" + "etag": "W/\"58945c38ff482d26054d8e38ac44281f\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:36:46 GMT" }, "https://developers.openai.com/api/docs/quickstart.md": { "description": "Learn how to use the OpenAI API to generate human-like responses to natural language prompts, analyze images with computer vision, use powerful built-in tools, and more.", @@ -2540,13 +2559,13 @@ "section": "guides", "sourceUrl": "https://developers.openai.com/api/docs/quickstart.md", "title": "Developer quickstart", - "bytes": 53275, + "bytes": 54082, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "1766b031a7caee45f58d57ec676d118ba3a0cff4c505c6e28cfb753d0d194ed2", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "3b53be774781d992361ff768b03b8033b71d922824a0e94beca66eda3acea654", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"26d252d8826358b2f3bf955618256010\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "etag": "W/\"5732cb187ae38053813177f0ef0482d6\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:40:04 GMT" }, "https://developers.openai.com/api/docs/supported-countries.md": { "description": "Countries and territories that currently support access to our API services.", @@ -2560,7 +2579,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"7999dddc6c053906c36106611b29fd75\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:57:17 GMT" }, "https://developers.openai.com/api/docs/tutorials/meeting-minutes.md": { "description": "Create an automated meeting minutes generator with Whisper and a GPT model.", @@ -2574,7 +2593,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"aae264e7cd3908dc4c53f6eb630ce70a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:44 GMT" }, "https://developers.openai.com/api/docs/tutorials/web-qa-embeddings.md": { "description": "How to build an AI that can answer questions about your website.", @@ -2588,7 +2607,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"d9eaa9f72933e8ab60e925ad30aee6df\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:45 GMT" }, "https://developers.openai.com/api/reference/administration/overview.md": { "description": "", @@ -2602,7 +2621,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"82e17bb8be14bdc89df4591934753f80\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:46 GMT" }, "https://developers.openai.com/api/reference/chat-completions/overview.md": { "description": "", @@ -2616,7 +2635,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ac6df981ac80738b0690b64ae9ebd52a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:57 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:46 GMT" }, "https://developers.openai.com/api/reference/overview.md": { "description": "", @@ -2630,7 +2649,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f9c19ac39ea613d9fb422a9d8d9be540\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:49:35 GMT" }, "https://developers.openai.com/api/reference/realtime-beta/overview.md": { "description": "", @@ -2644,7 +2663,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"5dca8c0488da00e81cf2c9f94dc5e907\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:48 GMT" }, "https://developers.openai.com/api/reference/resources/audio.md": { "description": "OpenAI API endpoint reference.", @@ -2658,7 +2677,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"03af216cbd3179c1dcab261cfe32f99e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:48 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2672,7 +2691,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4122dba4806d932dccc4926201e46afa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:49 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2686,7 +2705,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a9ef2fb0da29342d18f404cc31b43c87\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:49 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/translations/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2700,7 +2719,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9fef286aa64ec443a43545cd48178355\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:50 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/voice_consents/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2714,7 +2733,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"e56741889afd5d098b2ac81415c22991\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:50 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/voice_consents/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -2728,7 +2747,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"82a9cdc9a8e59676fd66b098e917562f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:51 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/voice_consents/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -2742,7 +2761,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"41fc91be3ff2c9195d06e48badf95de5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:51 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/voice_consents/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -2756,7 +2775,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8b5361d1a2c5c528721080b978b95fc5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:52 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/voice_consents/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -2770,7 +2789,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"f90de1e3321d5adfcfe66cd0c717719c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:52 GMT" }, "https://developers.openai.com/api/reference/resources/audio/subresources/voices/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2784,7 +2803,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"bf7120d93769572e7254d57d65a143c2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:52 GMT" }, "https://developers.openai.com/api/reference/resources/batches.md": { "description": "OpenAI API endpoint reference.", @@ -2798,7 +2817,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"5eb9a67a26bad1f76dd15c42729e9b32\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:53 GMT" }, "https://developers.openai.com/api/reference/resources/batches/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -2812,7 +2831,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"331dbc542e6f2230d89af5499f525a71\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:54 GMT" }, "https://developers.openai.com/api/reference/resources/batches/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2826,7 +2845,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"626683236dce4db627fccc8e871dbdb6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:54 GMT" }, "https://developers.openai.com/api/reference/resources/batches/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -2840,7 +2859,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"6fa7453f2e8ebf1407c012c7cc049eff\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:55 GMT" }, "https://developers.openai.com/api/reference/resources/batches/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -2854,7 +2873,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"3f147123365ec2f16fc9676fb93f1085\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:55 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants.md": { "description": "OpenAI API endpoint reference.", @@ -2866,9 +2885,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "316ada26a9815941039ebbd65ba90f0cd9612626bb0271af06b90acb066a48c7", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"76771fe9d9c9f9595309535f518c870b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -2880,9 +2900,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "a04038252da646f1c3afec1e2f75abfb269f6af4e6fb28b16490f14106422e50", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"670809c3485980e472be43a3524a0fbe\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -2894,9 +2915,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "e328aebf6d1506955377282d1bcf694cb253d6a2c6b630fc96fe0f4121d15cab", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"085d77d3594560f018bd674ec2138f4b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -2908,9 +2930,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "15f56c106b368a0895c5506d1a0225791e665cb4c00d9c39cb3bc557c4e83b49", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"04cd3543fe27afd38d0d9b1bd0f7d033\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:58 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -2922,9 +2945,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "36f46b04cd367635543df82122c11a9aae951cfcfb63e6ff68432f12aed03d3c", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"f2c8ccd3d058b922b44abf7cf04ac017\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:40 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:18:40 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -2936,9 +2960,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "e91fee5085d24455cd1b8be6c2e04fa17ead4e0eaaf0fe73e578b6696a742a39", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"24d14dfd6125c90ee86a6c9f8efec8bb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/streaming-events.md": { "description": "OpenAI API streaming event reference.", @@ -2950,9 +2975,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "4ed26dde21c8dc64df104af83782610acb13e201ff1940316dcbc5a4a886e378", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"b335032f93bd55db2b95f084a40fcbf8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit.md": { "description": "OpenAI API endpoint reference.", @@ -2966,7 +2992,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ecb63822e2df35315a1b13efec09f5cb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:56 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/sessions.md": { "description": "OpenAI API endpoint reference.", @@ -2980,7 +3006,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a5dac9b27ff294e41c06b3c071a0d870\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:56 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/sessions/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -2994,7 +3020,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"79220769d461eeebaf372d8b04aee2cc\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:57 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/sessions/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3008,7 +3034,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"71f883e7d954ab1fe376adbb5756714c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:58 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/threads.md": { "description": "OpenAI API endpoint reference.", @@ -3022,7 +3048,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"db4c794a0c31c335e76d551bb2e5e141\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:58 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/threads/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3036,7 +3062,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"aa4dfcecac0cf5cb8653d16f91db2288\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:59 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/threads/methods/list_items.md": { "description": "OpenAI API endpoint method reference.", @@ -3050,7 +3076,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a05c97ea4bb53c18aa47d611d8cb1103\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:00 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/threads/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3064,7 +3090,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"57bd58d954688ee0bcfde2d876addf25\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:06:59 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/threads/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3078,7 +3104,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"6bf10e46f3655821a4054959b784354b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:00 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/responses/streaming-events.md": { "description": "OpenAI API streaming event reference.", @@ -3086,13 +3112,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/responses/streaming-events.md", "title": "Beta Responses streaming events", - "bytes": 18519143, + "bytes": 18525207, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "472cbc470cdf82208f51befeb0d337cc17d73f59cca138f7605daf27504ad1df", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "3e577195dbac2479ad42166be11ea4d6022a94bfaa3f35741518cd24be408a34", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"b27640b4a340422c30ad6a8ac8227b3a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "etag": "W/\"a7113046a256243133b0833e18fa0708\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:07:01 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/responses/websocket-events.md": { "description": "OpenAI API streaming event reference.", @@ -3100,13 +3126,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/responses/websocket-events.md", "title": "Beta Responses WebSocket events", - "bytes": 22794197, + "bytes": 22800261, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "9736d18fca518cdcda716b81044d4bf0503d734b5d85c8b518ce6e660548280a", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "5f9518423752b7859172e668b1b28cc97b0d8426fe3a67c1f4ed03d04e470dd3", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"1306eb2ac3b022de5ebcdba490d07dc0\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "etag": "W/\"a14852423963e9a7480fbdfb80f30688\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:07:01 GMT" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads.md": { "description": "OpenAI API endpoint reference.", @@ -3118,9 +3144,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "6bfc728d1c7742b561ad80f49bec4d8629e5050a07cf3070a49967e885953d81", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"cba4c526d22a066ffa770099fb96e6d9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3132,9 +3159,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "b6334d23d00cb4e68cfc69999ed682bb437176e71aaf699e3ef6732b7c25e481", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"c8633ed37f7c170bd4fb42bb418c3986\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3146,9 +3174,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "6ef3da1141a36985ea04dc7344856a4949fa94074225a871c606b0da3e6d1eb9", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"2dc53c774491ba9c7df6730a46728da6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3160,9 +3189,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "43ade53069533e685ce842af0c9f4ae235e48bbf71a1ec1579cd6c0e7ebff3d5", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"f216c9111e596119cc2e9d90a7b9e2f4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -3174,9 +3204,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "9600e7e044bb8423ab6a800265e24ee6b04698893d865acfe77b20a12de7cfee", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"0d30245e2cf47a8b910445cd116f6bd1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages.md": { "description": "OpenAI API endpoint reference.", @@ -3188,9 +3219,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "14b4d9bf58bb52b87126a0b4bf7a850d34897058620b97ae98d308fb4c771a92", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"20d0cc1963b928f468dde2a2eff89cc4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:07:59 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3202,9 +3234,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "b81958e2962f3cf0bb5a5902822f23a70081d291573bfb4eaa6a7b4ae672f117", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"4caab705faa7b3b4430252fb08883c0f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3216,9 +3249,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "b3bf3b03b906743c7c7fc754d110c4bf15bead2d8fdf37cac8192658c6c2f0a0", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"6e0794e1889326b4d502f7372a7ca0ed\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:41 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:18:41 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3230,9 +3264,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "58428f59230ea690ff1cb9ba7bcbae2eca9cd47d0d0c7a0c11e4ef627b0a7f61", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"3bf2d4271c769703b81548a3194a6f7d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:41 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:18:41 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3244,9 +3279,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "877e70569e9a2fcd0d928c5d4936f4a001cbe5d73f0d0c1ff046a352f44e12d9", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"1dcc0926643caa57683812ed12232ee9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -3258,9 +3294,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "f76af2bd1912fbe0cd9375f229db8f09ec95a01e181b97fd948ad36119117a49", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"f80a3664413a209a31e394a3b7f95d85\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs.md": { "description": "OpenAI API endpoint reference.", @@ -3272,9 +3309,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "6230dbe973326145b0305186459ee2dac33fce782a65c0828a2949b85e6f667c", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"4c4e55e2fa42256683ba7ba772744a9a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -3286,9 +3324,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "fa042ec07b6f76acf24bb12f9a278ed7feb8d7a5ead52f8af73573bf3a3df017", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"08eae887bbfcb8cf8384625bd2a98658\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3300,9 +3339,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "d6164731b0d6fd2edc354717765c13aba7057cfb2e94de3bd4efd6d4bf9eb8a5", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"6508f60bab4c3edbc44bfd8faf2b62b8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3314,9 +3354,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "48d7ddd556daed2130a05621466a4a447737b97e213d9804264ed914ce1759e3", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"dab6c3822b0c969a750917b538071031\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3328,9 +3369,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "1196159264c66a1a22eb3f1bbfbf43f685e7b02ae76c27c4dfdb1581b4f76dc7", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"2881f865494f695159c2afc0e7fd9258\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md": { "description": "OpenAI API endpoint method reference.", @@ -3342,9 +3384,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "bb7ea31eaaae4bb2ad19f31e8cd4a04096b9f3e548345742f0624384060a2893", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"10ffae91a5f5237cbcc3de16f9a9c8cb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -3356,9 +3399,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "d19e3243adc5fade9c923f7772473463919451af73ee830d9ee880da48486501", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"77b64714f7caf377bfad450fcb2203be\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md": { "description": "OpenAI API endpoint reference.", @@ -3370,9 +3414,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "42fe6638a8ab160abeeccb72741d307ee0bb0eab0f55f32e455f6029b0ae9559", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"2b21aef4d575d6795bfc41cc5250bec8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3384,9 +3429,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "85ab5e8216bf69c70fb431e4b00b6716ef6c422ce5f820b3a6012ce814700734", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"028add903bee32214ababe9881c27acc\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3398,9 +3444,10 @@ "firstSeenAt": "2026-08-17T07:50:43Z", "sha256": "606942f983a817f682fba501f16d4c7c4ac5e9f5a76ba3d5c011fee32efbfbc0", "sourceUpdatedAt": "2026-08-17T07:50:43Z", - "status": "active", + "status": "removed", "etag": "W/\"2309c263a845b194eaa4ff4711d40769\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT", + "removedAt": "2026-08-31T04:05:07Z" }, "https://developers.openai.com/api/reference/resources/chat.md": { "description": "OpenAI API endpoint reference.", @@ -3408,13 +3455,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/chat.md", "title": "Chat", - "bytes": 236252, + "bytes": 237054, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "5a8d83938f1608e4f80f42226122b9830fe7b44d9003359c99b5ad8843bdafce", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "ea003164a8614c35a790d600f3e7925e581694001a90a673d7b16f82eea90316", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"a46eb6358433c6709e7f6d3fdfe8e68e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:00 GMT" + "etag": "W/\"4a006090df68beb2945185515722c6e3\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:50:27 GMT" }, "https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3422,13 +3469,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve.md", "title": "Chat Completions — Retrieve", - "bytes": 20983, + "bytes": 21124, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "bc0f901f56c39495b1629d5fbc8987fb7f89895b7f288848c9fd24668d3ba506", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "50f5c52c6b6a78efb2ca42aff9dcd9e29074dd25605a417416d702395bdc0f38", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"97f3e018946e3415d42951eb85bd6ed2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "etag": "W/\"f11eb904a4aabc38d7b683c043c3b384\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:07:02 GMT" }, "https://developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events.md": { "description": "OpenAI API streaming event reference.", @@ -3436,13 +3483,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events.md", "title": "Chat Completions streaming events", - "bytes": 91669, + "bytes": 92458, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "84a5277d18214caff8b8ce9d554d029375b04854e2e7eff9e621f51202b6af5f", - "sourceUpdatedAt": "2026-08-24T09:37:37Z", + "sha256": "5d68c74c7966c206c4f21d8ee1807250e405170de898049f1746331a3f7274b4", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"f125004fd6c078965d598ebb16f8b63a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "etag": "W/\"c5f20703526ade05a011486265b28462\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:07:03 GMT" }, "https://developers.openai.com/api/reference/resources/completions.md": { "description": "OpenAI API endpoint reference.", @@ -3450,13 +3497,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/completions.md", "title": "Completions", - "bytes": 20850, + "bytes": 21221, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "51f95c24b568adf548dae63a0d5537fab4b225f189b04c5c7d4cc14e33e8f6dc", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "53edc9d0a41e97440fcdf33b56c832ab5b0f4666f70ed28a70fe1d854f093819", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"570a97d6580a1c38eae4fc4a1d8b9b7b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "etag": "W/\"42dc72bc01c36259533b6aee620af845\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:07:04 GMT" }, "https://developers.openai.com/api/reference/resources/completions/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3464,13 +3511,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/completions/methods/create.md", "title": "Completions — Create", - "bytes": 14305, + "bytes": 14446, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "354de186a90bac1c84dacdf9445c2a6958be298b7555145644827747b8fffe72", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "524348eab66a17cd22e83e73129874c058cb2fe6e98c2bcaa16a45e13f53fabf", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"ccacf4073494d9cc5f7e65e43bde1fd3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "etag": "W/\"f15c10c84434ef811590f56c5e68618a\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:07:04 GMT" }, "https://developers.openai.com/api/reference/resources/containers.md": { "description": "OpenAI API endpoint reference.", @@ -3484,7 +3531,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"70dda7bf06b74938944e7772f32cd210\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:05 GMT" }, "https://developers.openai.com/api/reference/resources/containers/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3498,7 +3545,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4139f46ed5afea1d0ddc404b8568e266\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:05 GMT" }, "https://developers.openai.com/api/reference/resources/containers/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3512,7 +3559,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"c192813f995f793993ae081fcfd8f989\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:06 GMT" }, "https://developers.openai.com/api/reference/resources/containers/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3526,7 +3573,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2c18bd8720b24e29ec6b6bcac2ad4771\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:10:12 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:07 GMT" }, "https://developers.openai.com/api/reference/resources/containers/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3540,7 +3587,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4eaadff4d5c71fb741a5cdab344aea8d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:08 GMT" }, "https://developers.openai.com/api/reference/resources/containers/subresources/files.md": { "description": "OpenAI API endpoint reference.", @@ -3554,7 +3601,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"cdfa3f6e8ff5f2bc6fc6216935afdd30\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:08 GMT" }, "https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3568,7 +3615,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8e4d70c6856bbb6d3b9a2a887ace7483\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:08 GMT" }, "https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3582,7 +3629,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"828c3bfd8f68f49d500a8d4a308ac986\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:09 GMT" }, "https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3596,7 +3643,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"47fa4421fa5d176a6eb959a73819c8a4\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:09 GMT" }, "https://developers.openai.com/api/reference/resources/containers/subresources/files/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3610,7 +3657,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"015a10ecaff62d901ff30598fb645102\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:10 GMT" }, "https://developers.openai.com/api/reference/resources/containers/subresources/files/subresources/content/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3624,7 +3671,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b32f8bc3a3c05d3316bf7c28abc062a9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:10 GMT" }, "https://developers.openai.com/api/reference/resources/conversations.md": { "description": "OpenAI API endpoint reference.", @@ -3638,7 +3685,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"a52bcb6b5999276f1e7512c803339c11\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:11 GMT" }, "https://developers.openai.com/api/reference/resources/conversations/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3652,7 +3699,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"79a9ca2bb0087cd130a9c59b499221e5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:12 GMT" }, "https://developers.openai.com/api/reference/resources/conversations/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3666,7 +3713,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"91fe2e2e7f44f6383505f4c4e4092042\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:12 GMT" }, "https://developers.openai.com/api/reference/resources/conversations/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3680,7 +3727,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"58f8f324bf21c5d83f74eb810c379459\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:13 GMT" }, "https://developers.openai.com/api/reference/resources/conversations/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -3694,7 +3741,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8d49d494ecef1247a846827e9ed24850\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:01 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:14 GMT" }, "https://developers.openai.com/api/reference/resources/conversations/subresources/items/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3708,7 +3755,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"8a04478cc5f20fedd85472826267a1d1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:14 GMT" }, "https://developers.openai.com/api/reference/resources/embeddings.md": { "description": "OpenAI API endpoint reference.", @@ -3722,7 +3769,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"70cf938d07f84a48d24dca015af06cf1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:15 GMT" }, "https://developers.openai.com/api/reference/resources/embeddings/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3736,7 +3783,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"58e4719da9b691f7e91b0bdddedb2331\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:15 GMT" }, "https://developers.openai.com/api/reference/resources/evals.md": { "description": "OpenAI API endpoint reference.", @@ -3750,7 +3797,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"c76f72692d6311c7a65d2eba4f8b52db\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:16 GMT" }, "https://developers.openai.com/api/reference/resources/evals/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3764,7 +3811,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"bb7f945d408d3cfb50f222d3efea7987\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:43 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:16 GMT" }, "https://developers.openai.com/api/reference/resources/evals/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3778,7 +3825,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"7150313859006b677f169ef43496bd4b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:17 GMT" }, "https://developers.openai.com/api/reference/resources/evals/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3792,7 +3839,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"7bdbd91f3eb6485601ef140055f9a469\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:17 GMT" }, "https://developers.openai.com/api/reference/resources/evals/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3806,7 +3853,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"5c2dfc58a99b909d6520915364b3c951\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:18 GMT" }, "https://developers.openai.com/api/reference/resources/evals/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -3820,7 +3867,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"0e2fe7a761de82b7b3541b0c044fc07d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:18 GMT" }, "https://developers.openai.com/api/reference/resources/evals/subresources/runs/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -3834,7 +3881,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"5873e8c989e8be5b9caf1d04c10d1c39\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:19 GMT" }, "https://developers.openai.com/api/reference/resources/files.md": { "description": "OpenAI API endpoint reference.", @@ -3848,7 +3895,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"717ec86e8ad27112d9b0d4ed87814c73\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:20 GMT" }, "https://developers.openai.com/api/reference/resources/files/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3862,7 +3909,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2d80605d7d2a67894108efad2f359440\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:20 GMT" }, "https://developers.openai.com/api/reference/resources/files/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3876,7 +3923,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"9f4086be28022f888ba58f33515d6714\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:21 GMT" }, "https://developers.openai.com/api/reference/resources/files/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3890,7 +3937,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2f47e7dfc21d52feae1f88e701929d3e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:21 GMT" }, "https://developers.openai.com/api/reference/resources/files/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -3904,7 +3951,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"49c4ead672a10e780b3561cc88068f4b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:21 GMT" }, "https://developers.openai.com/api/reference/resources/fine_tuning.md": { "description": "OpenAI API endpoint reference.", @@ -3918,7 +3965,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"af8cde1d073e45a21d0c86defbfa1dbe\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:22 GMT" }, "https://developers.openai.com/api/reference/resources/fine_tuning/subresources/checkpoints/subresources/permissions/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -3932,7 +3979,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"cfdd10dacc771237fb85d9cacd4ae45b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:23 GMT" }, "https://developers.openai.com/api/reference/resources/fine_tuning/subresources/checkpoints/subresources/permissions/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -3946,7 +3993,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"19d523392c0cd59272a16ca74b5b1d5b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:23 GMT" }, "https://developers.openai.com/api/reference/resources/fine_tuning/subresources/jobs/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3960,7 +4007,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8da59832dd95e4582cfbc15d4a34f0d8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:23 GMT" }, "https://developers.openai.com/api/reference/resources/fine_tuning/subresources/jobs/subresources/checkpoints/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -3974,7 +4021,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"69a32b15a67c5a00411fbc0ac9358d5d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:24 GMT" }, "https://developers.openai.com/api/reference/resources/graders.md": { "description": "OpenAI API endpoint reference.", @@ -3988,7 +4035,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"d4ea4066c50a0d20650e2f774b5a6909\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:43 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:25 GMT" }, "https://developers.openai.com/api/reference/resources/images.md": { "description": "OpenAI API endpoint reference.", @@ -4002,7 +4049,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"10bb5fed4e695b28ec878ee98b11c22c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:02 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:56:25 GMT" }, "https://developers.openai.com/api/reference/resources/images/edit-streaming-events.md": { "description": "OpenAI API streaming event reference.", @@ -4016,7 +4063,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"982b1970eaee48ec8a75d4ad3a85a2c9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:25 GMT" }, "https://developers.openai.com/api/reference/resources/images/generation-streaming-events.md": { "description": "OpenAI API streaming event reference.", @@ -4030,7 +4077,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"ad05e03cf4202592ccc2b1529a220621\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:26 GMT" }, "https://developers.openai.com/api/reference/resources/images/methods/create_variation.md": { "description": "OpenAI API endpoint method reference.", @@ -4044,7 +4091,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"085e7831496be73bdad18f9e76754e66\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:27 GMT" }, "https://developers.openai.com/api/reference/resources/models.md": { "description": "OpenAI API endpoint reference.", @@ -4058,7 +4105,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2ced2966d92dc096a06e136b0b885ae1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:28 GMT" }, "https://developers.openai.com/api/reference/resources/models/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4072,7 +4119,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"acbf1b1b8143d493fecc9ac701f2f457\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:28 GMT" }, "https://developers.openai.com/api/reference/resources/models/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4086,7 +4133,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c671ad6c64209fa12233e1fdfb888a88\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:29 GMT" }, "https://developers.openai.com/api/reference/resources/models/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4100,7 +4147,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"119c066b5fa651e5cf9477993ed7b99e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:29 GMT" }, "https://developers.openai.com/api/reference/resources/moderations.md": { "description": "OpenAI API endpoint reference.", @@ -4114,7 +4161,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"b9dbd470ecd3893fd877ca103e75960e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:30 GMT" }, "https://developers.openai.com/api/reference/resources/moderations/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4128,7 +4175,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4ee07862055415547e962f94bf206b55\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:31 GMT" }, "https://developers.openai.com/api/reference/resources/organization.md": { "description": "OpenAI API endpoint reference.", @@ -4142,7 +4189,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"8ec6272101d116294bea4d5d943c5ead\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:31 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs.md": { "description": "OpenAI API endpoint reference.", @@ -4156,7 +4203,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"69f0e6bb89bad33f7815702b86aefff9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:32 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4170,7 +4217,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"857045e6d3828527400e8d1decdc6595\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:32 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/subresources/admin_api_keys.md": { "description": "OpenAI API endpoint reference.", @@ -4184,7 +4231,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"10fdecfecb7b7f8030e49422b63a2bee\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:32 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/subresources/admin_api_keys/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4198,7 +4245,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"7ead6f9202cc76ab242255eacdaf48fa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:33 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/subresources/admin_api_keys/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4212,7 +4259,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"849eaacf5fde134e25755146de60d298\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:33 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/subresources/admin_api_keys/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4226,7 +4273,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"3a65ad485eab2b5dfbd3181937fce67e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:34 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/subresources/admin_api_keys/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4240,7 +4287,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"2cefb0a808e359e8204a9f8d4c13b6f6\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:35 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/audit_logs/subresources/usage.md": { "description": "OpenAI API endpoint reference.", @@ -4254,7 +4301,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"67c8564a93cf22b2587051727fa8b57e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:35 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups.md": { "description": "OpenAI API endpoint reference.", @@ -4268,7 +4315,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"bcfd89cc846fc42705e993c80ae781f8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:36 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4282,7 +4329,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"f4d421b1fce1a61d234a62a78ec6f896\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:37 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4296,7 +4343,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"270a6afe9728689a88d3a5bb524da0e1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:37 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4310,7 +4357,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"8c402e32ee6462719fe6890635cdd8e7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:38 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -4324,7 +4371,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"98691adf3e1377b0bb203c790cc061f9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:03 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:38 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/subresources/users.md": { "description": "OpenAI API endpoint reference.", @@ -4338,7 +4385,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"6c5522a8b3fb2a8e8d29a8226f02057b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:39 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/subresources/users/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4352,7 +4399,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"65f4fde9fcb0b7bee2cdf2c3b1d2fcee\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:40 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/subresources/users/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4366,7 +4413,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"c025823b4259450d9c78070e7584669f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:40 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/groups/subresources/users/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4380,7 +4427,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"60fc64b2afb43e0eb31213452b9d8046\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:41 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/invites.md": { "description": "OpenAI API endpoint reference.", @@ -4394,7 +4441,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"7a77b41f1579cd601961c8a8ba3b3c69\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:41 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/invites/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4408,7 +4455,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"fe34aaef689459feeb51198c154dbb1a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:42 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/invites/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4422,7 +4469,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"a25ab61c9c65116eae81d2662d2ec302\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:42 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/invites/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4436,7 +4483,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"3c2a25905bc435058d322c1f944e851b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:42 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/invites/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4450,7 +4497,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"272b3a1647b9369c8ec4fade0689ba25\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:10:16 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:43 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects.md": { "description": "OpenAI API endpoint reference.", @@ -4464,7 +4511,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"f5adfebbdeb8d6cce72d45aeb62d863e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:10:16 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:44 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4478,7 +4525,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"3352bc4e3d49c945f31c72a21b0d558e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:44 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4492,7 +4539,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b2cd48d584895e75ad139126be99f270\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:45 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4506,7 +4553,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"6f45537ce63435dbd0d6a4ce7737fa91\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:46 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -4520,7 +4567,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"671b1e1a09709e001731894be24b23fa\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:46 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/api_keys.md": { "description": "OpenAI API endpoint reference.", @@ -4534,7 +4581,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"84b63e39d920097bd3ab9aeb65252371\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:47 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/api_keys/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4548,7 +4595,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"18724175b2212ad3ba2a01a68c00d617\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:47 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/api_keys/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4562,7 +4609,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"9d40e59e2b98a2340e9bdf161ba01b9d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:48 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/api_keys/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4576,7 +4623,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"d6812c765c30bd95bf03f9b7a32418ac\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:48 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/groups.md": { "description": "OpenAI API endpoint reference.", @@ -4590,7 +4637,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"0d772765d3f018b8f525c95c25a33071\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:49 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/groups/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4604,7 +4651,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"6c0784d4388fb754e1f283a637105afc\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:49 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/groups/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4618,7 +4665,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"2775538ecc02832d76f94faf3c507263\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:50 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/rate_limits.md": { "description": "OpenAI API endpoint reference.", @@ -4632,7 +4679,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"4d17f629070e928cf679d5a943b29b87\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:50 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/service_accounts.md": { "description": "OpenAI API endpoint reference.", @@ -4646,7 +4693,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b5b03bce83c9f8612508a8f88a124d80\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:04 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:51 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/service_accounts/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4660,7 +4707,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"1d878d39493015309262f8fd31b288b7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:45 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:52 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/service_accounts/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4674,7 +4721,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"4bd01fd8531fbc5824975ffcb67c7145\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:52 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/service_accounts/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4688,7 +4735,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"89d6d52d0b52b6f78095e8120717611c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:52 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/service_accounts/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4702,7 +4749,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"c87fde879b138faefbe42c383b3aaf8f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:53 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/users.md": { "description": "OpenAI API endpoint reference.", @@ -4716,7 +4763,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"0be7278257110d2f374961587c847508\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:54 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/users/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4730,7 +4777,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"6016e00729829948bc3f80a34c8a5840\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:55 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/users/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4744,7 +4791,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b09677c1e8b1fb944c3604922b38c81a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:55 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/users/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4758,7 +4805,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"a8b2cb6c38b681895b1f346f8c7b228a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:56 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/users/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4772,7 +4819,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"a88932e9145fef9329a909e6b8a6d09e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:56 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/projects/subresources/users/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -4786,7 +4833,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"e7d799dad6154615532ba28f23eb1294\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:57 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/roles.md": { "description": "OpenAI API endpoint reference.", @@ -4800,7 +4847,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"e9903ae7a3dd474e8c2ff173d2840733\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:57 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/roles/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4814,7 +4861,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"027a9f43f74c9d08b0a16cde4ffc158a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:58 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/roles/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4828,7 +4875,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"c3bf4d2b610198bde626ad51a951fd2c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:59 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/roles/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4842,7 +4889,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"1016a8e0765ebb50a911ba7f340ba87a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:07:59 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/roles/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -4856,7 +4903,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"ce15d2a30b7ff0299d6273219df6729c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:00 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users.md": { "description": "OpenAI API endpoint reference.", @@ -4870,7 +4917,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"27bb741e9771243dcae5e078d7e010d3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:00 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4884,7 +4931,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"20ca11a9771fdc653f3c5260fdde2faf\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:01 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4898,7 +4945,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"f653758d469851072f368c5d156d6571\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:01 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -4912,7 +4959,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"a8d50e10d6d19b87e7b5e15fb23b1d80\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:02 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -4926,7 +4973,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"993ec07983557c090276d6f70ce2a443\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:02 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/subresources/roles/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -4940,7 +4987,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"6ba670ae08a66d9b5ff9724327f90c3d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:03 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/subresources/roles/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -4954,7 +5001,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"53f4503c8a58f4e45760fa5f06c0d260\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:46 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:03 GMT" }, "https://developers.openai.com/api/reference/resources/organization/subresources/users/subresources/roles/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -4968,7 +5015,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"239b24fc3440a01a868e61c92a6e7e72\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:04 GMT" }, "https://developers.openai.com/api/reference/resources/projects.md": { "description": "OpenAI API endpoint reference.", @@ -4982,7 +5029,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"cceb5ceed6856217ed2d787ef61dbcba\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:05 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/groups.md": { "description": "OpenAI API endpoint reference.", @@ -4996,7 +5043,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"5fb2520c2f41c093d5d30877ce48926f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:05 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/groups/subresources/roles/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5010,7 +5057,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"c2850f48049a4338370011c8ae7db664\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:05 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:06 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/groups/subresources/roles/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5024,7 +5071,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"edccf2343cfab737f7da9a8616a9f0ed\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:06 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/groups/subresources/roles/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5038,7 +5085,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"cd235791708aee655e5548412d4b3286\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:07 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/roles/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5052,7 +5099,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"04beca4c7ae7514024ad7a494bc06416\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:08 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/roles/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5066,7 +5113,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"e0dc2edd0fb348510abb65442ad47cf8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:08 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/roles/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5080,7 +5127,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"a5220471aa9746a5640b957c28f7da85\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:09 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/roles/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -5094,7 +5141,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"f6e6ad3b6d29579188fc9c9f88cee4d3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:09 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/users.md": { "description": "OpenAI API endpoint reference.", @@ -5108,7 +5155,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"7b46351649a14aefed2506c992f56e4b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:10 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/users/subresources/roles/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5122,7 +5169,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"49a0a3373a1c1cf0b285cb05d1055910\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:10 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/users/subresources/roles/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5136,7 +5183,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"74f55f703fd83c96e073bbfe2d05adb8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:11 GMT" }, "https://developers.openai.com/api/reference/resources/projects/subresources/users/subresources/roles/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5150,7 +5197,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"211d381f738ff1bcf51891a890edc876\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:11 GMT" }, "https://developers.openai.com/api/reference/resources/realtime.md": { "description": "OpenAI API endpoint reference.", @@ -5164,7 +5211,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"964832788a7ec277aff1189b44633949\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:10:19 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:39:21 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/client-events.md": { "description": "OpenAI API streaming event reference.", @@ -5178,7 +5225,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"79fdb5fe92667c616bd2216bef237fcb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:46 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:15 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/server-events.md": { "description": "OpenAI API streaming event reference.", @@ -5192,7 +5239,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"31764c20bbe8284e206d52c4cd410d05\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:16 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/calls.md": { "description": "OpenAI API endpoint reference.", @@ -5206,7 +5253,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"4af0c5c3822393bc29cdd188fbe787c9\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:12 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/accept.md": { "description": "OpenAI API endpoint method reference.", @@ -5220,7 +5267,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"08a9d090fbfe7049fbf3435e295fcff5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:13 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5234,7 +5281,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"d02dc3da78be6da3f12920c6e68dc5f5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:13 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/hangup.md": { "description": "OpenAI API endpoint method reference.", @@ -5248,7 +5295,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b65df08d09dcdf54722c3feec12cce02\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:14 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/refer.md": { "description": "OpenAI API endpoint method reference.", @@ -5262,7 +5309,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"a011d293217b2c7566f94ccd19bafa3c\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:14 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/reject.md": { "description": "OpenAI API endpoint method reference.", @@ -5276,7 +5323,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"0a836ce07229b1a241e6031011722d88\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:15 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/client_secrets.md": { "description": "OpenAI API endpoint reference.", @@ -5290,7 +5337,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9f34dfcab8abc076a41ac0837292afdc\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:15 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/subresources/client_secrets/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5304,7 +5351,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"1896c2b36ca572dbb44ed689e3056c1d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:06 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:16 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/translation-client-events.md": { "description": "OpenAI API streaming event reference.", @@ -5318,7 +5365,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"4fccd000d3bfbce4c0d9fdbcdbc8e2de\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:17 GMT" }, "https://developers.openai.com/api/reference/resources/realtime/translation-server-events.md": { "description": "OpenAI API streaming event reference.", @@ -5332,7 +5379,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"ebf11e9aa81e9cef3fd3d44f7d8f38d2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:17 GMT" }, "https://developers.openai.com/api/reference/resources/responses.md": { "description": "OpenAI API endpoint reference.", @@ -5340,13 +5387,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses.md", "title": "Responses", - "bytes": 4776037, + "bytes": 4777799, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "cd7aed45a595c076468fbac2548a145d6e3f5e501334749b5de112be798b1d97", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "56a346524d5a9da0e93f194d51b26dbc484dca81518f4efcf54bab5d5fc3fd73", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"cc41b0350e0b22dabc70641c50f03bd3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"403050aed2f9da6f239b5f92920f366a\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:18 GMT" }, "https://developers.openai.com/api/reference/resources/responses/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -5354,13 +5401,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/cancel.md", "title": "Responses — Cancel", - "bytes": 279572, + "bytes": 279713, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "1eed64f409d29fbd662a3c56dd5b88cf533cb6cc4c2ee1f659615e150e925a1f", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "62a4bbdb03e5dff154e8e4985c52fba24ba66b87b0c5865782de0b302e775da7", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"b225260c5ce674a0f06ab328da7f8250\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"8ec6beee17c0f603261ac6bdf527f8b3\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:18 GMT" }, "https://developers.openai.com/api/reference/resources/responses/methods/compact.md": { "description": "OpenAI API endpoint method reference.", @@ -5368,13 +5415,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/compact.md", "title": "Responses — Compact", - "bytes": 247914, + "bytes": 248055, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "5859144bd733082cd42aa065cd72d6980aa43133b63dbf0e241d95165739c955", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "1257b2a948c7ac775504a36c1dd985621e1a532e4a34a64ca3dad9ae24c58365", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"4db40e6f20ec76fd5c88a2832685c9c7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"ed1d7daf61713ee809567184c95707f9\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:19 GMT" }, "https://developers.openai.com/api/reference/resources/responses/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5382,13 +5429,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/create.md", "title": "Responses — Create", - "bytes": 474970, + "bytes": 475111, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "fe6eb427201ed7d5c0cecab288d6bd9e7f488a5f13985eefa7f4e4f01cf25608", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "2c44f339ff0d84b54677f80fd80af0e32887f7d443ecec951eb949b744460893", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"b37800df1187272007c23f7779d92ad8\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"0d2e44b6e7922390c5021f4a89e12d92\"", + "sourceLastModified": "Mon, 31 Aug 2026 03:36:27 GMT" }, "https://developers.openai.com/api/reference/resources/responses/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5402,7 +5449,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"3c3a511f1650abcc34348cc27ec763f7\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 03:57:59 GMT" }, "https://developers.openai.com/api/reference/resources/responses/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -5410,13 +5457,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/retrieve.md", "title": "Responses — Retrieve", - "bytes": 281139, + "bytes": 281280, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "4f8332ff6b7e1e7e05cf17cd1684bd63ae30b18078bc5e1f3ea1ed19035757f8", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "300213a3ded26c711f31a8fa686eb4a84f0117b21ed1443d72af7732878f8be7", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"40a0a200aedc74952f7b70367078f016\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"a96fc5813e42205d0ca230e809024d05\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:20 GMT" }, "https://developers.openai.com/api/reference/resources/responses/streaming-events.md": { "description": "OpenAI API streaming event reference.", @@ -5424,13 +5471,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/streaming-events.md", "title": "Responses streaming events", - "bytes": 14982929, + "bytes": 14988544, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "d0ad3852c7e20d077bb0e7070f851c63612b48866430d3dd57603a0d8a49d338", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "e0a51e7349df4d95855bebc0220ca227096bfbe614d47dab188dd7eb4cb630d4", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"9b637aced00515c17f32ab51fecf68d1\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"79042eda9b0a069b184da8f5e56b5f9a\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:22 GMT" }, "https://developers.openai.com/api/reference/resources/responses/subresources/input_items/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5444,7 +5491,7 @@ "sourceUpdatedAt": "2026-08-24T09:37:37Z", "status": "active", "etag": "W/\"4f43414459d969d941907f6d76b4a45d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:21 GMT" }, "https://developers.openai.com/api/reference/resources/responses/subresources/input_tokens.md": { "description": "OpenAI API endpoint reference.", @@ -5458,7 +5505,7 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"1bdbbcc0ea6041781e9d553181c14125\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:18:47 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:22 GMT" }, "https://developers.openai.com/api/reference/resources/responses/websocket-events.md": { "description": "OpenAI API streaming event reference.", @@ -5466,13 +5513,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/websocket-events.md", "title": "Responses WebSocket events", - "bytes": 16477849, + "bytes": 16483464, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "00e900fb270b918504c0ec203542b317a73b520d1324628a4b2314d731159880", - "sourceUpdatedAt": "2026-08-26T16:49:10Z", + "sha256": "9587401acf3e7a029a3a518abf60631ad2f1b915361eb4a4887676a18df3f78f", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"52f8de43d48ac87aaec128860fa11759\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "etag": "W/\"2d9979a800a39ffaf1cf7878f4334b40\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:23 GMT" }, "https://developers.openai.com/api/reference/resources/uploads.md": { "description": "OpenAI API endpoint reference.", @@ -5486,7 +5533,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"93c8d163129094107269a09bcfba7ebf\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:24 GMT" }, "https://developers.openai.com/api/reference/resources/uploads/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -5500,7 +5547,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"fe4cb0ec2a1ebec0abceec4d077e19b3\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:24 GMT" }, "https://developers.openai.com/api/reference/resources/uploads/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5514,7 +5561,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"3309c403864d6bd4f22fa0466f69bfb5\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:25 GMT" }, "https://developers.openai.com/api/reference/resources/uploads/subresources/parts/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5528,7 +5575,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"61e4a47220d91fc743b9d0fa652a15fe\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:26 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores.md": { "description": "OpenAI API endpoint reference.", @@ -5542,7 +5589,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2721d8af3c988ac111f187172598d2cd\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:07 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:26 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5556,7 +5603,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c3a588ebef12a54f456e5f62a2cf0d5b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:26 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5570,7 +5617,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c07b5585181e4315e858013a5d3602dc\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:27 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5584,7 +5631,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"9c2d62392c6c852a4e999913eeb69694\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:28 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -5598,7 +5645,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"033100befbd67b05405d89e219285bc2\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:28 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/methods/search.md": { "description": "OpenAI API endpoint method reference.", @@ -5612,7 +5659,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"dbc7998c668e8b615b00d408c30f6267\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:28 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -5626,7 +5673,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8b81519589700b2a9fa89dd31587e694\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:29 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches.md": { "description": "OpenAI API endpoint reference.", @@ -5640,7 +5687,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2c212a43ed57af997cd9b53df0ea4bbb\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:30 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/cancel.md": { "description": "OpenAI API endpoint method reference.", @@ -5654,7 +5701,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"93e5e9dda709cb71649bf63fe434ee30\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:30 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5668,7 +5715,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"29c1cd771b401021c1076dc763e5b422\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:31 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/list_files.md": { "description": "OpenAI API endpoint method reference.", @@ -5682,7 +5729,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"8e4578a2d81c844c8da5a475538e5674\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:31 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -5696,7 +5743,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"a0be7fa983179ac868f2e814be9184fe\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:32 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files.md": { "description": "OpenAI API endpoint reference.", @@ -5710,7 +5757,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"197a1c0cde6fc1c43c25dd95c5339e29\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:32 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/content.md": { "description": "OpenAI API endpoint method reference.", @@ -5724,7 +5771,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"144c686aaa16b0dd7abe6f7bc477ef7e\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:33 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5738,7 +5785,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"b7cf868f601526d713dc2f1f6c808a9f\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:34 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5752,7 +5799,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"e7974d3e4b8732affe37249751748806\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:34 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5766,7 +5813,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"de31cf8767a156c6a8450dc1dc03d92b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:35 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -5780,7 +5827,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"10e6629d126b874231eb34219aa3005a\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:35 GMT" }, "https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/update.md": { "description": "OpenAI API endpoint method reference.", @@ -5794,7 +5841,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"44f76d1513c00af2a3c2e7b8d2bd7973\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:36 GMT" }, "https://developers.openai.com/api/reference/resources/videos.md": { "description": "OpenAI API endpoint reference.", @@ -5808,7 +5855,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2e1beabbd9a46a0990852ea3f8fc8031\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:36 GMT" }, "https://developers.openai.com/api/reference/resources/videos/methods/create.md": { "description": "OpenAI API endpoint method reference.", @@ -5822,7 +5869,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"b43705cf102e3463f12a3d0b1befe13b\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:37 GMT" }, "https://developers.openai.com/api/reference/resources/videos/methods/delete.md": { "description": "OpenAI API endpoint method reference.", @@ -5836,7 +5883,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b5434a940489ff23dfe4bd8cedd09025\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:08 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:37 GMT" }, "https://developers.openai.com/api/reference/resources/videos/methods/list.md": { "description": "OpenAI API endpoint method reference.", @@ -5850,7 +5897,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"1aa36734b37ced2166ef6bbd6262a07d\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:38 GMT" }, "https://developers.openai.com/api/reference/resources/videos/methods/retrieve.md": { "description": "OpenAI API endpoint method reference.", @@ -5864,7 +5911,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"2a0d06c0d1d7a40ff495de16af28b3ca\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:38 GMT" }, "https://developers.openai.com/api/reference/resources/webhooks.md": { "description": "OpenAI API streaming event reference.", @@ -5872,13 +5919,13 @@ "section": "reference", "sourceUrl": "https://developers.openai.com/api/reference/resources/webhooks.md", "title": "Webhooks events", - "bytes": 99742, + "bytes": 111646, "firstSeenAt": "2026-08-17T07:50:43Z", - "sha256": "66fa2570578b9ba2b08cab8ec37520cadb38a9fd7b80bfe57e7e78cbbb837f4c", - "sourceUpdatedAt": "2026-08-17T07:50:43Z", + "sha256": "a393ad8e9c6b4551e9a5c60c46109355955169a89d39ce91bed21ba46115cec8", + "sourceUpdatedAt": "2026-08-31T04:05:07Z", "status": "active", - "etag": "W/\"1e41dcf8e69e62464f29bb9ff5910041\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "etag": "W/\"5628ef191182e41a27b904ef5b50cdbf\"", + "sourceLastModified": "Mon, 31 Aug 2026 04:08:39 GMT" }, "https://developers.openai.com/api/reference/resources/webhooks/methods/unwrap.md": { "description": "", @@ -5892,7 +5939,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "\"b995f6a31daaf5708022111d4dfc61ad\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:23 GMT" }, "https://developers.openai.com/api/reference/responses/overview.md": { "description": "", @@ -5906,7 +5953,7 @@ "sourceUpdatedAt": "2026-08-17T07:50:43Z", "status": "active", "etag": "W/\"c4a198a512cabe6cea40e07cf2ca3528\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:39 GMT" }, "https://developers.openai.com/api/reference/workload-identity-federation.md": { "description": "Exchange a trusted workload identity token or an X.509 certificate identity for a short-lived OpenAI API credential.", @@ -5920,9 +5967,9 @@ "sourceUpdatedAt": "2026-08-26T16:49:10Z", "status": "active", "etag": "W/\"178fa0605b8d9c4d9698571e4469af58\"", - "sourceLastModified": "Wed, 26 Aug 2026 14:08:09 GMT" + "sourceLastModified": "Mon, 31 Aug 2026 04:08:40 GMT" } }, "schemaVersion": 1, - "generatedAt": "2026-08-26T16:49:10Z" + "generatedAt": "2026-08-31T04:05:07Z" } diff --git a/docs/en/api/docs/assistants/deep-dive.md b/docs/en/api/docs/assistants/deep-dive.md deleted file mode 100644 index a7e4d12..0000000 --- a/docs/en/api/docs/assistants/deep-dive.md +++ /dev/null @@ -1,1141 +0,0 @@ -# Assistants API deep dive - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -After achieving feature parity in the Responses API, we've deprecated the Assistants API. It will shut down on August 26, 2026. Follow the [migration guide](https://developers.openai.com/platform/assistants/migration) to update your integration. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). - -## Overview - -Don't start a new integration on the Assistants API. We've announced plans to deprecate it soon, as the Responses API now provides the same features and a more elegant integration. - -There are several concepts involved in building an app with the Assistants API, covered below in case it helps with your [migration to Responses](https://developers.openai.com/api/docs/assistants/migration). - -## Creating assistants - -We recommend using OpenAI's [latest models](https://developers.openai.com/api/docs/models) with - the Assistants API for best results and maximum compatibility with tools. - -To get started, creating an Assistant only requires specifying the `model` to use. But you can further customize the behavior of the Assistant: - -1. Use the `instructions` parameter to guide the personality of the Assistant and define its goals. Instructions are similar to system messages in the Chat Completions API. -2. Use the `tools` parameter to give the Assistant access to up to 128 tools. You can give it access to OpenAI built-in tools like `code_interpreter` and `file_search`, or call a third-party tools via a `function` calling. -3. Use the `tool_resources` parameter to give the tools like `code_interpreter` and `file_search` access to files. Files are uploaded using the `File` [upload endpoint](https://developers.openai.com/api/reference/resources/files/methods/create) and must have the `purpose` set to `assistants` to be used with this API. - -For example, to create an Assistant that can create data visualization based on a `.csv` file, first upload a file. - -```javascript -const file = await openai.files.create({ - file: fs.createReadStream("revenue-forecast.csv"), - purpose: "assistants", -}); -``` - -```python -file = client.files.create( - file=open("revenue-forecast.csv", "rb"), purpose="assistants" -) -``` - -```go -input, err := os.Open("revenue-forecast.csv") -if err != nil { - panic(err) -} -defer input.Close() -file, err := client.Files.New(context.Background(), openai.FileNewParams{ - File: input, - Purpose: openai.FilePurposeAssistants, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.files.FileCreateParams; -import com.openai.models.files.FilePurpose; -import java.nio.file.Path; - -var file = - client - .files() - .create( - FileCreateParams.builder() - .file(Path.of(System.getenv("OPENAI_EXAMPLE_FILE_PATH"))) - .purpose(FilePurpose.ASSISTANTS) - .build()); - -System.out.println(file.id()); -``` - -```ruby -require "openai" -require "pathname" - -client = OpenAI::Client.new -file = Pathname("revenue-forecast.csv") -uploaded = client.files.create(file: file, purpose: :assistants) -puts(uploaded.id) -``` - -```bash -curl https://api.openai.com/v1/files \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -F purpose="assistants" \ - -F file="@revenue-forecast.csv" -``` - - -Then, create the Assistant with the `code_interpreter` tool enabled and provide the file as a resource to the tool. - -```javascript -const assistant = await openai.beta.assistants.create({ - name: "Data visualizer", - description: - "You are great at creating beautiful data visualizations. You analyze data present in .csv files, understand trends, and come up with data visualizations relevant to those trends. You also share a brief text summary of the trends observed.", - model: "gpt-4o", - tools: [{ type: "code_interpreter" }], - tool_resources: { - code_interpreter: { - file_ids: [file.id], - }, - }, -}); -``` - -```python -assistant = client.beta.assistants.create( - name="Data visualizer", - description="You are great at creating beautiful data visualizations. You analyze data present in .csv files, understand trends, and come up with data visualizations relevant to those trends. You also share a brief text summary of the trends observed.", - model="gpt-4o", - tools=[{"type": "code_interpreter"}], - tool_resources={"code_interpreter": {"file_ids": [file.id]}}, -) -``` - -```go -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Name: openai.String("Data visualizer"), - Description: openai.String("You are great at creating beautiful data visualizations. You analyze data present in .csv files, understand trends, and come up with data visualizations relevant to those trends. You also share a brief text summary of the trends observed."), - Model: shared.ChatModelGPT4o, - Tools: []openai.AssistantToolUnionParam{{OfCodeInterpreter: &openai.CodeInterpreterToolParam{}}}, - ToolResources: openai.BetaAssistantNewParamsToolResources{ - CodeInterpreter: openai.BetaAssistantNewParamsToolResourcesCodeInterpreter{FileIDs: []string{"file-BK7bzQj3FfZFXr7DbL6xJwfo"}}, - }, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.AssistantCreateParams; -import com.openai.models.beta.assistants.CodeInterpreterTool; - -String fileId = "file-BK7bzQj3FfZFXr7DbL6xJwfo"; - -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .name("Data visualizer") - .model("gpt-4o") - .description( - "You are great at creating beautiful data visualizations. You analyze data" - + " present in .csv files, understand trends, and come up with data" - + " visualizations relevant to those trends. You also share a brief text" - + " summary of the trends observed.") - .addTool(CodeInterpreterTool.builder().build()) - .toolResources( - AssistantCreateParams.ToolResources.builder() - .codeInterpreter( - AssistantCreateParams.ToolResources.CodeInterpreter.builder() - .addFileId(fileId) - .build()) - .build()) - .build()); - -System.out.println(assistant.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.create( - name: "Data visualizer", - model: "gpt-4o", - instructions: "Analyze CSV data, create relevant visualizations, and summarize the trends.", - tools: [{type: :code_interpreter}], - tool_resources: { - code_interpreter: {file_ids: ["file-BK7bzQj3FfZFXr7DbL6xJwfo"]} - } -) -puts(assistant.id) -``` - -```bash -curl https://api.openai.com/v1/assistants \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "name": "Data visualizer", - "description": "You are great at creating beautiful data visualizations. You analyze data present in .csv files, understand trends, and come up with data visualizations relevant to those trends. You also share a brief text summary of the trends observed.", - "model": "gpt-4o", - "tools": [{"type": "code_interpreter"}], - "tool_resources": { - "code_interpreter": { - "file_ids": ["file-BK7bzQj3FfZFXr7DbL6xJwfo"] - } - } - }' -``` - - -You can attach a maximum of 20 files to `code_interpreter` and 10,000 files to `file_search` (using `vector_store` [objects](https://developers.openai.com/api/reference/resources/vector_stores)). For vector stores created starting in November 2025, the `file_search` limit is 100,000,000 files. - -Each file can be at most 512 MB in size and have a maximum of 5,000,000 tokens. By default, each project can store up to 2.5 TB of files total. There is no organization-wide storage limit. You can reach out to our support team to increase this limit. - -## Managing Threads and Messages - -Threads and Messages represent a conversation session between an Assistant and a user. There is a limit of 100,000 Messages per Thread. Once the size of the Messages exceeds the context window of the model, the Thread will attempt to smartly truncate messages, before fully dropping the ones it considers the least important. - -You can create a Thread with an initial list of Messages like this: - -```javascript -const thread = await openai.beta.threads.create({ - messages: [ - { - role: "user", - content: "Create 3 data visualizations based on the trends in this file.", - attachments: [ - { - file_id: file.id, - tools: [{ type: "code_interpreter" }], - }, - ], - }, - ], -}); -``` - -```python -thread = client.beta.threads.create( - messages=[ - { - "role": "user", - "content": "Create 3 data visualizations based on the trends in this file.", - "attachments": [ - {"file_id": file.id, "tools": [{"type": "code_interpreter"}]} - ], - } - ] -) -``` - -```go -thread, err := client.Beta.Threads.New(context.Background(), openai.BetaThreadNewParams{ - Messages: []openai.BetaThreadNewParamsMessage{{ - Role: "user", - Content: openai.BetaThreadNewParamsMessageContentUnion{ - OfString: openai.String("Create 3 data visualizations based on the trends in this file."), - }, - Attachments: []openai.BetaThreadNewParamsMessageAttachment{{ - FileID: openai.String("file-ACq8OjcLQm2eIG0BvRM4z5qX"), - Tools: []openai.BetaThreadNewParamsMessageAttachmentToolUnion{{OfCodeInterpreter: &openai.CodeInterpreterToolParam{}}}, - }}, - }}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.CodeInterpreterTool; -import com.openai.models.beta.threads.ThreadCreateParams; - -String fileId = "file-ACq8OjcLQm2eIG0BvRM4z5qX"; - -var thread = - client - .beta() - .threads() - .create( - ThreadCreateParams.builder() - .addMessage( - ThreadCreateParams.Message.builder() - .role(ThreadCreateParams.Message.Role.USER) - .content( - "Create 3 data visualizations based on the trends in this file.") - .addAttachment( - ThreadCreateParams.Message.Attachment.builder() - .fileId(fileId) - .addTool(CodeInterpreterTool.builder().build()) - .build()) - .build()) - .build()); - -System.out.println(thread.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -thread = client.beta.threads.create( - messages: [{ - role: :user, - content: "Create 3 data visualizations based on the trends in this file.", - attachments: [{ - file_id: "file-ACq8OjcLQm2eIG0BvRM4z5qX", - tools: [{type: :code_interpreter}] - }] - }] -) -puts(thread.id) -``` - -```bash -curl https://api.openai.com/v1/threads \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "messages": [ - { - "role": "user", - "content": "Create 3 data visualizations based on the trends in this file.", - "attachments": [ - { - "file_id": "file-ACq8OjcLQm2eIG0BvRM4z5qX", - "tools": [{"type": "code_interpreter"}] - } - ] - } - ] - }' -``` - - -Messages can contain text, images, or file attachment. Message `attachments` are helper methods that add files to a thread's `tool_resources`. You can also choose to add files to the `thread.tool_resources` directly. - -### Creating image input content - -Message content can contain either external image URLs or File IDs uploaded via the [File API](https://developers.openai.com/api/reference/resources/files/methods/create). Only [models](https://developers.openai.com/api/docs/models) with Vision support can accept image input. Supported image content types include png, jpg, gif, and webp. When creating image files, pass `purpose="vision"` to allow you to later download and display the input content. Projects are limited to 2.5 TB total file storage, and there is no organization-wide storage limit. Please contact us to request a limit increase. - -Tools cannot access image content unless specified. To pass image files to Code Interpreter, add the file ID in the message `attachments` list to allow the tool to read and analyze the input. Image URLs cannot be downloaded in Code Interpreter today. - -```javascript -import fs from "fs"; - -const file = await openai.files.create({ - file: fs.createReadStream("myimage.png"), - purpose: "vision", -}); -const thread = await openai.beta.threads.create({ - messages: [ - { - role: "user", - content: [ - { - type: "text", - text: "What is the difference between these images?", - }, - { - type: "image_url", - image_url: { - url: "https://openai-documentation.vercel.app/images/cat_and_otter.png", - }, - }, - { - type: "image_file", - image_file: { file_id: file.id }, - }, - ], - }, - ], -}); -``` - -```python -file = client.files.create(file=open("myimage.png", "rb"), purpose="vision") -thread = client.beta.threads.create( - messages=[ - { - "role": "user", - "content": [ - { - "type": "text", - "text": "What is the difference between these images?", - }, - { - "type": "image_url", - "image_url": { - "url": "https://openai-documentation.vercel.app/images/cat_and_otter.png" - }, - }, - {"type": "image_file", "image_file": {"file_id": file.id}}, - ], - } - ] -) -``` - -```go -image, err := os.Open("myimage.png") -if err != nil { - panic(err) -} -defer image.Close() -file, err := client.Files.New(context.Background(), openai.FileNewParams{ - File: image, - Purpose: openai.FilePurposeVision, -}) -if err != nil { - panic(err) -} -thread, err := client.Beta.Threads.New(context.Background(), openai.BetaThreadNewParams{ - Messages: []openai.BetaThreadNewParamsMessage{{ - Role: "user", - Content: openai.BetaThreadNewParamsMessageContentUnion{OfArrayOfContentParts: []openai.MessageContentPartParamUnion{ - openai.MessageContentPartParamOfText("What is the difference between these images?"), - openai.MessageContentPartParamOfImageURL(openai.ImageURLParam{URL: "https://openai-documentation.vercel.app/images/cat_and_otter.png"}), - openai.MessageContentPartParamOfImageFile(openai.ImageFileParam{FileID: file.ID}), - }}, - }}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.ThreadCreateParams; -import com.openai.models.beta.threads.messages.ImageFile; -import com.openai.models.beta.threads.messages.ImageFileContentBlock; -import com.openai.models.beta.threads.messages.ImageUrl; -import com.openai.models.beta.threads.messages.ImageUrlContentBlock; -import com.openai.models.beta.threads.messages.MessageContentPartParam; -import com.openai.models.beta.threads.messages.TextContentBlockParam; -import com.openai.models.files.FileCreateParams; -import com.openai.models.files.FilePurpose; -import java.nio.file.Path; -import java.util.List; - -var file = - client - .files() - .create( - FileCreateParams.builder() - .file(Path.of(System.getenv("OPENAI_EXAMPLE_FILE_PATH"))) - .purpose(FilePurpose.VISION) - .build()); - -var imageUrl = - ImageUrl.builder() - .url("https://openai-documentation.vercel.app/images/cat_and_otter.png") - .build(); -var thread = - client - .beta() - .threads() - .create( - ThreadCreateParams.builder() - .addMessage( - ThreadCreateParams.Message.builder() - .role(ThreadCreateParams.Message.Role.USER) - .content( - ThreadCreateParams.Message.Content.ofArrayOfContentParts( - List.of( - MessageContentPartParam.ofText( - TextContentBlockParam.builder() - .text( - "What is the difference between these images?") - .build()), - MessageContentPartParam.ofImageUrl( - ImageUrlContentBlock.builder() - .imageUrl(imageUrl) - .build()), - MessageContentPartParam.ofImageFile( - ImageFileContentBlock.builder() - .imageFile( - ImageFile.builder().fileId(file.id()).build()) - .build())))) - .build()) - .build()); - -System.out.println(thread.id()); -``` - -```ruby -require "openai" -require "pathname" - -client = OpenAI::Client.new -file = client.files.create( - file: Pathname("myimage.png"), - purpose: :vision -) -thread = client.beta.threads.create( - messages: [{ - role: :user, - content: [ - {type: :text, text: "What is the difference between these images?"}, - { - type: :image_url, - image_url: {url: "https://openai-documentation.vercel.app/images/cat_and_otter.png"} - }, - {type: :image_file, image_file: {file_id: file.id}} - ] - }] -) -puts(thread.id) -``` - -```bash -# Upload a file with an "vision" purpose -curl https://api.openai.com/v1/files \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -F purpose="vision" \ - -F file="@/path/to/myimage.png" - -## Pass the file ID in the content - -curl https://api.openai.com/v1/threads \ --H "Authorization: Bearer $OPENAI_API_KEY" \ --H "Content-Type: application/json" \ --H "OpenAI-Beta: assistants=v2" \ --d '{ -"messages": [ -{ -"role": "user", -"content": [ -{ -"type": "text", -"text": "What is the difference between these images?" -}, -{ -"type": "image_url", -"image_url": {"url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"} -}, -{ -"type": "image_file", -"image_file": {"file_id": file.id} -} -] -} -] -}' -``` - - -#### Low or high fidelity image understanding - -By controlling the `detail` parameter, which has three options, `low`, `high`, or `auto`, you have control over how the model processes the image and generates its textual understanding. - -- `low` will enable the "low res" mode. The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 85 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail. -- `high` will enable "high res" mode, which first allows the model to see the low res image and then creates detailed crops of input images based on the input image size. Use the [pricing calculator](https://openai.com/api/pricing/) to see token counts for various image sizes. - -```javascript -const thread = await openai.beta.threads.create({ - messages: [ - { - role: "user", - content: [ - { - type: "text", - text: "What is this an image of?", - }, - { - type: "image_url", - image_url: { - url: "https://openai-documentation.vercel.app/images/cat_and_otter.png", - detail: "high", - }, - }, - ], - }, - ], -}); -``` - -```python -thread = client.beta.threads.create( - messages=[ - { - "role": "user", - "content": [ - {"type": "text", "text": "What is this an image of?"}, - { - "type": "image_url", - "image_url": { - "url": "https://openai-documentation.vercel.app/images/cat_and_otter.png", - "detail": "high", - }, - }, - ], - } - ] -) -``` - -```go -thread, err := client.Beta.Threads.New(context.Background(), openai.BetaThreadNewParams{ - Messages: []openai.BetaThreadNewParamsMessage{{ - Role: "user", - Content: openai.BetaThreadNewParamsMessageContentUnion{OfArrayOfContentParts: []openai.MessageContentPartParamUnion{ - openai.MessageContentPartParamOfText("What is this an image of?"), - openai.MessageContentPartParamOfImageURL(openai.ImageURLParam{ - URL: "https://openai-documentation.vercel.app/images/cat_and_otter.png", - Detail: openai.ImageURLDetailHigh, - }), - }}, - }}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.ThreadCreateParams; -import com.openai.models.beta.threads.messages.ImageUrl; -import com.openai.models.beta.threads.messages.ImageUrlContentBlock; -import com.openai.models.beta.threads.messages.MessageContentPartParam; -import com.openai.models.beta.threads.messages.TextContentBlockParam; -import java.util.List; - -var thread = - client - .beta() - .threads() - .create( - ThreadCreateParams.builder() - .addMessage( - ThreadCreateParams.Message.builder() - .role(ThreadCreateParams.Message.Role.USER) - .content( - ThreadCreateParams.Message.Content.ofArrayOfContentParts( - List.of( - MessageContentPartParam.ofText( - TextContentBlockParam.builder() - .text("What is this an image of?") - .build()), - MessageContentPartParam.ofImageUrl( - ImageUrlContentBlock.builder() - .imageUrl( - ImageUrl.builder() - .url( - "https://openai-documentation.vercel.app/images/cat_and_otter.png") - .detail(ImageUrl.Detail.HIGH) - .build()) - .build())))) - .build()) - .build()); - -System.out.println(thread.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -thread = client.beta.threads.create( - messages: [{ - role: :user, - content: [ - {type: :text, text: "What is this an image of?"}, - { - type: :image_url, - image_url: { - url: "https://openai-documentation.vercel.app/images/cat_and_otter.png", - detail: :high - } - } - ] - }] -) -puts(thread.id) -``` - -```bash -curl https://api.openai.com/v1/threads \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "messages": [ - { - "role": "user", - "content": [ - { - "type": "text", - "text": "What is this an image of?" - }, - { - "type": "image_url", - "image_url": { - "url": "https://openai-documentation.vercel.app/images/cat_and_otter.png", - "detail": "high" - } - }, - ] - } - ] - }' -``` - - -### Context window management - -The Assistants API automatically manages the truncation to ensure it stays within the model's maximum context length. You can customize this behavior by specifying the maximum tokens you'd like a run to utilize and/or the maximum number of recent messages you'd like to include in a run. - -#### Max Completion and Max Prompt Tokens - -To control the token usage in a single Run, set `max_prompt_tokens` and `max_completion_tokens` when creating the Run. These limits apply to the total number of tokens used in all completions throughout the Run's lifecycle. - -For example, initiating a Run with `max_prompt_tokens` set to 500 and `max_completion_tokens` set to 1000 means the first completion will truncate the thread to 500 tokens and cap the output at 1000 tokens. If only 200 prompt tokens and 300 completion tokens are used in the first completion, the second completion will have available limits of 300 prompt tokens and 700 completion tokens. - -If a completion reaches the `max_completion_tokens` limit, the Run will terminate with a status of `incomplete`, and details will be provided in the `incomplete_details` field of the Run object. - -When using the File Search tool, we recommend setting the max_prompt_tokens to - no less than 20,000. For longer conversations or multiple interactions with - File Search, consider increasing this limit to 50,000, or ideally, removing - the max_prompt_tokens limits altogether to get the highest quality results. - -#### Truncation Strategy - -You may also specify a truncation strategy to control how your thread should be rendered into the model's context window. -Using a truncation strategy of type `auto` will use OpenAI's default truncation strategy. Using a truncation strategy of type `last_messages` will allow you to specify the number of the most recent messages to include in the context window. - -### Message annotations - -Messages created by Assistants may contain [`annotations`](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages#messages/object-content) within the `content` array of the object. Annotations provide information around how you should annotate the text in the Message. - -There are two types of Annotations: - -1. `file_citation`: File citations are created by the [`file_search`](https://developers.openai.com/api/docs/assistants/tools/file-search) tool and define references to a specific file that was uploaded and used by the Assistant to generate the response. -2. `file_path`: File path annotations are created by the [`code_interpreter`](https://developers.openai.com/api/docs/assistants/tools/code-interpreter) tool and contain references to the files generated by the tool. - -When annotations are present in the Message object, you'll see illegible model-generated substrings in the text that you should replace with the annotations. These strings may look something like `【13†source】` or `sandbox:/mnt/data/file.csv`. Here’s an example python code snippet that replaces these strings with the annotations. - -```python -import os -from pathlib import Path - -thread_id = os.environ["OPENAI_THREAD_ID"] -message_id = os.environ["OPENAI_MESSAGE_ID"] -downloads = Path("downloads") -downloads.mkdir(exist_ok=True) - -# Retrieve the message object -message = client.beta.threads.messages.retrieve( - thread_id=thread_id, - message_id=message_id, -) - -# Extract the message content - -message_content = message.content[0].text -annotations = message_content.annotations -citations = [] - -# Iterate over the annotations and add footnotes - -for index, annotation in enumerate(annotations): - # Replace the text with a footnote. - message_content.value = message_content.value.replace( - annotation.text, f" [{index}]" - ) - - # Gather citations based on annotation attributes - if file_citation := getattr(annotation, "file_citation", None): - cited_file = client.files.retrieve(file_citation.file_id) - citations.append(f"[{index}] {file_citation.quote} from {cited_file.filename}") - elif file_path := getattr(annotation, "file_path", None): - cited_file = client.files.retrieve(file_path.file_id) - file_content = client.files.content(file_path.file_id) - output_path = downloads / Path(cited_file.filename).name - output_path.write_bytes(file_content.read()) - citations.append(f"[{index}] Downloaded {output_path}") - -# Add footnotes to the end of the message before displaying to user - -message_content.value += "\n" + "\n".join(citations) -``` - -```go -message, err := client.Beta.Threads.Messages.Get(context.Background(), "thread_abc123", "msg_abc123") -if err != nil { - panic(err) -} -if len(message.Content) == 0 || message.Content[0].Type != "text" { - panic("message does not contain text") -} -messageContent := message.Content[0].AsText().Text -citations := make([]string, 0, len(messageContent.Annotations)) -for index, annotation := range messageContent.Annotations { - messageContent.Value = strings.ReplaceAll(messageContent.Value, annotation.Text, fmt.Sprintf(" [%d]", index)) - switch annotation.Type { - case "file_citation": - citation := annotation.AsFileCitation() - file, err := client.Files.Get(context.Background(), citation.FileCitation.FileID) - if err != nil { - panic(err) - } - citations = append(citations, fmt.Sprintf("[%d] %s", index, file.Filename)) - case "file_path": - filePath := annotation.AsFilePath() - file, err := client.Files.Get(context.Background(), filePath.FilePath.FileID) - if err != nil { - panic(err) - } - response, err := client.Files.Content(context.Background(), filePath.FilePath.FileID) - if err != nil { - panic(err) - } - defer response.Body.Close() - if err := os.MkdirAll("downloads", 0o755); err != nil { - panic(err) - } - outputPath := filepath.Join("downloads", filepath.Base(file.Filename)) - output, err := os.Create(outputPath) - if err != nil { - panic(err) - } - if _, err := io.Copy(output, response.Body); err != nil { - output.Close() - panic(err) - } - if err := output.Close(); err != nil { - panic(err) - } - citations = append(citations, fmt.Sprintf("[%d] Downloaded %s", index, outputPath)) - } -} -messageContent.Value += "\n" + strings.Join(citations, "\n") -fmt.Println(messageContent.Value) -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.messages.MessageRetrieveParams; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.util.ArrayList; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -String messageId = "msg_abc123"; - -String threadId = "thread_abc123"; - -var message = - client - .beta() - .threads() - .messages() - .retrieve(messageId, MessageRetrieveParams.builder().threadId(threadId).build()); - -var text = - message.content().stream() - .flatMap(content -> content.text().stream()) - .findFirst() - .orElseThrow(() -> new IllegalStateException("No text content returned")) - .text(); -String rendered = text.value(); -var references = new ArrayList(); -for (int index = 0; index < text.annotations().size(); index++) { - var annotation = text.annotations().get(index); - if (annotation.isFileCitation()) { - var citation = annotation.asFileCitation(); - rendered = - rendered.replaceFirst( - Pattern.quote(citation.text()), Matcher.quoteReplacement(" [" + index + "]")); - var file = client.files().retrieve(citation.fileCitation().fileId()); - references.add("[" + index + "] " + file.filename()); - } else if (annotation.isFilePath()) { - var filePath = annotation.asFilePath(); - rendered = - rendered.replaceFirst( - Pattern.quote(filePath.text()), Matcher.quoteReplacement(" [" + index + "]")); - String fileId = filePath.filePath().fileId(); - var file = client.files().retrieve(fileId); - Path downloads = Path.of("downloads"); - Files.createDirectories(downloads); - Path target = downloads.resolve(Path.of(file.filename()).getFileName()).normalize(); - if (!target.startsWith(downloads)) throw new IllegalArgumentException("Unsafe filename"); - try (var content = client.files().content(fileId)) { - Files.copy(content.body(), target, StandardCopyOption.REPLACE_EXISTING); - } - references.add("[" + index + "] Downloaded " + target); - } -} -System.out.println(rendered); -references.forEach(System.out::println); -``` - -```ruby -require "openai" -require "pathname" - -client = OpenAI::Client.new -message = client.beta.threads.messages.retrieve( - "msg_abc123", - thread_id: "thread_abc123" -) -text_block = message.content.find do |content| - content.is_a?(OpenAI::Models::Beta::Threads::TextContentBlock) -end -unless text_block.is_a?(OpenAI::Models::Beta::Threads::TextContentBlock) - raise "No text content returned" -end -text = text_block.text -downloads = Pathname("downloads") -references = text.annotations.each_with_index.filter_map do |annotation, index| - text.value = text.value.sub(annotation.text, " [#{index}]") - - case annotation - when OpenAI::Models::Beta::Threads::FileCitationAnnotation - file = client.files.retrieve(annotation.file_citation.file_id) - "[#{index}] #{file.filename}" - when OpenAI::Models::Beta::Threads::FilePathAnnotation - file_id = annotation.file_path.file_id - file = client.files.retrieve(file_id) - downloads.mkpath - output_path = downloads.join(Pathname(file.filename).basename) - output_path.binwrite(client.files.content(file_id).read) - "[#{index}] Downloaded #{output_path}" - end -end - -puts(([text.value] + references).join("\n")) -``` - - -## Runs and Run Steps - -When you have all the context you need from your user in the Thread, you can run the Thread with an Assistant of your choice. - -```javascript -const run = await openai.beta.threads.runs.create(thread.id, { - assistant_id: assistant.id, -}); -``` - -```python -run = client.beta.threads.runs.create( - thread_id=thread.id, - assistant_id=assistant.id, -) -``` - -```go -_, err := client.Beta.Threads.Runs.New(context.Background(), "thread_abc123", openai.BetaThreadRunNewParams{ - AssistantID: "asst_ToSF7Gb04YMj8AMMm50ZLLtY", -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.runs.RunCreateParams; - -String threadId = "thread_abc123"; - -String assistantId = "asst_ToSF7Gb04YMj8AMMm50ZLLtY"; - -var run = - client - .beta() - .threads() - .runs() - .create(threadId, RunCreateParams.builder().assistantId(assistantId).build()); - -System.out.println(run.status()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -run = client.beta.threads.runs.create("thread_abc123", assistant_id: "asst_ToSF7Gb04YMj8AMMm50ZLLtY") -puts(run.id) -``` - -```bash -curl https://api.openai.com/v1/threads/THREAD_ID/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_ToSF7Gb04YMj8AMMm50ZLLtY" - }' -``` - - -By default, a Run will use the `model` and `tools` configuration specified in Assistant object, but you can override most of these when creating the Run for added flexibility: - -```javascript -const run = await openai.beta.threads.runs.create(thread.id, { - assistant_id: assistant.id, - model: "gpt-4o", - instructions: "New instructions that override the Assistant instructions", - tools: [{ type: "code_interpreter" }, { type: "file_search" }], -}); -``` - -```python -run = client.beta.threads.runs.create( - thread_id=thread.id, - assistant_id=assistant.id, - model="gpt-4o", - instructions="New instructions that override the Assistant instructions", - tools=[{"type": "code_interpreter"}, {"type": "file_search"}], -) -``` - -```go -_, err := client.Beta.Threads.Runs.New(context.Background(), "thread_abc123", openai.BetaThreadRunNewParams{ - AssistantID: "asst_ToSF7Gb04YMj8AMMm50ZLLtY", - Model: shared.ChatModelGPT4o, - Instructions: openai.String("New instructions that override the Assistant instructions"), - Tools: []openai.AssistantToolUnionParam{ - {OfCodeInterpreter: &openai.CodeInterpreterToolParam{}}, - {OfFileSearch: &openai.FileSearchToolParam{}}, - }, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.CodeInterpreterTool; -import com.openai.models.beta.assistants.FileSearchTool; -import com.openai.models.beta.threads.runs.RunCreateParams; - -String threadId = "thread_abc123"; - -String assistantId = "asst_ToSF7Gb04YMj8AMMm50ZLLtY"; - -var run = - client - .beta() - .threads() - .runs() - .create( - threadId, - RunCreateParams.builder() - .assistantId(assistantId) - .model("gpt-4o") - .instructions("New instructions that override the Assistant instructions") - .addTool(CodeInterpreterTool.builder().build()) - .addTool(FileSearchTool.builder().build()) - .build()); - -System.out.println(run.status()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -run = client.beta.threads.runs.create( - "thread_abc123", - assistant_id: "asst_ToSF7Gb04YMj8AMMm50ZLLtY", - model: "gpt-4o", - instructions: "New instructions that override the Assistant instructions", - tools: [{type: :code_interpreter}, {type: :file_search}] -) -puts(run.id) -``` - -```bash -curl https://api.openai.com/v1/threads/THREAD_ID/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "ASSISTANT_ID", - "model": "gpt-4o", - "instructions": "New instructions that override the Assistant instructions", - "tools": [{"type": "code_interpreter"}, {"type": "file_search"}] - }' -``` - - -Note: `tool_resources` associated with the Assistant cannot be overridden during Run creation. You must use the [modify Assistant](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/update) endpoint to do this. - -#### Run lifecycle - -Run objects can have multiple statuses. - -![Run lifecycle - diagram showing possible status transitions](https://cdn.openai.com/API/docs/images/diagram-run-statuses-v2.png) - -| Status | Definition | -| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `queued` | When Runs are first created or when you complete the `required_action`, they are moved to a queued status. They should almost immediately move to `in_progress`. | -| `in_progress` | While `in_progress`, the Assistant uses the model and tools to perform steps. You can view progress being made by the Run by examining the [Run Steps](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps). | -| `completed` | The Run successfully completed! You can now view all Messages the Assistant added to the Thread, and all the steps the Run took. You can also continue the conversation by adding more user Messages to the Thread and creating another Run. | -| `requires_action` | When using the [Function calling](https://developers.openai.com/api/docs/assistants/tools/function-calling) tool, the Run will move to a `required_action` state once the model determines the names and arguments of the functions to be called. You must then run those functions and [submit the outputs](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs) before the run proceeds. If the outputs are not provided before the `expires_at` timestamp passes (roughly 10 mins past creation), the run will move to an expired status. | -| `expired` | This happens when the function calling outputs were not submitted before `expires_at` and the run expires. Additionally, if the runs take too long to execute and go beyond the time stated in `expires_at`, our systems will expire the run. | -| `cancelling` | You can attempt to cancel an `in_progress` run using the [Cancel Run](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel) endpoint. Once the attempt to cancel succeeds, status of the Run moves to `cancelled`. Cancellation is attempted but not guaranteed. | -| `cancelled` | Run was successfully cancelled. | -| `failed` | You can view the reason for the failure by looking at the `last_error` object in the Run. The timestamp for the failure will be recorded under `failed_at`. | -| `incomplete` | Run ended due to `max_prompt_tokens` or `max_completion_tokens` reached. You can view the specific reason by looking at the `incomplete_details` object in the Run. | - -#### Polling for updates - -If you are not using [streaming](https://developers.openai.com/api/docs/assistants/migration#step-4-create-a-run?context=with-streaming), in order to keep the status of your run up to date, you will have to periodically [retrieve the Run](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve) object. You can check the status of the run each time you retrieve the object to determine what your application should do next. - -You can optionally use Polling Helpers in our [Node](https://github.com/openai/openai-node?tab=readme-ov-file#polling-helpers) and [Python](https://github.com/openai/openai-python?tab=readme-ov-file#polling-helpers) SDKs to help you with this. These helpers will automatically poll the Run object for you and return the Run object when it's in a terminal state. - -#### Thread locks - -When a Run is `in_progress` and not in a terminal state, the Thread is locked. This means that: - -- New Messages cannot be added to the Thread. -- New Runs cannot be created on the Thread. - -#### Run steps - -![Run steps lifecycle - diagram showing possible status transitions](https://cdn.openai.com/API/docs/images/diagram-2.png) - -Run step statuses have the same meaning as Run statuses. - -Most of the interesting detail in the Run Step object lives in the `step_details` field. There can be two types of step details: - -1. `message_creation`: This Run Step is created when the Assistant creates a Message on the Thread. -2. `tool_calls`: This Run Step is created when the Assistant calls a tool. Details around this are covered in the relevant sections of the [Tools](https://developers.openai.com/api/docs/assistants/tools) guide. - -## Data Access Guidance - -Currently, Assistants, Threads, Messages, and Vector Stores created via the API are scoped to the Project they're created in. As such, any person with API key access to that Project is able to read or write Assistants, Threads, Messages, and Runs in the Project. - -We strongly recommend the following data access controls: - -- _Implement authorization._ Before performing reads or writes on Assistants, Threads, Messages, and Vector Stores, ensure that the end-user is authorized to do so. For example, store in your database the object IDs that the end-user has access to, and check it before fetching the object ID with the API. -- _Restrict API key access._ Carefully consider who in your organization should have API keys and be part of a Project. Periodically audit this list. API keys enable a wide range of operations including reading and modifying sensitive information, such as Messages and Files. -- _Create separate accounts._ Consider creating separate Projects for different applications in order to isolate data across multiple applications. \ No newline at end of file diff --git a/docs/en/api/docs/assistants/migration.md b/docs/en/api/docs/assistants/migration.md index 2851bd0..b70d5d5 100644 --- a/docs/en/api/docs/assistants/migration.md +++ b/docs/en/api/docs/assistants/migration.md @@ -2,12 +2,14 @@ > For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. -After achieving feature parity in the Responses API, we've deprecated the Assistants API. It will shut down on August 26, 2026. Follow the [migration guide](https://developers.openai.com/platform/assistants/migration) to update your integration. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). +The Assistants API was officially sunset on August 26, 2026, and is no longer available. Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses) for new integrations. -We're moving from the Assistants API to the new [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses) for a simpler and more flexible mental model. +Thank you to everyone who used the Assistants API. We appreciate everything you built and the feedback you shared along the way. + +Use this guide to migrate your integration to the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses). Responses are simpler—send input items and get output items back. With the Responses API, you also get better performance and new features like [deep research](https://developers.openai.com/api/docs/guides/deep-research), [MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp), and [computer use](https://developers.openai.com/api/docs/guides/tools-computer-use). This change also lets you manage conversations instead of passing back `previous_response_id`. @@ -277,9 +279,9 @@ Reusable prompt objects are also being deprecated. If you use this migration ### 2. Move new user chats over to conversations and responses -We will not provide an automated tool for migrating Threads to Conversations. Instead, we recommend migrating new user threads onto conversations and migrating older ones as necessary. +Start new chats with the Conversations API and Responses API. To preserve earlier conversation history, use messages already stored by your application. -Here's an example for how you might backfill a thread: +The example below shows how thread history could be migrated before the sunset. The Assistants API call that retrieves thread messages no longer works; use your stored messages instead. ```python import os @@ -454,6 +456,62 @@ puts(handle_message.call( Responses API +```javascript +import express from "express"; +import OpenAI from "openai"; + +const app = express(); +const client = new OpenAI(); +const conversationsBySession = new Map(); + +app.use(express.json()); + +app.post("/messages", async (request, response) => { + const { content, session_id: sessionId } = request.body ?? {}; + if ( + typeof content !== "string" || + !content.trim() || + typeof sessionId !== "string" || + !sessionId.trim() + ) { + response.status(400).json({ + error: "content and session_id must be non-empty strings.", + }); + return; + } + + let conversationIdPromise = conversationsBySession.get(sessionId); + + if (!conversationIdPromise) { + conversationIdPromise = client.conversations + .create() + .then((conversation) => conversation.id) + .catch((error) => { + conversationsBySession.delete(sessionId); + throw error; + }); + conversationsBySession.set(sessionId, conversationIdPromise); + } + const conversationId = await conversationIdPromise; + + const promptId = process.env.OPENAI_PROMPT_ID; + if (!promptId) { + response.status(500).json({ error: "OPENAI_PROMPT_ID is required." }); + return; + } + + const result = await client.responses.create({ + prompt: { id: promptId }, + input: [{ role: "user", content }], + conversation: conversationId, + }); + + response.json({ content: result.output_text }); +}); + +app.listen(Number(process.env.OPENAI_EXAMPLE_PORT ?? 8000), "127.0.0.1"); +``` + ```python conversations_by_session: dict[str, str] = {} diff --git a/docs/en/api/docs/assistants/tools.md b/docs/en/api/docs/assistants/tools.md deleted file mode 100644 index ca00ee7..0000000 --- a/docs/en/api/docs/assistants/tools.md +++ /dev/null @@ -1,45 +0,0 @@ -# Assistants API tools - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -After achieving feature parity in the Responses API, we've deprecated the Assistants API. It will shut down on August 26, 2026. Follow the [migration guide](https://developers.openai.com/platform/assistants/migration) to update your integration. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). - -## Overview - -Assistants created using the Assistants API can be equipped with tools that allow them to perform more complex tasks or interact with your application. -We provide built-in tools for assistants, but you can also define your own tools to extend their capabilities using Function Calling. - -The Assistants API currently supports the following tools: - - - -File Search - - - - Built-in RAG tool to process and search through files - - - - -Code Interpreter - - - - Write and run python code, process files and diverse data - - - - -Function Calling - - - - Use your own custom functions to interact with your application - - - -## Next steps - -- See the API reference to [submit tool outputs](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs) -- Build a tool-using assistant with our [Quickstart app](https://github.com/openai/openai-assistants-quickstart) \ No newline at end of file diff --git a/docs/en/api/docs/assistants/tools/code-interpreter.md b/docs/en/api/docs/assistants/tools/code-interpreter.md deleted file mode 100644 index 37a9e45..0000000 --- a/docs/en/api/docs/assistants/tools/code-interpreter.md +++ /dev/null @@ -1,615 +0,0 @@ -# Assistants Code Interpreter - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -After achieving feature parity in the Responses API, we've deprecated the Assistants API. It will shut down on August 26, 2026. Follow the [migration guide](https://developers.openai.com/platform/assistants/migration) to update your integration. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). - -## Overview - -Code Interpreter allows Assistants to write and run Python code in a sandboxed execution environment. This tool can process files with diverse data and formatting, and generate files with data and images of graphs. Code Interpreter allows your Assistant to run code iteratively to solve challenging code and math problems. When your Assistant writes code that fails to run, it can iterate on this code by attempting to run different code until the code execution succeeds. - -See a quickstart of how to get started with Code Interpreter [here](https://developers.openai.com/api/docs/assistants/migration#step-1-create-an-assistant?context=with-streaming). - -## How it works - -Code Interpreter is charged at $0.03 per session. If your Assistant calls Code Interpreter simultaneously in two different threads (e.g., one thread per end-user), two Code Interpreter sessions are created. Each session is active by default for one hour, which means that you only pay for one session per if users interact with Code Interpreter in the same thread for up to one hour. - -### Enabling Code Interpreter - -Pass `code_interpreter` in the `tools` parameter of the Assistant object to enable Code Interpreter: - -```javascript -const assistant = await openai.beta.assistants.create({ - instructions: - "You are a personal math tutor. When asked a math question, write and run code to answer the question.", - model: "gpt-4o", - tools: [{ type: "code_interpreter" }], -}); -``` - -```python -assistant = client.beta.assistants.create( - instructions="You are a personal math tutor. When asked a math question, write and run code to answer the question.", - model="gpt-4o", - tools=[{"type": "code_interpreter"}], -) -``` - -```go -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Instructions: openai.String("You are a personal math tutor. When asked a math question, write and run code to answer the question."), - Model: shared.ChatModelGPT4o, - Tools: []openai.AssistantToolUnionParam{{OfCodeInterpreter: &openai.CodeInterpreterToolParam{}}}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.AssistantCreateParams; -import com.openai.models.beta.assistants.CodeInterpreterTool; - -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .model("gpt-4o") - .instructions( - "You are a personal math tutor. When asked a math question, write and run" - + " code to answer the question.") - .addTool(CodeInterpreterTool.builder().build()) - .build()); - -System.out.println(assistant.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.create( - model: "gpt-4o", - tools: [{type: :code_interpreter}] -) -puts(assistant.id) -``` - -```bash -curl https://api.openai.com/v1/assistants \ - -u :$OPENAI_API_KEY \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -d '{ - "instructions": "You are a personal math tutor. When asked a math question, write and run code to answer the question.", - "tools": [ - { "type": "code_interpreter" } - ], - "model": "gpt-4o" - }' -``` - - -The model then decides when to invoke Code Interpreter in a Run based on the nature of the user request. This behavior can be promoted by prompting in the Assistant's `instructions` (e.g., “write code to solve this problem”). - -### Passing files to Code Interpreter - -Files that are passed at the Assistant level are accessible by all Runs with this Assistant: - -```javascript -// Upload a file with an "assistants" purpose -const file = await openai.files.create({ - file: fs.createReadStream("mydata.csv"), - purpose: "assistants", -}); - -// Create an assistant using the file ID -const assistant = await openai.beta.assistants.create({ - instructions: - "You are a personal math tutor. When asked a math question, write and run code to answer the question.", - model: "gpt-4o", - tools: [{ type: "code_interpreter" }], - tool_resources: { - code_interpreter: { - file_ids: [file.id], - }, - }, -}); -``` - -```python -# Upload a file with an "assistants" purpose -file = client.files.create(file=open("mydata.csv", "rb"), purpose="assistants") - -# Create an assistant using the file ID -assistant = client.beta.assistants.create( - instructions="You are a personal math tutor. When asked a math question, write and run code to answer the question.", - model="gpt-4o", - tools=[{"type": "code_interpreter"}], - tool_resources={"code_interpreter": {"file_ids": [file.id]}}, -) -``` - -```go -input, err := os.Open("mydata.csv") -if err != nil { - panic(err) -} -defer input.Close() -file, err := client.Files.New(context.Background(), openai.FileNewParams{ - File: input, - Purpose: openai.FilePurposeAssistants, -}) -if err != nil { - panic(err) -} -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Instructions: openai.String("You are a personal math tutor. When asked a math question, write and run code to answer the question."), - Model: shared.ChatModelGPT4o, - Tools: []openai.AssistantToolUnionParam{{OfCodeInterpreter: &openai.CodeInterpreterToolParam{}}}, - ToolResources: openai.BetaAssistantNewParamsToolResources{ - CodeInterpreter: openai.BetaAssistantNewParamsToolResourcesCodeInterpreter{FileIDs: []string{file.ID}}, - }, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.AssistantCreateParams; -import com.openai.models.beta.assistants.CodeInterpreterTool; -import com.openai.models.files.FileCreateParams; -import com.openai.models.files.FilePurpose; -import java.nio.file.Path; - -var file = - client - .files() - .create( - FileCreateParams.builder() - .file(Path.of(System.getenv("OPENAI_EXAMPLE_FILE_PATH"))) - .purpose(FilePurpose.ASSISTANTS) - .build()); -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .model("gpt-4o") - .instructions("When asked a math question, write and run code to answer it.") - .addTool(CodeInterpreterTool.builder().build()) - .toolResources( - AssistantCreateParams.ToolResources.builder() - .codeInterpreter( - AssistantCreateParams.ToolResources.CodeInterpreter.builder() - .addFileId(file.id()) - .build()) - .build()) - .build()); -System.out.println(assistant.id()); -``` - -```ruby -require "openai" -require "pathname" - -client = OpenAI::Client.new -file = client.files.create( - file: Pathname("revenue-forecast.csv"), - purpose: :assistants -) -assistant = client.beta.assistants.create( - model: "gpt-4o", - instructions: "When asked a math question, write and run code to answer it.", - tools: [{type: :code_interpreter}], - tool_resources: { - code_interpreter: {file_ids: [file.id]} - } -) -puts(assistant.id) -``` - -```bash -# Upload a file with an "assistants" purpose -curl https://api.openai.com/v1/files \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -F purpose="assistants" \ - -F file="@/path/to/mydata.csv" - -# Create an assistant using the file ID -curl https://api.openai.com/v1/assistants \ - -u :$OPENAI_API_KEY \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -d '{ - "instructions": "You are a personal math tutor. When asked a math question, write and run code to answer the question.", - "tools": [{"type": "code_interpreter"}], - "model": "gpt-4o", - "tool_resources": { - "code_interpreter": { - "file_ids": ["file-BK7bzQj3FfZFXr7DbL6xJwfo"] - } - } - }' -``` - - -Files can also be passed at the Thread level. These files are only accessible in the specific Thread. Upload the File using the [File upload](https://developers.openai.com/api/reference/resources/files/methods/create) endpoint and then pass the File ID as part of the Message creation request: - -```javascript -const thread = await openai.beta.threads.create({ - messages: [ - { - role: "user", - content: "I need to solve the equation `3x + 11 = 14`. Can you help me?", - attachments: [ - { - file_id: file.id, - tools: [{ type: "code_interpreter" }], - }, - ], - }, - ], -}); -``` - -```python -thread = client.beta.threads.create( - messages=[ - { - "role": "user", - "content": "I need to solve the equation `3x + 11 = 14`. Can you help me?", - "attachments": [ - {"file_id": file.id, "tools": [{"type": "code_interpreter"}]} - ], - } - ] -) -``` - -```go -thread, err := client.Beta.Threads.New(context.Background(), openai.BetaThreadNewParams{ - Messages: []openai.BetaThreadNewParamsMessage{{ - Role: "user", - Content: openai.BetaThreadNewParamsMessageContentUnion{OfString: openai.String("I need to solve the equation `3x + 11 = 14`. Can you help me?")}, - Attachments: []openai.BetaThreadNewParamsMessageAttachment{{ - FileID: openai.String("file-ACq8OjcLQm2eIG0BvRM4z5qX"), - Tools: []openai.BetaThreadNewParamsMessageAttachmentToolUnion{{OfCodeInterpreter: &openai.CodeInterpreterToolParam{}}}, - }}, - }}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.CodeInterpreterTool; -import com.openai.models.beta.threads.ThreadCreateParams; - -String fileId = "file-ACq8OjcLQm2eIG0BvRM4z5qX"; - -var thread = - client - .beta() - .threads() - .create( - ThreadCreateParams.builder() - .addMessage( - ThreadCreateParams.Message.builder() - .role(ThreadCreateParams.Message.Role.USER) - .content( - "I need to solve the equation `3x + 11 = 14`. Can you help me?") - .addAttachment( - ThreadCreateParams.Message.Attachment.builder() - .fileId(fileId) - .addTool(CodeInterpreterTool.builder().build()) - .build()) - .build()) - .build()); - -System.out.println(thread.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -thread = client.beta.threads.create( - messages: [{ - role: :user, - content: "I need to solve the equation `3x + 11 = 14`. Can you help me?", - attachments: [{ - file_id: "file-ACq8OjcLQm2eIG0BvRM4z5qX", - tools: [{type: :code_interpreter}] - }] - }] -) -puts(thread.id) -``` - -```bash -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -u :$OPENAI_API_KEY \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -d '{ - "role": "user", - "content": "I need to solve the equation `3x + 11 = 14`. Can you help me?", - "attachments": [ - { - "file_id": "file-ACq8OjcLQm2eIG0BvRM4z5qX", - "tools": [{"type": "code_interpreter"}] - } - ] - }' -``` - - -Files have a maximum size of 512 MB. Code Interpreter supports a variety of file formats including `.csv`, `.pdf`, `.json` and many more. More details on the file extensions (and their corresponding MIME-types) supported can be found in the [Supported files](#supported-files) section below. - -### Reading images and files generated by Code Interpreter - -Code Interpreter in the API also outputs files, such as generating image diagrams, CSVs, and PDFs. There are two types of files that are generated: - -1. Images -2. Data files (e.g. a `csv` file with data generated by the Assistant) - -When Code Interpreter generates an image, you can look up and download this file in the `file_id` field of the Assistant Message response: - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1698964262, - "thread_id": "thread_abc123", - "role": "assistant", - "content": [ - { - "type": "image_file", - "image_file": { - "file_id": "file-abc123" - } - } - ] - # ... -} -``` - -The file content can then be downloaded by passing the file ID to the Files API: - -```javascript -import fs from "fs"; -import OpenAI from "openai"; - -const openai = new OpenAI(); - -async function main() { - const response = await openai.files.content("file-abc123"); - - // Extract the binary data from the Response object - const image_data = await response.arrayBuffer(); - - // Convert the binary data to a Buffer - const image_data_buffer = Buffer.from(image_data); - - // Save the image to a specific location - fs.writeFileSync("./my-image.png", image_data_buffer); -} - -main(); -``` - -```python -import os - -from openai import OpenAI - -file_id = os.environ["OPENAI_FILE_ID"] -client = OpenAI() - -image_data = client.files.content(file_id) -image_data_bytes = image_data.read() - -with open("./my-image.png", "wb") as file: - file.write(image_data_bytes) -``` - -```go -response, err := client.Files.Content(context.Background(), "file-abc123") -if err != nil { - panic(err) -} -defer response.Body.Close() -output, err := os.Create("./my-image.png") -if err != nil { - panic(err) -} -if _, err := io.Copy(output, response.Body); err != nil { - output.Close() - panic(err) -} -if err := output.Close(); err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.core.http.HttpResponse; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; - -String fileId = "file-abc123"; - -try (HttpResponse content = client.files().content(fileId)) { - Files.copy(content.body(), Path.of("my-image.png"), StandardCopyOption.REPLACE_EXISTING); -} -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -image = client.files.content("file-abc123") -File.binwrite("my-image.png", image.read) -``` - -```bash -curl https://api.openai.com/v1/files/file-abc123/content \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - --output image.png -``` - - -When Code Interpreter references a file path (e.g., ”Download this csv file”), file paths are listed as annotations. You can convert these annotations into links to download the file: - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699073585, - "thread_id": "thread_abc123", - "role": "assistant", - "content": [ - { - "type": "text", - "text": { - "value": "The rows of the CSV file have been shuffled and saved to a new CSV file. You can download the shuffled CSV file from the following link:\\n\\n[Download Shuffled CSV File](sandbox:/mnt/data/shuffled_file.csv)", - "annotations": [ - { - "type": "file_path", - "text": "sandbox:/mnt/data/shuffled_file.csv", - "start_index": 167, - "end_index": 202, - "file_path": { - "file_id": "file-abc123" - } - } - ... -``` - -### Input and output logs of Code Interpreter - -By listing the steps of a Run that called Code Interpreter, you can inspect the code `input` and `outputs` logs of Code Interpreter: - -```javascript -const runSteps = await openai.beta.threads.runs.steps.list(run.id, { - thread_id: thread.id, -}); -``` - -```python -import os - -thread_id = os.environ["OPENAI_THREAD_ID"] -run_id = os.environ["OPENAI_RUN_ID"] - -run_steps = client.beta.threads.runs.steps.list( - thread_id=thread_id, - run_id=run_id, -) -``` - -```go -runSteps, err := client.Beta.Threads.Runs.Steps.List(context.Background(), "thread_abc123", "run_abc123", openai.BetaThreadRunStepListParams{}) -if err != nil { - panic(err) -} -fmt.Println(runSteps.Data) -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -steps = client.beta.threads.runs.steps.list( - "run_abc123", - thread_id: "thread_abc123" -) -puts(steps.data) -``` - -```bash -curl https://api.openai.com/v1/threads/thread_abc123/runs/RUN_ID/steps \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ -``` - - -```bash -{ - "object": "list", - "data": [ - { - "id": "step_abc123", - "object": "thread.run.step", - "type": "tool_calls", - "run_id": "run_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "step_details": { - "type": "tool_calls", - "tool_calls": [ - { - "type": "code", - "code": { - "input": "# Calculating 2 + 2\\nresult = 2 + 2\\nresult", - "outputs": [ - { - "type": "logs", - "logs": "4" - } - ... - } -``` - -## Supported files - -| File format | MIME type | -| ----------- | --------------------------------------------------------------------------- | -| `.c` | `text/x-c` | -| `.cs` | `text/x-csharp` | -| `.cpp` | `text/x-c++` | -| `.csv` | `text/csv` | -| `.doc` | `application/msword` | -| `.docx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | -| `.html` | `text/html` | -| `.java` | `text/x-java` | -| `.json` | `application/json` | -| `.md` | `text/markdown` | -| `.pdf` | `application/pdf` | -| `.php` | `text/x-php` | -| `.pptx` | `application/vnd.openxmlformats-officedocument.presentationml.presentation` | -| `.py` | `text/x-python` | -| `.py` | `text/x-script.python` | -| `.rb` | `text/x-ruby` | -| `.tex` | `text/x-tex` | -| `.txt` | `text/plain` | -| `.css` | `text/css` | -| `.js` | `text/javascript` | -| `.sh` | `application/x-sh` | -| `.ts` | `application/typescript` | -| `.csv` | `application/csv` | -| `.jpeg` | `image/jpeg` | -| `.jpg` | `image/jpeg` | -| `.gif` | `image/gif` | -| `.pkl` | `application/octet-stream` | -| `.png` | `image/png` | -| `.tar` | `application/x-tar` | -| `.xlsx` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | -| `.xml` | `application/xml or "text/xml"` | -| `.zip` | `application/zip` | \ No newline at end of file diff --git a/docs/en/api/docs/assistants/tools/file-search.md b/docs/en/api/docs/assistants/tools/file-search.md deleted file mode 100644 index 7b9b106..0000000 --- a/docs/en/api/docs/assistants/tools/file-search.md +++ /dev/null @@ -1,1368 +0,0 @@ -# Assistants File Search - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -After achieving feature parity in the Responses API, we've deprecated the Assistants API. It will shut down on August 26, 2026. Follow the [migration guide](https://developers.openai.com/platform/assistants/migration) to update your integration. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). - -## Overview - -File Search augments the Assistant with knowledge from outside its model, such as proprietary product information or documents provided by your users. OpenAI automatically parses and chunks your documents, creates and stores the embeddings, and use both vector and keyword search to retrieve relevant content to answer user queries. - -## Quickstart - -In this example, we’ll create an assistant that can help answer questions about companies’ financial statements. - -### Step 1: Create a new Assistant with File Search Enabled - -Create a new assistant with `file_search` enabled in the `tools` parameter of the Assistant. - -```javascript -import OpenAI from "openai"; -const openai = new OpenAI(); - -async function main() { - const assistant = await openai.beta.assistants.create({ - name: "Financial Analyst Assistant", - instructions: - "You are an expert financial analyst. Use you knowledge base to answer questions about audited financial statements.", - model: "gpt-4o", - tools: [{ type: "file_search" }], - }); -} - -main(); -``` - -```python -from openai import OpenAI - -client = OpenAI() - -assistant = client.beta.assistants.create( - name="Financial Analyst Assistant", - instructions="You are an expert financial analyst. Use you knowledge base to answer questions about audited financial statements.", - model="gpt-4o", - tools=[{"type": "file_search"}], -) -``` - -```go -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Name: openai.String("Financial Analyst Assistant"), - Instructions: openai.String("You are an expert financial analyst. Use your knowledge base to answer questions about audited financial statements."), - Model: shared.ChatModelGPT4o, - Tools: []openai.AssistantToolUnionParam{{OfFileSearch: &openai.FileSearchToolParam{}}}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.AssistantCreateParams; -import com.openai.models.beta.assistants.FileSearchTool; - -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .model("gpt-4o") - .name("Financial Analyst Assistant") - .instructions( - "You are an expert financial analyst. Use you knowledge base to answer" - + " questions about audited financial statements.") - .addTool(FileSearchTool.builder().build()) - .build()); - -System.out.println(assistant.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.create( - model: "gpt-4o", - name: "Financial Analyst Assistant", - instructions: "Use the knowledge base to answer questions about audited financial statements.", - tools: [{type: :file_search}] -) -puts(assistant.id) -``` - -```bash -curl https://api.openai.com/v1/assistants \ --H "Content-Type: application/json" \ --H "Authorization: Bearer $OPENAI_API_KEY" \ --H "OpenAI-Beta: assistants=v2" \ --d '{ -"name": "Financial Analyst Assistant", -"instructions": "You are an expert financial analyst. Use you knowledge base to answer questions about audited financial statements.", -"tools": [{"type": "file_search"}], -"model": "gpt-4o" -}' -``` - - -Once the `file_search` tool is enabled, the model decides when to retrieve content based on user messages. - -### Step 2: Upload files and add them to a Vector Store - -To access your files, the `file_search` tool uses the Vector Store object. -Upload your files and create a Vector Store to contain them. -Once the Vector Store is created, you should poll its status until all files are out of the `in_progress` state to -ensure that all content has finished processing. The SDK provides helpers to uploading and polling in one shot. - -```javascript -const fileStreams = [ - fs.createReadStream("edgar/goog-10k.pdf"), - fs.createReadStream("edgar/brka-10k.txt"), -]; - -// Create a vector store including our two files. -let vectorStore = await openai.vectorStores.create({ - name: "Financial Statement", -}); - -await openai.vectorStores.fileBatches.uploadAndPoll(vectorStore.id, { - files: fileStreams, -}); -``` - -```python -# Create a vector store called "Financial Statements" -vector_store = client.vector_stores.create(name="Financial Statements") - -# Ready the files for upload to OpenAI - -file_paths = ["edgar/goog-10k.pdf", "edgar/brka-10k.txt"] -file_streams = [open(path, "rb") for path in file_paths] - -# Use the upload and poll SDK helper to upload the files, add them to the vector store, - -# and poll the status of the file batch for completion. - -file_batch = client.vector_stores.file_batches.upload_and_poll( - vector_store_id=vector_store.id, files=file_streams -) - -# You can print the status and the file counts of the batch to see the result of this operation. - -print(file_batch.status) -print(file_batch.file_counts) -``` - - -### Step 3: Update the assistant to use the new Vector Store - -To make the files accessible to your assistant, update the assistant’s `tool_resources` with the new `vector_store` id. - -```javascript -await openai.beta.assistants.update(assistant.id, { - tool_resources: { file_search: { vector_store_ids: [vectorStore.id] } }, -}); -``` - -```python -assistant = client.beta.assistants.update( - assistant_id=assistant.id, - tool_resources={"file_search": {"vector_store_ids": [vector_store.id]}}, -) -``` - -```go -_, err := client.Beta.Assistants.Update(context.Background(), "asst_abc123", openai.BetaAssistantUpdateParams{ - ToolResources: openai.BetaAssistantUpdateParamsToolResources{ - FileSearch: openai.BetaAssistantUpdateParamsToolResourcesFileSearch{ - VectorStoreIDs: []string{"vs_abc123"}, - }, - }, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.AssistantUpdateParams; -import com.openai.models.beta.assistants.FileSearchTool; - -String assistantId = "asst_abc123"; - -String vectorStoreId = "vs_abc123"; - -var assistant = - client - .beta() - .assistants() - .update( - assistantId, - AssistantUpdateParams.builder() - .addTool(FileSearchTool.builder().build()) - .toolResources( - AssistantUpdateParams.ToolResources.builder() - .fileSearch( - AssistantUpdateParams.ToolResources.FileSearch.builder() - .addVectorStoreId(vectorStoreId) - .build()) - .build()) - .build()); - -System.out.println(assistant.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.update( - "asst_abc123", - tool_resources: { - file_search: {vector_store_ids: ["vs_abc123"]} - } -) -puts(assistant.id) -``` - - -### Step 4: Create a thread - -You can also attach files as Message attachments on your thread. Doing so will create another `vector_store` associated with the thread, or, if there is already a vector store attached to this thread, attach the new files to the existing thread vector store. When you create a Run on this thread, the file search tool will query both the `vector_store` from your assistant and the `vector_store` on the thread. - -In this example, the user attached a copy of Apple’s latest 10-K filing. - -```javascript -// A user wants to attach a file to a specific message, let's upload it. -const aapl10k = await openai.files.create({ - file: fs.createReadStream("edgar/aapl-10k.pdf"), - purpose: "assistants", -}); - -const thread = await openai.beta.threads.create({ - messages: [ - { - role: "user", - content: - "How many shares of AAPL were outstanding at the end of October 2023?", - // Attach the new file to the message. - attachments: [{ file_id: aapl10k.id, tools: [{ type: "file_search" }] }], - }, - ], -}); - -// The thread now has a vector store in its tool resources. -console.log(thread.tool_resources?.file_search); -``` - -```python -# Upload the user provided file to OpenAI -message_file = client.files.create( - file=open("edgar/aapl-10k.pdf", "rb"), purpose="assistants" -) - -# Create a thread and attach the file to the message - -thread = client.beta.threads.create( - messages=[ - { - "role": "user", - "content": "How many shares of AAPL were outstanding at the end of of October 2023?", # Attach the new file to the message. - "attachments": [ - {"file_id": message_file.id, "tools": [{"type": "file_search"}]} - ], - } - ] -) - -# The thread now has a vector store with that file in its tool resources. - -print(thread.tool_resources.file_search) -``` - - -Vector stores created using message attachments have a default expiration policy of 7 days after they were last active (defined as the last time the vector store was part of a run). This default exists to help you manage your vector storage costs. You can override these expiration policies at any time. Learn more [here](#managing-costs-with-expiration-policies). - -### Step 5: Create a run and check the output - -Now, create a Run and observe that the model uses the File Search tool to provide a response to the user’s question. - - - -With streaming - -```javascript -const stream = openai.beta.threads.runs - .stream(thread.id, { - assistant_id: assistant.id, - }) - .on("textCreated", () => console.log("assistant >")) - .on("toolCallCreated", (event) => console.log("assistant " + event.type)) - .on("messageDone", async (event) => { - if (event.content[0].type === "text") { - const { text } = event.content[0]; - const { annotations } = text; - const citations = []; - - let index = 0; - for (const annotation of annotations) { - text.value = text.value.replace(annotation.text, `[${index}]`); - if (annotation.type === "file_citation") { - const citedFile = await openai.files.retrieve( - annotation.file_citation.file_id - ); - citations.push(`[${index}]${citedFile.filename}`); - } - index++; - } - - console.log(text.value); - console.log(citations.join("\n")); - } - }); -``` - -```python -from typing_extensions import override -from openai import AssistantEventHandler, OpenAI - -client = OpenAI() - -class EventHandler(AssistantEventHandler): - @override - def on_text_created(self, text) -> None: - print("\nassistant > ", end="", flush=True) - - @override - def on_tool_call_created(self, tool_call): - print(f"\nassistant > {tool_call.type}\n", flush=True) - - @override - def on_message_done(self, message) -> None: - # print a citation to the file searched - message_content = message.content[0].text - annotations = message_content.annotations - citations = [] - for index, annotation in enumerate(annotations): - message_content.value = message_content.value.replace( - annotation.text, f"[{index}]" - ) - if file_citation := getattr(annotation, "file_citation", None): - cited_file = client.files.retrieve(file_citation.file_id) - citations.append(f"[{index}] {cited_file.filename}") - - print(message_content.value) - print("\n".join(citations)) - -# Then, we use the stream SDK helper - -# with the EventHandler class to create the Run - -# and stream the response. - -with client.beta.threads.runs.stream( - thread_id=thread.id, - assistant_id=assistant.id, - instructions="Please address the user as Jane Doe. The user has a premium account.", - event_handler=EventHandler(), -) as stream: - stream.until_done() -``` - - - - - - -Without streaming - -```javascript -const run = await openai.beta.threads.runs.createAndPoll(thread.id, { - assistant_id: assistant.id, -}); - -const messages = await openai.beta.threads.messages.list(thread.id, { - run_id: run.id, -}); - -const message = messages.data.pop(); -if (message.content[0].type === "text") { - const { text } = message.content[0]; - const { annotations } = text; - const citations = []; - - let index = 0; - for (const annotation of annotations) { - text.value = text.value.replace(annotation.text, `[${index}]`); - if (annotation.type === "file_citation") { - const citedFile = await openai.files.retrieve( - annotation.file_citation.file_id - ); - citations.push(`[${index}]${citedFile.filename}`); - } - index++; - } - - console.log(text.value); - console.log(citations.join("\n")); -} -``` - -```python -# Use the create and poll SDK helper to create a run and poll the status of -# the run until it's in a terminal state. - -run = client.beta.threads.runs.create_and_poll( - thread_id=thread.id, - assistant_id=assistant.id, -) - -messages = list( - client.beta.threads.messages.list(thread_id=thread.id, run_id=run.id) -) - -message_content = messages[0].content[0].text -annotations = message_content.annotations -citations = [] -for index, annotation in enumerate(annotations): - message_content.value = message_content.value.replace( - annotation.text, f"[{index}]" - ) - if file_citation := getattr(annotation, "file_citation", None): - cited_file = client.files.retrieve(file_citation.file_id) - citations.append(f"[{index}] {cited_file.filename}") - -print(message_content.value) -print("\n".join(citations)) -``` - - - -Your new assistant will query both attached vector stores (one containing `goog-10k.pdf` and `brka-10k.txt`, and the other containing `aapl-10k.pdf`) and return this result from `aapl-10k.pdf`. - -To retrieve the contents of the file search results that were used by the model, use the `include` query parameter and provide a value of `step_details.tool_calls[*].file_search.results[*].content` in the format `?include[]=step_details.tool_calls[*].file_search.results[*].content`. - ---- - -## How it works - -The `file_search` tool implements several retrieval best practices out of the box to help you extract the right data from your files and augment the model’s responses. The `file_search` tool: - -- Rewrites user queries to optimize them for search. -- Breaks down complex user queries into multiple searches it can run in parallel. -- Runs both keyword and semantic searches across both assistant and thread vector stores. -- Reranks search results to pick the most relevant ones before generating the final response. - -By default, the `file_search` tool uses the following settings but these can be [configured](#customizing-file-search-settings) to suit your needs: - -- Chunk size: 800 tokens -- Chunk overlap: 400 tokens -- Embedding model: `text-embedding-3-large` at 256 dimensions -- Maximum number of chunks added to context: 20 (could be fewer) -- Ranker: `auto` (OpenAI will choose which ranker to use) -- Score threshold: 0 minimum ranking score - -**Known Limitations** - -We have a few known limitations we're working on adding support for in the coming months: - -1. Support for deterministic pre-search filtering using custom metadata. -2. Support for parsing images within documents (including images of charts, graphs, tables etc.) -3. Support for retrievals over structured file formats (like `csv` or `jsonl`). -4. Better support for summarization — the tool today is optimized for search queries. - -## Vector stores - -Vector Store objects give the File Search tool the ability to search your files. Adding a file to a `vector_store` automatically parses, chunks, embeds and stores the file in a vector database that's capable of both keyword and semantic search. Each `vector_store` can hold up to 10,000 files. For vector stores created starting in November 2025, this limit is 100,000,000 files. Vector stores can be attached to both Assistants and Threads. Today, you can attach at most one vector store to an assistant and at most one vector store to a thread. - -#### Creating vector stores and adding files - -You can create a vector store and add files to it in a single API call: - -```javascript -const vectorStore = await openai.vectorStores.create({ - name: "Product Documentation", - file_ids: [ - "file_1", - "file_2", - "file_3", - "file_4", - "file_5", - ], -}); -``` - -```python -vector_store = client.vector_stores.create( - name="Product Documentation", - file_ids=[ - "file_1", - "file_2", - "file_3", - "file_4", - "file_5", - ], -) -``` - -```go -vectorStore, err := client.VectorStores.New(context.Background(), openai.VectorStoreNewParams{ - Name: openai.String("Product Documentation"), - FileIDs: []string{"file_1", "file_2", "file_3", "file_4", "file_5"}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.vectorstores.VectorStoreCreateParams; - -String fileId1 = "file_1"; - -String fileId2 = "file_2"; - -String fileId3 = "file_3"; - -String fileId4 = "file_4"; - -String fileId5 = "file_5"; - -var store = - client - .vectorStores() - .create( - VectorStoreCreateParams.builder() - .name("Product Documentation") - .addFileId(fileId1) - .addFileId(fileId2) - .addFileId(fileId3) - .addFileId(fileId4) - .addFileId(fileId5) - .build()); - -System.out.println(store.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -store = client.vector_stores.create( - name: "Product Documentation", - file_ids: [ - "file_1", - "file_2", - "file_3", - "file_4", - "file_5" - ] -) -puts(store.id) -``` - - -Adding files to vector stores is an async operation. To ensure the operation is complete, we recommend that you use the 'create and poll' helpers in our official SDKs. If you're not using the SDKs, you can retrieve the `vector_store` object and monitor its [`file_counts`](https://developers.openai.com/api/reference/resources/vector_stores#vector-stores/object-file_counts) property to see the result of the file ingestion operation. - -Files can also be added to a vector store after it's created by [creating vector store files](https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create). - -Adding files is rate limited per vector store ID. Requests to `/vector_stores/{vector_store_id}/files` and `/vector_stores/{vector_store_id}/file_batches` share a per-vector-store limit of 300 requests per minute. - -```javascript -const file = await openai.vectorStores.files.createAndPoll( - "vs_abc123", - { - file_id: "file-abc123", - } -); -``` - -```python -file = client.vector_stores.files.create_and_poll( - vector_store_id="vs_abc123", file_id="file-abc123" -) -``` - -```go -_, err := client.VectorStores.Files.NewAndPoll(context.Background(), "vs_abc123", openai.VectorStoreFileNewParams{ - FileID: "file-abc123", -}, 1000) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.vectorstores.files.FileCreateParams; -import com.openai.models.vectorstores.files.FileRetrieveParams; -import com.openai.models.vectorstores.files.VectorStoreFile; - -String vectorStoreId = "vs_abc123"; -String fileId = "file-abc123"; -var file = - client - .vectorStores() - .files() - .create(vectorStoreId, FileCreateParams.builder().fileId(fileId).build()); -while (file.status().equals(VectorStoreFile.Status.IN_PROGRESS)) { - Thread.sleep(1000); - file = - client - .vectorStores() - .files() - .retrieve( - file.id(), FileRetrieveParams.builder().vectorStoreId(vectorStoreId).build()); -} -System.out.println(file.status()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -file = client.vector_stores.files.create( - "vs_abc123", - file_id: "file-abc123" -) -until [:completed, :failed, :cancelled].include?(file.status) - sleep(1) - file = client.vector_stores.files.retrieve( - file.id, - vector_store_id: "vs_abc123" - ) -end -puts(file.status) -``` - - -Alternatively, you can add several files to a vector store by [creating batches](https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/create) of up to 500 files. - -Batch creation accepts either a simple list of `file_ids` or a `files` array made up of objects with a `file_id` plus optional `attributes` and `chunking_strategy`. Use `files` when you need per-file metadata or chunking settings, and note that `file_ids` and `files` are mutually exclusive in a single request. - -For high-throughput ingestion into one vector store, prefer file batches whenever possible to reduce request volume and improve latency. - -```javascript -const batch = await openai.vectorStores.fileBatches.createAndPoll( - "vs_abc123", - { - files: [ - { - file_id: "file_1", - attributes: { category: "finance" }, - }, - { - file_id: "file_2", - chunking_strategy: { - type: "static", - static: { - max_chunk_size_tokens: 1000, - chunk_overlap_tokens: 200, - }, - }, - }, - ], - } -); -``` - -```python -batch = client.vector_stores.file_batches.create_and_poll( - vector_store_id="vs_abc123", - files=[ - {"file_id": "file_1", "attributes": {"category": "finance"}}, - { - "file_id": "file_2", - "chunking_strategy": { - "type": "static", - "max_chunk_size_tokens": 1000, - "chunk_overlap_tokens": 200, - }, - }, - ], -) -``` - -```go -_, err := client.VectorStores.FileBatches.NewAndPoll(context.Background(), "vs_abc123", openai.VectorStoreFileBatchNewParams{ - Files: []openai.VectorStoreFileBatchNewParamsFile{ - { - FileID: "file_1", - Attributes: map[string]openai.VectorStoreFileBatchNewParamsFileAttributeUnion{ - "category": {OfString: openai.String("finance")}, - }, - }, - { - FileID: "file_2", - ChunkingStrategy: openai.FileChunkingStrategyParamUnion{OfStatic: &openai.StaticFileChunkingStrategyObjectParam{ - Static: openai.StaticFileChunkingStrategyParam{MaxChunkSizeTokens: 1000, ChunkOverlapTokens: 200}, - }}, - }, - }, -}, 1000) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.core.JsonValue; -import com.openai.models.vectorstores.StaticFileChunkingStrategy; -import com.openai.models.vectorstores.filebatches.FileBatchCreateParams; -import com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams; -import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch; - -String vectorStoreId = "vs_abc123"; -String fileId = "file_1"; -String fileId2 = "file_2"; -var first = - FileBatchCreateParams.File.builder() - .fileId(fileId) - .attributes( - FileBatchCreateParams.File.Attributes.builder() - .putAdditionalProperty("category", JsonValue.from("finance")) - .build()) - .build(); -var second = - FileBatchCreateParams.File.builder() - .fileId(fileId2) - .staticChunkingStrategy( - StaticFileChunkingStrategy.builder() - .maxChunkSizeTokens(1000) - .chunkOverlapTokens(200) - .build()) - .build(); - -var batch = - client - .vectorStores() - .fileBatches() - .create( - vectorStoreId, - FileBatchCreateParams.builder().addFile(first).addFile(second).build()); -while (batch.status().equals(VectorStoreFileBatch.Status.IN_PROGRESS)) { - Thread.sleep(1000); - batch = - client - .vectorStores() - .fileBatches() - .retrieve( - batch.id(), - FileBatchRetrieveParams.builder().vectorStoreId(vectorStoreId).build()); -} -System.out.println(batch.status()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -batch = client.vector_stores.file_batches.create( - "vs_abc123", - files: [ - {file_id: "file_1", attributes: {category: "finance"}}, - { - file_id: "file_2", - chunking_strategy: { - type: :static, - max_chunk_size_tokens: 1_000, - chunk_overlap_tokens: 200 - } - } - ] -) -until [:completed, :failed, :cancelled].include?(batch.status) - sleep(1) - batch = client.vector_stores.file_batches.retrieve( - batch.id, - vector_store_id: "vs_abc123" - ) -end -puts(batch.status) -``` - - -Similarly, these files can be removed from a vector store by either: - -- Deleting the [vector store file object](https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/delete) or, -- By deleting the underlying [file object](https://developers.openai.com/api/reference/resources/files/methods/delete) (which removes the file it from all `vector_store` and `code_interpreter` configurations across all assistants and threads in your organization) - -The maximum file size is 512 MB. Each file should contain no more than 5,000,000 tokens per file (computed automatically when you attach a file). - -File Search supports a variety of file formats including `.pdf`, `.md`, and `.docx`. More details on the file extensions (and their corresponding MIME-types) supported can be found in the [Supported files](#supported-files) section below. - -#### Attaching vector stores - -You can attach vector stores to your Assistant or Thread using the `tool_resources` parameter. - -```javascript -const assistant = await openai.beta.assistants.create({ - instructions: - "You are a helpful product support assistant and you answer questions based on the files provided to you.", - model: "gpt-4o", - tools: [{ type: "file_search" }], - tool_resources: { - file_search: { - vector_store_ids: ["vs_1"], - }, - }, -}); - -const thread = await openai.beta.threads.create({ - messages: [{ role: "user", content: "How do I cancel my subscription?" }], - tool_resources: { - file_search: { - vector_store_ids: ["vs_2"], - }, - }, -}); -``` - -```python -assistant = client.beta.assistants.create( - instructions="You are a helpful product support assistant and you answer questions based on the files provided to you.", - model="gpt-4o", - tools=[{"type": "file_search"}], - tool_resources={"file_search": {"vector_store_ids": ["vs_1"]}}, -) - -thread = client.beta.threads.create( - messages=[{"role": "user", "content": "How do I cancel my subscription?"}], - tool_resources={"file_search": {"vector_store_ids": ["vs_2"]}}, -) -``` - -```go -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Instructions: openai.String("You are a helpful product support assistant and you answer questions based on the files provided to you."), - Model: shared.ChatModelGPT4o, - Tools: []openai.AssistantToolUnionParam{{OfFileSearch: &openai.FileSearchToolParam{}}}, - ToolResources: openai.BetaAssistantNewParamsToolResources{ - FileSearch: openai.BetaAssistantNewParamsToolResourcesFileSearch{VectorStoreIDs: []string{"vs_1"}}, - }, -}) -if err != nil { - panic(err) -} -thread, err := client.Beta.Threads.New(context.Background(), openai.BetaThreadNewParams{ - Messages: []openai.BetaThreadNewParamsMessage{{ - Role: "user", - Content: openai.BetaThreadNewParamsMessageContentUnion{OfString: openai.String("How do I cancel my subscription?")}, - }}, - ToolResources: openai.BetaThreadNewParamsToolResources{ - FileSearch: openai.BetaThreadNewParamsToolResourcesFileSearch{VectorStoreIDs: []string{"vs_2"}}, - }, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.assistants.AssistantCreateParams; -import com.openai.models.beta.assistants.FileSearchTool; -import com.openai.models.beta.threads.ThreadCreateParams; - -String vectorStoreId = "vs_1"; - -String vectorStoreId2 = "vs_2"; - -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .model("gpt-4o") - .instructions( - "You are a helpful product support assistant and you answer questions based" - + " on the files provided to you.") - .addTool(FileSearchTool.builder().build()) - .toolResources( - AssistantCreateParams.ToolResources.builder() - .fileSearch( - AssistantCreateParams.ToolResources.FileSearch.builder() - .addVectorStoreId(vectorStoreId) - .build()) - .build()) - .build()); - -var thread = - client - .beta() - .threads() - .create( - ThreadCreateParams.builder() - .addMessage( - ThreadCreateParams.Message.builder() - .role(ThreadCreateParams.Message.Role.USER) - .content("How do I cancel my subscription?") - .build()) - .toolResources( - ThreadCreateParams.ToolResources.builder() - .fileSearch( - ThreadCreateParams.ToolResources.FileSearch.builder() - .addVectorStoreId(vectorStoreId2) - .build()) - .build()) - .build()); - -System.out.println(assistant.id() + " " + thread.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.create( - instructions: "Answer product support questions using the provided files.", - model: "gpt-4o", - tools: [{type: :file_search}], - tool_resources: { - file_search: {vector_store_ids: ["vs_1"]} - } -) -thread = client.beta.threads.create( - messages: [{role: :user, content: "How do I cancel my subscription?"}], - tool_resources: { - file_search: {vector_store_ids: ["vs_2"]} - } -) -puts([assistant.id, thread.id]) -``` - - -You can also attach a vector store to Threads or Assistants after they're created by updating them with the right `tool_resources`. - -#### Ensuring vector store readiness before creating runs - -We highly recommend that you ensure all files in a `vector_store` are fully processed before you create a run. This will ensure that all the data in your `vector_store` is searchable. You can check for `vector_store` readiness by using the polling helpers in our SDKs, or by manually polling the `vector_store` object to ensure the [`status`](https://developers.openai.com/api/reference/resources/vector_stores#vector-stores/object-status) is `completed`. - -As a fallback, we've built a **60 second maximum wait** in the Run object when the **thread’s** vector store contains files that are still being processed. This is to ensure that any files your users upload in a thread a fully searchable before the run proceeds. This fallback wait _does not_ apply to the assistant's vector store. - -#### Customizing File Search settings - -You can customize how the `file_search` tool chunks your data and how many chunks it returns to the model context. - -**Chunking configuration** - -By default, `max_chunk_size_tokens` is set to `800` and `chunk_overlap_tokens` is set to `400`, meaning every file is indexed by being split up into 800-token chunks, with 400-token overlap between consecutive chunks. - -You can adjust this by setting [`chunking_strategy`](https://developers.openai.com/api/reference/resources/vector_stores/subresources/files/methods/create#vector-stores-files-createfile-chunking_strategy) when adding files to the vector store. There are certain limitations to `chunking_strategy`: - -- `max_chunk_size_tokens` must be between 100 and 4096 inclusive. -- `chunk_overlap_tokens` must be non-negative and should not exceed `max_chunk_size_tokens / 2`. - -**Number of chunks** - -By default, the `file_search` tool outputs up to 20 chunks for `gpt-4*` and o-series models and up to 5 chunks for `gpt-3.5-turbo`. You can adjust this by setting [`file_search.max_num_results`](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/create#assistants-createassistant-tools) in the tool when creating the assistant or the run. - -Note that the `file_search` tool may output fewer than this number for a myriad of reasons: - -- The total number of chunks is fewer than `max_num_results`. -- The total token size of all the retrieved chunks exceeds the token "budget" assigned to the `file_search` tool. The `file_search` tool currently has a token budget of: - - 4,000 tokens for `gpt-3.5-turbo` - - 16,000 tokens for `gpt-4*` models - - 16,000 tokens for o-series models - -#### Improve file search result relevance with chunk ranking - -By default, the file search tool will return all search results to the model that it thinks have any level of relevance when generating a response. However, if responses are generated using content that has low relevance, it can lead to lower quality responses. You can adjust this behavior by both inspecting the file search results that are returned when generating responses, and then tuning the behavior of the file search tool's ranker to change how relevant results must be before they are used to generate a response. - -**Inspecting file search chunks** - -The first step in improving the quality of your file search results is inspecting the current behavior of your assistant. Most often, this will involve investigating responses from your assistant that are not not performing well. You can get [granular information about a past run step](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve) using the REST API, specifically using the `include` query parameter to get the file chunks that are being used to generate results. - -Include file search results in response when creating a run - -```javascript -import OpenAI from "openai"; - -const openai = new OpenAI(); - -const runStep = await openai.beta.threads.runs.steps.retrieve("step_abc123", { - thread_id: "thread_abc123", - run_id: "run_abc123", - include: ["step_details.tool_calls[*].file_search.results[*].content"], -}); - -console.log(runStep); -``` - -```python -from openai import OpenAI - -client = OpenAI() - -run_step = client.beta.threads.runs.steps.retrieve( - thread_id="thread_abc123", - run_id="run_abc123", - step_id="step_abc123", - include=["step_details.tool_calls[*].file_search.results[*].content"], -) - -print(run_step) -``` - -```go -runStep, err := client.Beta.Threads.Runs.Steps.Get( - context.Background(), - "thread_abc123", - "run_abc123", - "step_abc123", - openai.BetaThreadRunStepGetParams{Include: []openai.RunStepInclude{ - openai.RunStepIncludeStepDetailsToolCallsFileSearchResultsContent, - }}, -) -if err != nil { - panic(err) -} -fmt.Println(runStep) -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -step = client.beta.threads.runs.steps.retrieve( - "step_abc123", - thread_id: "thread_abc123", - run_id: "run_abc123", - include: ["step_details.tool_calls[*].file_search.results[*].content"] -) -puts(step) -``` - -```bash -curl -g https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123?include[]=step_details.tool_calls[*].file_search.results[*].content \ --H "Authorization: Bearer $OPENAI_API_KEY" \ --H "Content-Type: application/json" \ --H "OpenAI-Beta: assistants=v2" -``` - - -You can then log and inspect the search results used during the run step, and determine whether or not they are consistently relevant to the responses your assistant should generate. - -**Configure ranking options** - -If you have determined that your file search results are not sufficiently relevant to generate high quality responses, you can adjust the settings of the result ranker used to choose which search results should be used to generate responses. You can adjust this setting [`file_search.ranking_options`](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/create#assistants-createassistant-tools) in the tool when **creating the assistant** or **creating the run**. - -The settings you can configure are: - -- `ranker` - Which ranker to use in determining which chunks to use. The available values are `auto`, which uses the latest available ranker, and `default_2024_08_21`. -- `score_threshold` - a ranking between 0.0 and 1.0, with 1.0 being the highest ranking. A higher number will constrain the file chunks used to generate a result to only chunks with a higher possible relevance, at the cost of potentially leaving out relevant chunks. -- `hybrid_search.embedding_weight` (also referred to as `rrf_embedding_weight`) - determines how much weight to give to semantic similarity when combining dense (embedding) and sparse (text) rankings with [reciprocal rank fusion](https://en.wikipedia.org/wiki/Reciprocal_rank_fusion). Increase this weight to favor chunks that are close in embedding space. -- `hybrid_search.text_weight` (also referred to as `rrf_text_weight`) - determines how much weight to give to keyword/text matching when hybrid search is enabled. Increase this weight to favor chunks that share exact terms with the query. - -At least one of `hybrid_search.embedding_weight` or `hybrid_search.text_weight` must be greater than zero when hybrid search is configured. - -#### Managing costs with expiration policies - -The `file_search` tool uses the `vector_stores` object as its resource and you will be billed based on the [size](https://developers.openai.com/api/reference/resources/vector_stores#vector-stores/object-bytes) of the `vector_store` objects created. The size of the vector store object is the sum of all the parsed chunks from your files and their corresponding embeddings. - -You first GB is free and beyond that, usage is billed at $0.10/GB/day of vector storage. There are no other costs associated with vector store operations. - -In order to help you manage the costs associated with these `vector_store` objects, we have added support for expiration policies in the `vector_store` object. You can set these policies when creating or updating the `vector_store` object. - -```javascript -let vectorStore = await openai.vectorStores.create({ - name: "rag-store", - file_ids: [ - "file_1", - "file_2", - "file_3", - "file_4", - "file_5", - ], - expires_after: { - anchor: "last_active_at", - days: 7, - }, -}); -``` - -```python -vector_store = client.vector_stores.create( - name="Product Documentation", - file_ids=[ - "file_1", - "file_2", - "file_3", - "file_4", - "file_5", - ], - expires_after={"anchor": "last_active_at", "days": 7}, -) -``` - -```go -vectorStore, err := client.VectorStores.New(context.Background(), openai.VectorStoreNewParams{ - Name: openai.String("Product Documentation"), - FileIDs: []string{"file_1", "file_2", "file_3", "file_4", "file_5"}, - ExpiresAfter: openai.VectorStoreNewParamsExpiresAfter{Days: 7}, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.core.JsonValue; -import com.openai.models.vectorstores.VectorStoreCreateParams; - -String fileId1 = "file_1"; - -String fileId2 = "file_2"; - -String fileId3 = "file_3"; - -String fileId4 = "file_4"; - -String fileId5 = "file_5"; - -var store = - client - .vectorStores() - .create( - VectorStoreCreateParams.builder() - .name("Product Documentation") - .addFileId(fileId1) - .addFileId(fileId2) - .addFileId(fileId3) - .addFileId(fileId4) - .addFileId(fileId5) - .expiresAfter( - VectorStoreCreateParams.ExpiresAfter.builder() - .anchor(JsonValue.from("last_active_at")) - .days(7) - .build()) - .build()); - -System.out.println(store.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -store = client.vector_stores.create( - name: "Product Documentation", - file_ids: [ - "file_1", - "file_2", - "file_3", - "file_4", - "file_5" - ], - expires_after: {anchor: :last_active_at, days: 7} -) -puts(store.id) -``` - - -**Thread vector stores have default expiration policies** - -Vector stores created using thread helpers (like [`tool_resources.file_search.vector_stores`](https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/create#threads-createthread-tool_resources) in Threads or [message.attachments](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create#messages-createmessage-attachments) in Messages) have a default expiration policy of 7 days after they were last active (defined as the last time the vector store was part of a run). - -When a vector store expires, runs on that thread will fail. To fix this, you can simply recreate a new `vector_store` with the same files and reattach it to the thread. - -```javascript -const fileIds = []; -for await (const file of openai.vectorStores.files.list( - "vs_expired" -)) { - fileIds.push(file.id); -} - -const vectorStore = await openai.vectorStores.create({ - name: "rag-store", -}); -await openai.beta.threads.update("thread_abc123", { - tool_resources: { file_search: { vector_store_ids: [vectorStore.id] } }, -}); - -for (const fileBatch of _.chunk(fileIds, 100)) { - await openai.vectorStores.fileBatches.create(vectorStore.id, { - file_ids: fileBatch, - }); -} -``` - -```python -all_files = list(client.vector_stores.files.list("vs_expired")) - -vector_store = client.vector_stores.create(name="rag-store") -client.beta.threads.update( - "thread_abc123", - tool_resources={"file_search": {"vector_store_ids": [vector_store.id]}}, -) - -for file_batch in chunked(all_files, 100): - client.vector_stores.file_batches.create_and_poll( - vector_store_id=vector_store.id, - file_ids=[file.id for file in file_batch], - ) -``` - -```go -pager := client.VectorStores.Files.ListAutoPaging(context.Background(), "vs_expired", openai.VectorStoreFileListParams{}) -fileIDs := make([]string, 0) -for pager.Next() { - fileIDs = append(fileIDs, pager.Current().ID) -} -if err := pager.Err(); err != nil { - panic(err) -} -vectorStore, err := client.VectorStores.New(context.Background(), openai.VectorStoreNewParams{ - Name: openai.String("rag-store"), -}) -if err != nil { - panic(err) -} -_, err = client.Beta.Threads.Update(context.Background(), "thread_abc123", openai.BetaThreadUpdateParams{ - ToolResources: openai.BetaThreadUpdateParamsToolResources{ - FileSearch: openai.BetaThreadUpdateParamsToolResourcesFileSearch{VectorStoreIDs: []string{vectorStore.ID}}, - }, -}) -if err != nil { - panic(err) -} -for start := 0; start < len(fileIDs); start += 100 { - end := min(start+100, len(fileIDs)) - if _, err := client.VectorStores.FileBatches.NewAndPoll(context.Background(), vectorStore.ID, openai.VectorStoreFileBatchNewParams{ - FileIDs: fileIDs[start:end], - }, 1000); err != nil { - panic(err) - } -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.ThreadUpdateParams; -import com.openai.models.vectorstores.VectorStoreCreateParams; -import com.openai.models.vectorstores.filebatches.FileBatchCreateParams; -import com.openai.models.vectorstores.filebatches.FileBatchRetrieveParams; -import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch; -import java.util.ArrayList; - -String vectorStoreId = "vs_expired"; -String threadId = "thread_abc123"; -var files = client.vectorStores().files().list(vectorStoreId).autoPager(); -var replacement = - client.vectorStores().create(VectorStoreCreateParams.builder().name("rag-store").build()); -client - .beta() - .threads() - .update( - threadId, - ThreadUpdateParams.builder() - .toolResources( - ThreadUpdateParams.ToolResources.builder() - .fileSearch( - ThreadUpdateParams.ToolResources.FileSearch.builder() - .addVectorStoreId(replacement.id()) - .build()) - .build()) - .build()); - -var fileIds = new ArrayList(); -for (var file : files) fileIds.add(file.id()); -for (int offset = 0; offset < fileIds.size(); offset += 100) { - var ids = fileIds.subList(offset, Math.min(offset + 100, fileIds.size())); - var batch = - client - .vectorStores() - .fileBatches() - .create(replacement.id(), FileBatchCreateParams.builder().fileIds(ids).build()); - while (batch.status().equals(VectorStoreFileBatch.Status.IN_PROGRESS)) { - Thread.sleep(1000); - batch = - client - .vectorStores() - .fileBatches() - .retrieve( - batch.id(), - FileBatchRetrieveParams.builder().vectorStoreId(replacement.id()).build()); - } - if (!batch.status().equals(VectorStoreFileBatch.Status.COMPLETED)) { - throw new IllegalStateException("File batch ended with status: " + batch.status()); - } -} -System.out.println(replacement.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -files = client.vector_stores.files.list("vs_expired") -store = client.vector_stores.create(name: "rag-store") -client.beta.threads.update( - "thread_abc123", - tool_resources: {file_search: {vector_store_ids: [store.id]}} -) -file_ids = [] -files.auto_paging_each { |file| file_ids << file.id } -file_ids.each_slice(100) do |batch_ids| - batch = client.vector_stores.file_batches.create(store.id, file_ids: batch_ids) - while batch.status == OpenAI::VectorStores::VectorStoreFileBatch::Status::IN_PROGRESS - sleep(2) - batch = client.vector_stores.file_batches.retrieve( - batch.id, - vector_store_id: store.id - ) - end - unless batch.status == OpenAI::VectorStores::VectorStoreFileBatch::Status::COMPLETED - raise "File batch ended with status: #{batch.status}" - end -end -puts(store.id) -``` - - -## Supported files - -_For `text/` MIME types, the encoding must be one of `utf-8`, `utf-16`, or `ascii`._ - -{/* Keep this table in sync with RETRIEVAL_SUPPORTED_EXTENSIONS in the agentapi service */} - -| File format | MIME type | -| ----------- | --------------------------------------------------------------------------- | -| `.c` | `text/x-c` | -| `.cpp` | `text/x-c++` | -| `.cs` | `text/x-csharp` | -| `.css` | `text/css` | -| `.doc` | `application/msword` | -| `.docx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | -| `.go` | `text/x-golang` | -| `.html` | `text/html` | -| `.java` | `text/x-java` | -| `.js` | `text/javascript` | -| `.json` | `application/json` | -| `.md` | `text/markdown` | -| `.pdf` | `application/pdf` | -| `.php` | `text/x-php` | -| `.pptx` | `application/vnd.openxmlformats-officedocument.presentationml.presentation` | -| `.py` | `text/x-python` | -| `.py` | `text/x-script.python` | -| `.rb` | `text/x-ruby` | -| `.sh` | `application/x-sh` | -| `.tex` | `text/x-tex` | -| `.ts` | `application/typescript` | -| `.txt` | `text/plain` | \ No newline at end of file diff --git a/docs/en/api/docs/assistants/tools/function-calling.md b/docs/en/api/docs/assistants/tools/function-calling.md deleted file mode 100644 index 491d876..0000000 --- a/docs/en/api/docs/assistants/tools/function-calling.md +++ /dev/null @@ -1,1084 +0,0 @@ -# Assistants Function Calling - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -After achieving feature parity in the Responses API, we've deprecated the Assistants API. It will shut down on August 26, 2026. Follow the [migration guide](https://developers.openai.com/platform/assistants/migration) to update your integration. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). - -## Overview - -Similar to the Chat Completions API, the Assistants API supports function calling. Function calling allows you to describe functions to the Assistants API and have it intelligently return the functions that need to be called along with their arguments. - -## Quickstart - -In this example, we'll create a weather assistant and define two functions, -`get_current_temperature` and `get_rain_probability`, as tools that the Assistant can call. -Depending on the user query, the model will invoke parallel function calling if using our -latest models released on or after Nov 6, 2023. -In our example that uses parallel function calling, we will ask the Assistant what the weather in -San Francisco is like today and the chances of rain. We also show how to output the Assistant's response with streaming. - -With the launch of Structured Outputs, you can now use the parameter `strict: - true` when using function calling with the Assistants API. For more - information, refer to the [Function calling - guide](https://developers.openai.com/api/docs/guides/function-calling#strict-mode). Please note that - Structured Outputs are not supported in the Assistants API when using vision. - -### Step 1: Define functions - -When creating your assistant, you will first define the functions under the `tools` param of the assistant. - -```javascript -const assistant = await client.beta.assistants.create({ - model: "gpt-4o", - instructions: - "You are a weather bot. Use the provided functions to answer questions.", - tools: [ - { - type: "function", - function: { - name: "getCurrentTemperature", - description: "Get the current temperature for a specific location", - parameters: { - type: "object", - properties: { - location: { - type: "string", - description: "The city and state, e.g., San Francisco, CA", - }, - unit: { - type: "string", - enum: ["Celsius", "Fahrenheit"], - description: - "The temperature unit to use. Infer this from the user's location.", - }, - }, - required: ["location", "unit"], - }, - }, - }, - { - type: "function", - function: { - name: "getRainProbability", - description: "Get the probability of rain for a specific location", - parameters: { - type: "object", - properties: { - location: { - type: "string", - description: "The city and state, e.g., San Francisco, CA", - }, - }, - required: ["location"], - }, - }, - }, - ], -}); -``` - -```python -from openai import OpenAI - -client = OpenAI() - -assistant = client.beta.assistants.create( - instructions="You are a weather bot. Use the provided functions to answer questions.", - model="gpt-4o", - tools=[ - { - "type": "function", - "function": { - "name": "get_current_temperature", - "description": "Get the current temperature for a specific location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g., San Francisco, CA", - }, - "unit": { - "type": "string", - "enum": ["Celsius", "Fahrenheit"], - "description": "The temperature unit to use. Infer this from the user's location.", - }, - }, - "required": ["location", "unit"], - }, - }, - }, - { - "type": "function", - "function": { - "name": "get_rain_probability", - "description": "Get the probability of rain for a specific location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g., San Francisco, CA", - } - }, - "required": ["location"], - }, - }, - }, - ], -) -``` - -```go -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Model: shared.ChatModelGPT4o, - Instructions: openai.String("You are a weather bot. Use the provided functions to answer questions."), - Tools: weatherTools(false), -}) -if err != nil { - panic(err) -} - -func weatherTools(strict bool) []openai.AssistantToolUnionParam { - return []openai.AssistantToolUnionParam{ - openai.AssistantToolParamOfFunction(shared.FunctionDefinitionParam{ - Name: "get_current_temperature", - Description: openai.String("Get the current temperature for a specific location"), - Parameters: map[string]any{ - "type": "object", - "properties": map[string]any{ - "location": map[string]any{"type": "string", "description": "The city and state, e.g., San Francisco, CA"}, - "unit": map[string]any{"type": "string", "enum": []string{"Celsius", "Fahrenheit"}, "description": "The temperature unit to use. Infer this from the user's location."}, - }, - "required": []string{"location", "unit"}, - }, - Strict: openai.Bool(strict), - }), - openai.AssistantToolParamOfFunction(shared.FunctionDefinitionParam{ - Name: "get_rain_probability", - Description: openai.String("Get the probability of rain for a specific location"), - Parameters: map[string]any{ - "type": "object", - "properties": map[string]any{ - "location": map[string]any{"type": "string", "description": "The city and state, e.g., San Francisco, CA"}, - }, - "required": []string{"location"}, - }, - Strict: openai.Bool(strict), - }), - } -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.core.JsonValue; -import com.openai.models.FunctionDefinition; -import com.openai.models.FunctionParameters; -import com.openai.models.beta.assistants.AssistantCreateParams; -import java.util.List; -import java.util.Map; - -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .model("gpt-4o") - .instructions( - "You are a weather bot. Use the provided functions to answer questions.") - .addFunctionTool( - FunctionDefinition.builder() - .name("get_current_temperature") - .description("Get the current temperature for a specific location") - .parameters( - FunctionParameters.builder() - .putAdditionalProperty("type", JsonValue.from("object")) - .putAdditionalProperty( - "properties", - JsonValue.from( - Map.of( - "location", - Map.of( - "type", "string", - "description", - "The city and state, e.g., San Francisco, CA"), - "unit", - Map.of( - "type", - "string", - "enum", - List.of("Celsius", "Fahrenheit"), - "description", - "The temperature unit to use. Infer this from the user's location.")))) - .putAdditionalProperty( - "required", JsonValue.from(List.of("location", "unit"))) - .build()) - .build()) - .addFunctionTool( - FunctionDefinition.builder() - .name("get_rain_probability") - .description("Get the probability of rain for a specific location") - .parameters( - FunctionParameters.builder() - .putAdditionalProperty("type", JsonValue.from("object")) - .putAdditionalProperty( - "properties", - JsonValue.from( - Map.of( - "location", - Map.of( - "type", "string", - "description", - "The city and state, e.g., San Francisco, CA")))) - .putAdditionalProperty( - "required", JsonValue.from(List.of("location"))) - .build()) - .build()) - .build()); - -System.out.println(assistant.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.create( - model: "gpt-4o", - instructions: "Use the provided functions to answer weather questions.", - tools: [ - { - type: :function, - function: { - name: "get_current_temperature", - description: "Get the current temperature for a location", - parameters: { - type: :object, - properties: { - location: {type: :string}, - unit: {type: :string, enum: ["Celsius", "Fahrenheit"]} - }, - required: ["location", "unit"] - } - } - }, - { - type: :function, - function: { - name: "get_rain_probability", - description: "Get the probability of rain for a location", - parameters: { - type: :object, - properties: {location: {type: :string}}, - required: ["location"] - } - } - } - ] -) -puts(assistant.id) -``` - - -### Step 2: Create a Thread and add Messages - -Create a Thread when a user starts a conversation and add Messages to the Thread as the user asks questions. - -```javascript -const thread = await client.beta.threads.create(); -const message = client.beta.threads.messages.create(thread.id, { - role: "user", - content: - "What's the weather in San Francisco today and the likelihood it'll rain?", -}); -``` - -```python -thread = client.beta.threads.create() -message = client.beta.threads.messages.create( - thread_id=thread.id, - role="user", - content="What's the weather in San Francisco today and the likelihood it'll rain?", -) -``` - -```go -thread, err := client.Beta.Threads.New(context.Background(), openai.BetaThreadNewParams{}) -if err != nil { - panic(err) -} -_, err = client.Beta.Threads.Messages.New(context.Background(), thread.ID, openai.BetaThreadMessageNewParams{ - Role: "user", - Content: openai.BetaThreadMessageNewParamsContentUnion{ - OfString: openai.String("What's the weather in San Francisco today and the likelihood it'll rain?"), - }, -}) -if err != nil { - panic(err) -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.ThreadCreateParams; -import com.openai.models.beta.threads.messages.MessageCreateParams; - -var thread = client.beta().threads().create(ThreadCreateParams.builder().build()); -var message = - client - .beta() - .threads() - .messages() - .create( - thread.id(), - MessageCreateParams.builder() - .role(MessageCreateParams.Role.USER) - .content("What's the weather in San Francisco today, and will it rain?") - .build()); - -System.out.println(message.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -thread = client.beta.threads.create -message = client.beta.threads.messages.create( - thread.id, - role: :user, - content: "What's the weather in San Francisco today, and will it rain?" -) -puts(message.id) -``` - - -### Step 3: Initiate a Run - -When you initiate a Run on a Thread containing a user Message that triggers one or more functions, -the Run will enter a `pending` status. After it processes, the run will enter a `requires_action` state which you can -verify by checking the Run’s `status`. This indicates that you need to run tools and submit their outputs to the -Assistant to continue Run execution. In our case, we will see two `tool_calls`, which indicates that the -user query resulted in parallel function calling. - -Note that a runs expire ten minutes after creation. Be sure to submit your - tool outputs before the 10 min mark. - -You will see two `tool_calls` within `required_action`, which indicates the user query triggered parallel function calling. - -```json -{ - "id": "run_qJL1kI9xxWlfE0z1yfL0fGg9", - ... - "status": "requires_action", - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "call_FthC9qRpsL5kBpwwyw6c7j4k", - "function": { - "arguments": "{"location": "San Francisco, CA"}", - "name": "get_rain_probability" - }, - "type": "function" - }, - { - "id": "call_RpEDoB8O0FTL9JoKTuCVFOyR", - "function": { - "arguments": "{"location": "San Francisco, CA", "unit": "Fahrenheit"}", - "name": "get_current_temperature" - }, - "type": "function" - } - ] - }, - ... - "type": "submit_tool_outputs" - } -} -``` - -

Run object truncated here for readability
- - - -How you initiate a Run and submit `tool_calls` will differ depending on whether you are using streaming or not, -although in both cases all `tool_calls` need to be submitted at the same time. -You can then complete the Run by submitting the tool outputs from the functions you called. -Pass each `tool_call_id` referenced in the `required_action` object to match outputs to each function call. - - - -With streaming - - - -For the streaming case, we create an EventHandler class to handle events in the response stream and submit all tool outputs at once with the “submit tool outputs stream” helper in the Python and Node SDKs. - -```javascript -class EventHandler extends EventEmitter { - constructor(client) { - super(); - this.client = client; - } - - async onEvent(event) { - try { - console.log(event); - // Retrieve events that are denoted with 'requires_action' - // since these will have our tool_calls - if (event.event === "thread.run.requires_action") { - await this.handleRequiresAction( - event.data, - event.data.id, - event.data.thread_id - ); - } - } catch (error) { - console.error("Error handling event:", error); - } - } - - async handleRequiresAction(data, runId, threadId) { - const toolOutputs = data.required_action.submit_tool_outputs.tool_calls.map( - (toolCall) => { - if (toolCall.function.name === "getCurrentTemperature") { - return { tool_call_id: toolCall.id, output: "57" }; - } else if (toolCall.function.name === "getRainProbability") { - return { tool_call_id: toolCall.id, output: "0.06" }; - } - throw new Error(`Unknown tool: ${toolCall.function.name}`); - } - ); - // Submit all the tool outputs at the same time - await this.submitToolOutputs(toolOutputs, runId, threadId); - } - - async submitToolOutputs(toolOutputs, runId, threadId) { - try { - // Use the submitToolOutputsStream helper - const stream = this.client.beta.threads.runs.submitToolOutputsStream( - runId, - { thread_id: threadId, tool_outputs: toolOutputs } - ); - for await (const event of stream) { - this.emit("event", event); - } - } catch (error) { - console.error("Error submitting tool outputs:", error); - } - } -} - -const eventHandler = new EventHandler(client); -eventHandler.on("event", eventHandler.onEvent.bind(eventHandler)); - -const stream = await client.beta.threads.runs.stream(threadId, { - assistant_id: assistantId, -}); - -for await (const event of stream) { - eventHandler.emit("event", event); -} -``` - -```python -from typing_extensions import override -from openai import AssistantEventHandler - -class EventHandler(AssistantEventHandler): - @override - def on_event(self, event): - # Retrieve events that are denoted with 'requires_action' - # since these will have our tool_calls - if event.event == "thread.run.requires_action": - run_id = event.data.id # Retrieve the run ID from the event data - self.handle_requires_action(event.data, run_id) - - def handle_requires_action(self, data, run_id): - tool_outputs = [] - - for tool in data.required_action.submit_tool_outputs.tool_calls: - if tool.function.name == "get_current_temperature": - tool_outputs.append({"tool_call_id": tool.id, "output": "57"}) - elif tool.function.name == "get_rain_probability": - tool_outputs.append({"tool_call_id": tool.id, "output": "0.06"}) - - # Submit all tool_outputs at the same time - self.submit_tool_outputs(tool_outputs, run_id) - - def submit_tool_outputs(self, tool_outputs, run_id): - # Use the submit_tool_outputs_stream helper - with client.beta.threads.runs.submit_tool_outputs_stream( - thread_id=self.current_run.thread_id, - run_id=self.current_run.id, - tool_outputs=tool_outputs, - event_handler=EventHandler(), - ) as stream: - for text in stream.text_deltas: - print(text, end="", flush=True) - print() - -with client.beta.threads.runs.stream( - thread_id=thread.id, - assistant_id=assistant.id, - event_handler=EventHandler(), -) as stream: - stream.until_done() -``` - - - - - - - -Without streaming - - - -Runs are asynchronous, which means you'll want to monitor their `status` by polling the Run object until a -[terminal status](https://developers.openai.com/api/docs/assistants/deep-dive#runs-and-run-steps) is reached. For convenience, where available, the 'create and poll' SDK helpers assist both in -creating the run and then polling for its completion. The Go tab shows the equivalent workflow with manual polling. Once the Run completes, you can list the -Messages added to the Thread by the Assistant. Finally, you would retrieve all the `tool_outputs` from -`required_action` and submit them at the same time to the 'submit tool outputs and poll' helper. - -```javascript -async function handleRequiresAction(run) { - // Check if there are tools that require outputs - if ( - run.required_action && - run.required_action.submit_tool_outputs && - run.required_action.submit_tool_outputs.tool_calls - ) { - // Loop through each tool in the required action section - const toolOutputs = run.required_action.submit_tool_outputs.tool_calls.map( - (tool) => { - if (tool.function.name === "getCurrentTemperature") { - return { tool_call_id: tool.id, output: "57" }; - } else if (tool.function.name === "getRainProbability") { - return { tool_call_id: tool.id, output: "0.06" }; - } - throw new Error(`Unknown tool: ${tool.function.name}`); - } - ); - - // Submit all tool outputs at once after collecting them in a list - if (toolOutputs.length > 0) { - run = await client.beta.threads.runs.submitToolOutputsAndPoll(run.id, { - thread_id: thread.id, - tool_outputs: toolOutputs, - }); - console.log("Tool outputs submitted successfully."); - } else { - console.log("No tool outputs to submit."); - } - - // Check status after submitting tool outputs - return handleRunStatus(run); - } -} - -async function handleRunStatus(run) { - // Check if the run is completed - if (run.status === "completed") { - let messages = await client.beta.threads.messages.list(thread.id); - console.log(messages.data); - return messages.data; - } else if (run.status === "requires_action") { - console.log(run.status); - return await handleRequiresAction(run); - } else { - console.error("Run did not complete:", run); - } -} - -// Create and poll run -let run = await client.beta.threads.runs.createAndPoll(thread.id, { - assistant_id: assistant.id, -}); - -handleRunStatus(run); -``` - -```python -run = client.beta.threads.runs.create_and_poll( - thread_id=thread.id, - assistant_id=assistant.id, -) - -if run.status == "completed": - messages = client.beta.threads.messages.list(thread_id=thread.id) - print(messages) - -# Define the list to store tool outputs -tool_outputs = [] - -# Loop through each tool in the required action section -if run.required_action: - for tool in run.required_action.submit_tool_outputs.tool_calls: - if tool.function.name == "get_current_temperature": - tool_outputs.append({"tool_call_id": tool.id, "output": "57"}) - elif tool.function.name == "get_rain_probability": - tool_outputs.append({"tool_call_id": tool.id, "output": "0.06"}) - -# Submit all tool outputs at once after collecting them in a list -if tool_outputs: - try: - run = client.beta.threads.runs.submit_tool_outputs_and_poll( - thread_id=thread.id, - run_id=run.id, - tool_outputs=tool_outputs, - ) - print("Tool outputs submitted successfully.") - except Exception as e: - print("Failed to submit tool outputs:", e) -else: - print("No tool outputs to submit.") - -if run.status == "completed": - messages = client.beta.threads.messages.list(thread_id=thread.id) - print(messages) -else: - print(run.status) -``` - -```go -run, err := client.Beta.Threads.Runs.New(context.Background(), thread.ID, openai.BetaThreadRunNewParams{ - AssistantID: assistant.ID, -}) -if err != nil { - panic(err) -} -run = pollRun(client, thread.ID, run) -if run.Status == openai.RunStatusRequiresAction { - outputs := make([]openai.BetaThreadRunSubmitToolOutputsParamsToolOutput, 0) - for _, toolCall := range run.RequiredAction.SubmitToolOutputs.ToolCalls { - switch toolCall.Function.Name { - case "get_current_temperature": - outputs = append(outputs, openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{ - ToolCallID: openai.String(toolCall.ID), Output: openai.String("57"), - }) - case "get_rain_probability": - outputs = append(outputs, openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{ - ToolCallID: openai.String(toolCall.ID), Output: openai.String("0.06"), - }) - } - } - if len(outputs) > 0 { - run, err = client.Beta.Threads.Runs.SubmitToolOutputs( - context.Background(), thread.ID, run.ID, - openai.BetaThreadRunSubmitToolOutputsParams{ToolOutputs: outputs}, - ) - if err != nil { - panic(err) - } - run = pollRun(client, thread.ID, run) - } -} -if run.Status == openai.RunStatusCompleted { - messages, err := client.Beta.Threads.Messages.List(context.Background(), thread.ID, openai.BetaThreadMessageListParams{}) - if err != nil { - panic(err) - } - fmt.Println(messages.Data) -} else { - fmt.Println(run.Status) -} - -func pollRun(client openai.Client, threadID string, run *openai.Run) *openai.Run { - for run.Status == openai.RunStatusQueued || run.Status == openai.RunStatusInProgress { - time.Sleep(time.Second) - next, err := client.Beta.Threads.Runs.Get(context.Background(), threadID, run.ID) - if err != nil { - panic(err) - } - run = next - } - return run -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.models.beta.threads.runs.Run; -import com.openai.models.beta.threads.runs.RunCreateParams; -import com.openai.models.beta.threads.runs.RunRetrieveParams; -import com.openai.models.beta.threads.runs.RunStatus; -import com.openai.models.beta.threads.runs.RunSubmitToolOutputsParams; -import java.util.ArrayList; - -String threadId = System.getenv("OPENAI_EXAMPLE_THREAD_ID"); -Run run = - client - .beta() - .threads() - .runs() - .create( - threadId, - RunCreateParams.builder() - .assistantId(System.getenv("OPENAI_EXAMPLE_ASSISTANT_ID")) - .build()); -run = poll(client, threadId, run); - -if (run.status().equals(RunStatus.REQUIRES_ACTION)) { - var action = - run.requiredAction() - .orElseThrow(() -> new IllegalStateException("Run has no required action")); - var outputs = new ArrayList(); - for (var call : action.submitToolOutputs().toolCalls()) { - String output = - switch (call.function().name()) { - case "get_current_temperature" -> "57"; - case "get_rain_probability" -> "0.06"; - default -> null; - }; - if (output != null) { - outputs.add( - RunSubmitToolOutputsParams.ToolOutput.builder() - .toolCallId(call.id()) - .output(output) - .build()); - } - } - if (outputs.isEmpty()) throw new IllegalStateException("No supported tool calls requested"); - run = - client - .beta() - .threads() - .runs() - .submitToolOutputs( - run.id(), - RunSubmitToolOutputsParams.builder() - .threadId(threadId) - .toolOutputs(outputs) - .build()); - run = poll(client, threadId, run); -} - -if (!run.status().equals(RunStatus.COMPLETED)) { - throw new IllegalStateException("Run ended with status: " + run.status()); -} -client.beta().threads().messages().list(threadId).items().stream() - .flatMap(message -> message.content().stream()) - .flatMap(content -> content.text().stream()) - .forEach(content -> System.out.println(content.text().value())); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -thread_id = ENV.fetch("OPENAI_THREAD_ID") -assistant_id = ENV.fetch("OPENAI_ASSISTANT_ID") - -poll_run = lambda do |run| - while [ - OpenAI::Beta::Threads::RunStatus::QUEUED, - OpenAI::Beta::Threads::RunStatus::IN_PROGRESS - ].include?(run.status) - sleep(2) - run = client.beta.threads.runs.retrieve(run.id, thread_id: thread_id) - end - run -end - -run = client.beta.threads.runs.create(thread_id, assistant_id: assistant_id) -run = poll_run.call(run) - -if run.status == OpenAI::Beta::Threads::RunStatus::REQUIRES_ACTION - required_action = run.required_action or raise "Run has no required action" - tool_outputs = required_action.submit_tool_outputs.tool_calls.filter_map do |tool_call| - output = case tool_call.function.name - when "get_current_temperature" then "57" - when "get_rain_probability" then "0.06" - end - {tool_call_id: tool_call.id, output: output} if output - end - raise "No supported tool calls were requested" if tool_outputs.empty? - - run = client.beta.threads.runs.submit_tool_outputs( - run.id, - thread_id: thread_id, - tool_outputs: tool_outputs - ) - run = poll_run.call(run) -end - -if run.status == OpenAI::Beta::Threads::RunStatus::COMPLETED - messages = client.beta.threads.messages.list(thread_id) - messages.auto_paging_each { |message| puts(message.content) } -else - warn("Run ended with status: #{run.status}") -end -``` - - - -### Using Structured Outputs - -When you enable [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs) by supplying `strict: true`, the OpenAI API will pre-process your supplied schema on your first request, and then use this artifact to constrain the model to your schema. - -```javascript -const assistant = await client.beta.assistants.create({ - model: "gpt-4o-2024-08-06", - instructions: - "You are a weather bot. Use the provided functions to answer questions.", - tools: [ - { - type: "function", - function: { - name: "getCurrentTemperature", - description: "Get the current temperature for a specific location", - parameters: { - type: "object", - properties: { - location: { - type: "string", - description: "The city and state, e.g., San Francisco, CA", - }, - unit: { - type: "string", - enum: ["Celsius", "Fahrenheit"], - description: - "The temperature unit to use. Infer this from the user's location.", - }, - }, - required: ["location", "unit"], - // highlight-start - additionalProperties: false, - // highlight-end - }, - // highlight-start - strict: true, - // highlight-end - }, - }, - { - type: "function", - function: { - name: "getRainProbability", - description: "Get the probability of rain for a specific location", - parameters: { - type: "object", - properties: { - location: { - type: "string", - description: "The city and state, e.g., San Francisco, CA", - }, - }, - required: ["location"], - // highlight-start - additionalProperties: false, - // highlight-end - }, - // highlight-start - strict: true, - // highlight-end - }, - }, - ], -}); -``` - -```python -from openai import OpenAI - -client = OpenAI() - -assistant = client.beta.assistants.create( - instructions="You are a weather bot. Use the provided functions to answer questions.", - model="gpt-4o-2024-08-06", - tools=[ - { - "type": "function", - "function": { - "name": "get_current_temperature", - "description": "Get the current temperature for a specific location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g., San Francisco, CA", - }, - "unit": { - "type": "string", - "enum": ["Celsius", "Fahrenheit"], - "description": "The temperature unit to use. Infer this from the user's location.", - }, - }, - "required": ["location", "unit"], - # highlight-start - "additionalProperties": False, - # highlight-end - }, - # highlight-start - "strict": True, - # highlight-end - }, - }, - { - "type": "function", - "function": { - "name": "get_rain_probability", - "description": "Get the probability of rain for a specific location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g., San Francisco, CA", - } - }, - "required": ["location"], - # highlight-start - "additionalProperties": False, - # highlight-end - }, - # highlight-start - "strict": True, - # highlight-end - }, - }, - ], -) -``` - -```go -assistant, err := client.Beta.Assistants.New(context.Background(), openai.BetaAssistantNewParams{ - Model: shared.ChatModelGPT4o2024_08_06, - Instructions: openai.String("You are a weather bot. Use the provided functions to answer questions."), - Tools: weatherTools(), -}) -if err != nil { - panic(err) -} - -func weatherTools() []openai.AssistantToolUnionParam { - return []openai.AssistantToolUnionParam{ - openai.AssistantToolParamOfFunction(shared.FunctionDefinitionParam{ - Name: "get_current_temperature", - Description: openai.String("Get the current temperature for a specific location"), - Parameters: map[string]any{ - "type": "object", - "properties": map[string]any{ - "location": map[string]any{"type": "string", "description": "The city and state, e.g., San Francisco, CA"}, - "unit": map[string]any{"type": "string", "enum": []string{"Celsius", "Fahrenheit"}, "description": "The temperature unit to use. Infer this from the user's location."}, - }, - "required": []string{"location", "unit"}, - "additionalProperties": false, - }, - Strict: openai.Bool(true), - }), - openai.AssistantToolParamOfFunction(shared.FunctionDefinitionParam{ - Name: "get_rain_probability", - Description: openai.String("Get the probability of rain for a specific location"), - Parameters: map[string]any{ - "type": "object", - "properties": map[string]any{ - "location": map[string]any{"type": "string", "description": "The city and state, e.g., San Francisco, CA"}, - }, - "required": []string{"location"}, - "additionalProperties": false, - }, - Strict: openai.Bool(true), - }), - } -} -``` - -```java -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.core.JsonValue; -import com.openai.models.FunctionDefinition; -import com.openai.models.FunctionParameters; -import com.openai.models.beta.assistants.AssistantCreateParams; -import java.util.List; -import java.util.Map; - -var assistant = - client - .beta() - .assistants() - .create( - AssistantCreateParams.builder() - .model("gpt-4o-2024-08-06") - .instructions( - "You are a weather bot. Use the provided functions to answer questions.") - .addFunctionTool( - FunctionDefinition.builder() - .name("get_current_temperature") - .description("Get the current temperature for a specific location") - .strict(true) - .parameters( - FunctionParameters.builder() - .putAdditionalProperty("type", JsonValue.from("object")) - .putAdditionalProperty( - "properties", - JsonValue.from( - Map.of( - "location", - Map.of( - "type", "string", - "description", - "The city and state, e.g., San Francisco, CA"), - "unit", - Map.of( - "type", - "string", - "enum", - List.of("Celsius", "Fahrenheit"), - "description", - "The temperature unit to use. Infer this from the user's location.")))) - .putAdditionalProperty( - "required", JsonValue.from(List.of("location", "unit"))) - .putAdditionalProperty( - "additionalProperties", JsonValue.from(false)) - .build()) - .build()) - .addFunctionTool( - FunctionDefinition.builder() - .name("get_rain_probability") - .description("Get the probability of rain for a specific location") - .strict(true) - .parameters( - FunctionParameters.builder() - .putAdditionalProperty("type", JsonValue.from("object")) - .putAdditionalProperty( - "properties", - JsonValue.from( - Map.of( - "location", - Map.of( - "type", "string", - "description", - "The city and state, e.g., San Francisco, CA")))) - .putAdditionalProperty( - "required", JsonValue.from(List.of("location"))) - .putAdditionalProperty( - "additionalProperties", JsonValue.from(false)) - .build()) - .build()) - .build()); - -System.out.println(assistant.id()); -``` - -```ruby -require "openai" - -client = OpenAI::Client.new -assistant = client.beta.assistants.create( - model: "gpt-4o", - name: "Weather assistant", - tools: [{type: :function, function: {name: "get_weather", description: "Get weather", parameters: {type: :object, properties: {city: {type: :string}}, required: ["city"], additionalProperties: false}, strict: true}}] -) -puts(assistant.id) -``` \ No newline at end of file diff --git a/docs/en/api/docs/changelog.md b/docs/en/api/docs/changelog.md index 685edcb..85782ba 100644 --- a/docs/en/api/docs/changelog.md +++ b/docs/en/api/docs/changelog.md @@ -40,11 +40,11 @@ Announced Ultrafast mode, a new API service tier for GPT-5.6 Sol that runs up to ### Aug 7 -Feature · Model: gpt-5.6-cyber · Model: daybreak-red-latest · Model: daybreak-blue-latest · API: v1/responses +Feature · Model: gpt-5.6-cyber · Model: gpt-daybreak-red-latest · Model: gpt-daybreak-blue-latest · API: v1/responses Daybreak now offers two access tiers for approved defenders: Daybreak Blue and Daybreak Red. Use them to move from security findings to validated fixes in explicitly authorized engagements. -Start with Daybreak Blue for most defensive security work. It provides access to general-purpose models such as GPT-5.6 Sol for vulnerability discovery, secure code review, detection engineering, incident response, malware analysis, and patch validation. Read more [here](https://developers.openai.com/api/docs/models/daybreak-blue-latest). +Start with Daybreak Blue for most defensive security work. It provides access to general-purpose models such as GPT-5.6 Sol for vulnerability discovery, secure code review, detection engineering, incident response, malware analysis, and patch validation. Read more [here](https://developers.openai.com/api/docs/models/gpt-daybreak-blue-latest). Daybreak Red provides separately approved access to purpose-trained models such as [GPT-5.6 Cyber](https://developers.openai.com/api/docs/models/gpt-5.6-cyber) for authorized vulnerability reproduction, exploit validation, penetration testing, red teaming, and complex system analysis. @@ -761,7 +761,7 @@ Released several new models and tools and a new API for agentic workflows: - Released a set of built-in tools for the Responses API: [web search](https://developers.openai.com/api/docs/guides/tools-web-search), [file search](https://developers.openai.com/api/docs/guides/tools-file-search), and [computer use](https://developers.openai.com/api/docs/guides/tools-computer-use). - Released the [Agents SDK](https://developers.openai.com/api/docs/guides/agents), an orchestration framework for designing, building, and deploying agents. - Announced new models: `gpt-4o-search-preview`, `gpt-4o-mini-search-preview`, `computer-use-preview`. - - Announced plans to bring all [Assistants API](https://developers.openai.com/api/docs/assistants) features to the easier to use [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses), with an anticipated sunset date for Assistants in 2026 (after achieving full feature parity). + - Announced plans to bring all [Assistants API](https://developers.openai.com/api/docs/assistants/migration) features to the easier to use [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses), with an anticipated sunset date for Assistants in 2026 (after achieving full feature parity). ### Mar 3 @@ -903,7 +903,7 @@ Released [o1-preview and o1-mini](https://developers.openai.com/api/docs/guides/ Feature · API: v1/assistants -Assistants API now supports [including file search results used by the file search tool, and customizing ranking behavior](https://developers.openai.com/api/docs/assistants/tools/file-search#improve-file-search-result-relevance-with-chunk-ranking). +Assistants API now supports [including file search results used by the file search tool, and customizing ranking behavior](https://developers.openai.com/api/docs/assistants/migration#improve-file-search-result-relevance-with-chunk-ranking). ### Aug 20 @@ -971,7 +971,7 @@ Update Update -Added support for [file search customizations](https://developers.openai.com/api/docs/assistants/tools/file-search#customizing-file-search-settings). +Added support for [file search customizations](https://developers.openai.com/api/docs/assistants/migration#customizing-file-search-settings). ## May, 2024 diff --git a/docs/en/api/docs/deprecations.md b/docs/en/api/docs/deprecations.md index 47de348..ffa012d 100644 --- a/docs/en/api/docs/deprecations.md +++ b/docs/en/api/docs/deprecations.md @@ -174,18 +174,6 @@ To improve reliability and make it easier for developers to choose the right mod | 2026-09-28 | `davinci-002` | `gpt-5.6-terra` | | 2026-09-28 | `gpt-3.5-turbo-1106` | `gpt-5.6-terra` | -### 2025-08-20: Assistants API - -On August 26th, 2025, we notified developers using the Assistants API of its deprecation and removal from the API one year later, on August 26, 2026. - -When we released the [Responses API](https://developers.openai.com/api/reference/resources/responses/methods/create) in [March 2025](https://developers.openai.com/api/docs/changelog), we announced plans to bring all Assistants API features to the easier to use Responses API, with a sunset date in 2026. - -See the Assistants to Conversations [migration guide](https://developers.openai.com/api/docs/assistants/migration) to learn more about how to migrate your current integration to the Responses API and Conversations API. - -| Shutdown date | Model / system | Recommended replacement | -| ------------- | -------------- | ----------------------------------- | -| 2026‑08‑26 | Assistants API | Responses API and Conversations API | - ## Past deprecations Past deprecations are listed below, with the most recent announcements at the top. @@ -280,6 +268,18 @@ In September, 2025, we notified developers using gpt-4o-realtime-preview models | 2026-05-07 | gpt-4o-audio-preview | gpt-audio-1.5 | | 2026-05-07 | gpt-4o-mini-audio-preview | gpt-audio-mini | +### 2025-08-20: Assistants API + +The Assistants API was officially sunset on August 26, 2026, following its deprecation announcement on August 26, 2025. + +When we released the [Responses API](https://developers.openai.com/api/reference/resources/responses/methods/create) in [March 2025](https://developers.openai.com/api/docs/changelog), we announced plans to bring all Assistants API features to the easier to use Responses API, with a sunset date in 2026. + +See the Assistants to Conversations [migration guide](https://developers.openai.com/api/docs/assistants/migration) to learn more about how to migrate your current integration to the Responses API and Conversations API. + +| Shutdown date | Model / system | Recommended replacement | +| ------------- | -------------- | ----------------------------------- | +| 2026‑08‑26 | Assistants API | Responses API and Conversations API | + ### 2025-06-10: gpt-4o-realtime-preview-2024-10-01 On June 10th, 2025, we notified developers using gpt-4o-realtime-preview-2024-10-01 of its deprecation and removal from the API in three months. diff --git a/docs/en/api/docs/guides/advanced-usage.md b/docs/en/api/docs/guides/advanced-usage.md index 6306225..3987ac4 100644 --- a/docs/en/api/docs/guides/advanced-usage.md +++ b/docs/en/api/docs/guides/advanced-usage.md @@ -119,6 +119,20 @@ print(f"{num_tokens_from_messages(messages, model)} prompt tokens counted.") To confirm the number generated by our function above is the same as what the API returns, create a new Chat Completion: +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const response = await client.chat.completions.create({ + model, + messages, + temperature: 0, +}); + +console.log(`${response.usage.prompt_tokens} prompt tokens used.`); +``` + ```python # example token count from the OpenAI API from openai import OpenAI diff --git a/docs/en/api/docs/guides/background.md b/docs/en/api/docs/guides/background.md index 5bad63a..4d12c53 100644 --- a/docs/en/api/docs/guides/background.md +++ b/docs/en/api/docs/guides/background.md @@ -103,6 +103,26 @@ var response = client.responses().create(params); System.out.println(response.status().orElseThrow()); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + BackgroundModeEnabled = true, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Write a very long novel about otters in space.") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.Status); +``` + ```ruby require "openai" @@ -235,6 +255,37 @@ response.output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + BackgroundModeEnabled = true, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Write a very long novel about otters in space.") +); + +ResponseResult created = await client.CreateResponseAsync(options); +ResponseResult response = await client.GetResponseAsync(created.Id); +while (response.Status is ResponseStatus.Queued or ResponseStatus.InProgress) +{ + await Task.Delay(TimeSpan.FromSeconds(1)); + response = await client.GetResponseAsync(response.Id); +} +if (response.Status != ResponseStatus.Completed) +{ + throw new InvalidOperationException($"Background response ended with status: {response.Status}"); +} +Console.WriteLine($"Status: {response.Status}"); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -323,6 +374,19 @@ var response = client.responses().cancel(responseId); System.out.println(response.status()); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +string responseId = "resp_123"; + +ResponseResult response = await client.CancelResponseAsync(responseId); +Console.WriteLine(response.Status); +``` + ```ruby require "openai" @@ -524,6 +588,91 @@ if (!streamCompleted.get()) { } ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + BackgroundModeEnabled = true, + StreamingEnabled = true, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Write a very long novel about otters in space.") +); + +string? responseId = null; +int lastSequenceNumber = -1; +bool completed = false; + +void HandleUpdate(StreamingResponseUpdate update) +{ + lastSequenceNumber = update.SequenceNumber; + switch (update) + { + case StreamingResponseCreatedUpdate created: + responseId = created.Response.Id; + break; + case StreamingResponseOutputTextDeltaUpdate text: + Console.Write(text.Delta); + break; + case StreamingResponseCompletedUpdate: + completed = true; + break; + case StreamingResponseFailedUpdate: + throw new InvalidOperationException("The background response failed."); + case StreamingResponseIncompleteUpdate: + throw new InvalidOperationException("The background response was incomplete."); + case StreamingResponseErrorUpdate error: + throw new InvalidOperationException($"The response stream failed: {error.Message}"); + } +} + +try +{ + await foreach ( + StreamingResponseUpdate update in client.CreateResponseStreamingAsync(options) + ) + { + HandleUpdate(update); + } +} +catch (Exception error) + when (error is HttpRequestException or IOException && responseId is not null) +{ + // The background response continues after its streaming connection is interrupted. +} + +if (!completed) +{ + if (responseId is null) + { + throw new InvalidOperationException("The response stream ended before providing its ID."); + } + + GetResponseOptions resumeOptions = new(responseId) + { + StartingAfter = lastSequenceNumber, + StreamingEnabled = true, + }; + await foreach (StreamingResponseUpdate update in client.GetResponseStreamingAsync(resumeOptions)) + { + HandleUpdate(update); + } + + if (!completed) + { + throw new InvalidOperationException( + "The resumed response stream ended before the background response completed." + ); + } +} +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/code-generation.md b/docs/en/api/docs/guides/code-generation.md index 38b822c..e386a51 100644 --- a/docs/en/api/docs/guides/code-generation.md +++ b/docs/en/api/docs/guides/code-generation.md @@ -128,6 +128,38 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + ReasoningOptions = new ResponseReasoningOptions + { + ReasoningEffortLevel = ResponseReasoningEffortLevel.High, + }, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + """ + Find the null pointer exception in this code: + + def display_name(user): + return user.profile.name + + print(display_name(None)) + """ + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/compaction.md b/docs/en/api/docs/guides/compaction.md index edb7cfc..244d46f 100644 --- a/docs/en/api/docs/guides/compaction.md +++ b/docs/en/api/docs/guides/compaction.md @@ -52,6 +52,32 @@ necessary context to continue the conversation. If you use ## Example user flow +```javascript +import OpenAI from "openai"; +import { toResponseInputItems } from "openai/lib/responses/ResponseInputItems"; + +const client = new OpenAI(); + +/** @type {import("openai/resources/responses/responses").ResponseInput} */ +const conversation = [ + { + type: "message", + role: "user", + content: "Let's begin a long coding task.", + }, +]; + +const response = await client.responses.create({ + model: "gpt-5.3-codex", + input: conversation, + store: false, + context_management: [{ type: "compaction", compact_threshold: 200_000 }], +}); + +conversation.push(...toResponseInputItems(response.output)); +console.log(response.output_text); +``` + ```python conversation = [ { @@ -259,6 +285,39 @@ call as-is. ### Example user flow +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +/** @type {import("openai/resources/responses/responses").ResponseInput} */ +const conversation = [{ role: "user", content: "Plan a trip to Kyoto." }]; + +const compacted = await client.responses.compact({ + model: "gpt-5.6", + input: conversation, +}); + +/** @type {import("openai/resources/responses/responses").ResponseInput} */ +const nextInput = [ + ...compacted.output.map( + (item) => + /** @type {import("openai/resources/responses/responses").ResponseInputItem} */ ( + item + ) + ), + { role: "user", content: "Add two more days to the itinerary." }, +]; + +const response = await client.responses.create({ + model: "gpt-5.6", + input: nextInput, + store: false, +}); + +console.log(response.output_text); +``` + ```python # Full window collected from prior turns long_input_items_array = [{"role": "user", "content": "Plan a trip to Kyoto."}] diff --git a/docs/en/api/docs/guides/content-provenance.md b/docs/en/api/docs/guides/content-provenance.md index 0873a9e..a5dd41b 100644 --- a/docs/en/api/docs/guides/content-provenance.md +++ b/docs/en/api/docs/guides/content-provenance.md @@ -48,6 +48,21 @@ environment variable: Verify an image +```javascript +import { createReadStream } from "node:fs"; +import OpenAI, { toStreamingFile } from "openai"; + +const client = new OpenAI(); + +const result = await client.contentProvenanceChecks.create({ + file: toStreamingFile(createReadStream("myimage.png"), "myimage.png", { + type: "image/png", + }), +}); + +console.log(result); +``` + ```python from openai import OpenAI diff --git a/docs/en/api/docs/guides/conversation-state.md b/docs/en/api/docs/guides/conversation-state.md index 0ae55b2..debba05 100644 --- a/docs/en/api/docs/guides/conversation-state.md +++ b/docs/en/api/docs/guides/conversation-state.md @@ -401,7 +401,7 @@ first = client.responses.create( ) puts(first.output_text) -history.concat(first.output.map(&:to_h)) +history.concat(first.output) history << {role: :user, content: "Tell me another."} second = client.responses.create( @@ -430,6 +430,10 @@ Conversations store items, which can be messages, tool calls, tool outputs, and Create a conversation +```javascript +const conversation = await client.conversations.create(); +``` + ```python conversation = openai.conversations.create() ``` @@ -459,6 +463,16 @@ In a multi-turn interaction, you can pass the `conversation` into subsequent res Manage conversation state with Conversations and Responses APIs +```javascript +const response = await client.responses.create({ + model: "gpt-5.6", + input: [{ role: "user", content: "What are the five Ds of dodgeball?" }], + conversation: conversation.id, +}); + +console.log(response.output_text); +``` + ```python response = openai.responses.create( model="gpt-5.6", diff --git a/docs/en/api/docs/guides/deep-research.md b/docs/en/api/docs/guides/deep-research.md index 1a62a40..28b9494 100644 --- a/docs/en/api/docs/guides/deep-research.md +++ b/docs/en/api/docs/guides/deep-research.md @@ -169,6 +169,56 @@ response.output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CodeInterpreterToolContainer container = new( + CodeInterpreterToolContainerConfiguration.CreateAutomaticContainerConfiguration([]) +); +CreateResponseOptions options = new() +{ + Model = "o3-deep-research", + BackgroundModeEnabled = true, +}; +options.Tools.Add(ResponseTool.CreateWebSearchPreviewTool()); +string vectorStoreId = Environment.GetEnvironmentVariable("OPENAI_EXAMPLE_VECTOR_STORE_ID") + ?? throw new InvalidOperationException("Set OPENAI_EXAMPLE_VECTOR_STORE_ID to search your research documents."); +options.Tools.Add(ResponseTool.CreateFileSearchTool([vectorStoreId])); +options.Tools.Add(ResponseTool.CreateCodeInterpreterTool(container)); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + """ + Research the economic impact of semaglutide on global healthcare systems. + Do: + - Include specific figures, trends, statistics, and measurable outcomes. + - Prioritize reliable, up-to-date sources: peer-reviewed research, health + organizations (e.g., WHO, CDC), regulatory agencies, or pharmaceutical + earnings reports. + - Include inline citations and return all source metadata. + + Be analytical, avoid generalities, and ensure that each section supports + data-backed reasoning that could inform healthcare policy or financial modeling. + """ + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +while (response.Status is ResponseStatus.Queued or ResponseStatus.InProgress) +{ + await Task.Delay(TimeSpan.FromSeconds(1)); + response = await client.GetResponseAsync(response.Id); +} +if (response.Status != ResponseStatus.Completed) +{ + throw new InvalidOperationException($"Research ended with status: {response.Status}"); +} +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -408,6 +458,38 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + Instructions = + """ + You are talking to a user who is asking for a research task to be conducted. + Your job is to gather more information to successfully complete the task. + + GUIDELINES: + - Gather all necessary information concisely and in a well-structured manner. + - Use bullet points or numbered lists when they improve clarity. + - Do not ask for unnecessary information or repeat details the user already provided. + + IMPORTANT: Do NOT conduct any research yourself. Gather information that a + researcher will use to complete the task. + """, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Research surfboards for me.") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -775,6 +857,45 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + Instructions = + """ + You will receive a research task from a user. Produce instructions for the + researcher who will complete it. Do NOT conduct the research yourself. + + GUIDELINES: + 1. Maximize specificity and detail. Include every stated preference and all + attributes or dimensions the user identifies. + 2. Treat unstated but necessary dimensions as open-ended. Do not assume an + unstated preference or invent details the user did not provide. + 3. Phrase the research request in the first person, from the user's perspective. + 4. Request tables whenever they clarify comparisons, project tracking, budgets, + competitive analysis, or other structured information. + 5. Describe the expected output format, including report headers and other + formatting needed to keep the research clear and well organized. + 6. Respond in the user's language unless they explicitly request another one. + 7. Prioritize reliable primary sources. Prefer official brand or manufacturer + websites for products, original papers and journals for scientific questions, + and sources published in the language of the user's request. + """, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Research surfboards for me.") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -983,6 +1104,51 @@ response.output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "o3-deep-research", + BackgroundModeEnabled = true, + Instructions = "Analyze the Salesforce opportunity notes carefully.", + ReasoningOptions = new ResponseReasoningOptions + { + ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Auto, + }, +}; +string serverUrl = Environment.GetEnvironmentVariable("OPENAI_MCP_SERVER_URL") + ?? throw new InvalidOperationException("Set OPENAI_MCP_SERVER_URL to connect your research data source."); +options.Tools.Add( + ResponseTool.CreateMcpTool( + "mycompany_mcp_server", + new Uri(serverUrl), + toolCallApprovalPolicy: GlobalMcpToolCallApprovalPolicy.NeverRequireApproval + ) +); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "What similarities appear in notes for closed or lost Salesforce opportunities?" + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +while (response.Status is ResponseStatus.Queued or ResponseStatus.InProgress) +{ + await Task.Delay(TimeSpan.FromSeconds(1)); + response = await client.GetResponseAsync(response.Id); +} +if (response.Status != ResponseStatus.Completed) +{ + throw new InvalidOperationException($"Research ended with status: {response.Status}"); +} +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/deployment-checklist.md b/docs/en/api/docs/guides/deployment-checklist.md index 981af2a..1bcf9f3 100644 --- a/docs/en/api/docs/guides/deployment-checklist.md +++ b/docs/en/api/docs/guides/deployment-checklist.md @@ -32,7 +32,7 @@ stateful workflows, and agent features. Choose a [GPT-5.6 model](https://developers.openai.com/api/docs/guides/latest-model) for the workload instead of routing every request to the most capable tier. Use `gpt-5.6` or -`gpt-5.6-sol` for frontier capability, `gpt-5.6-terra` for strong performance +`gpt-5.6-sol` for flagship capability, `gpt-5.6-terra` for strong performance at a lower price, and `gpt-5.6-luna` for efficient, high-volume workloads. When migrating, preserve the current model's workload role and effective @@ -1018,7 +1018,7 @@ compacted = client.responses.compact( model: "gpt-5.6", input: long_window ) -input = compacted.output.map(&:to_h) +input = compacted.output.dup input << { role: :user, content: "We found the bad cache invalidation path. Write the fix plan and the verification checklist." @@ -1162,6 +1162,27 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + PromptCacheKey = "tenant-acme-support-agent", + Instructions = "Follow the Acme support policy and escalation rubric.", +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Summarize the current escalation for the on-call lead.") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -1422,7 +1443,7 @@ first = client.responses.create( include: ["reasoning.encrypted_content"], input: history ) -history.concat(first.output.map(&:to_h)) +history.concat(first.output) history << { role: :user, content: "Now write the customer-facing explanation in plain English." diff --git a/docs/en/api/docs/guides/embeddings.md b/docs/en/api/docs/guides/embeddings.md index a5a2c57..72b97b3 100644 --- a/docs/en/api/docs/guides/embeddings.md +++ b/docs/en/api/docs/guides/embeddings.md @@ -191,6 +191,30 @@ Below, we combine the review summary and review text into a single combined text Get_embeddings_from_dataset.ipynb +```javascript +import { mkdir, writeFile } from "node:fs/promises"; +import OpenAI from "openai"; + +const client = new OpenAI(); +const reviews = ["A rich cup of coffee.", "A bright herbal tea."]; + +const response = await client.embeddings.create({ + model: "text-embedding-3-small", + input: reviews.map((review) => review.replaceAll("\n", " ")), +}); + +const csvField = (value) => `"${value.replaceAll('"', '""')}"`; +const rows = response.data.map(({ embedding }, index) => + [csvField(reviews[index]), csvField(JSON.stringify(embedding))].join(",") +); + +await mkdir("output", { recursive: true }); +await writeFile( + "output/embedded_1k_reviews.csv", + ["combined,ada_embedding", ...rows].join("\n") + "\n" +); +``` + ```python from openai import OpenAI @@ -267,6 +291,26 @@ Both of our new embedding models were trained [with a technique](https://arxiv.o In general, using the `dimensions` parameter when creating the embedding is the suggested approach. In certain cases, you may need to change the embedding dimension after you generate it. When you change the dimension manually, you need to be sure to normalize the dimensions of the embedding as is shown below. +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const response = await client.embeddings.create({ + model: "text-embedding-3-small", + input: "Testing 123", + encoding_format: "float", +}); + +const shortened = response.data[0].embedding.slice(0, 256); +const magnitude = Math.hypot(...shortened); +const normalized = shortened.map((value) => + magnitude === 0 ? 0 : value / magnitude +); + +console.log(normalized); +``` + ```python from openai import OpenAI import numpy as np @@ -364,6 +408,34 @@ Dynamically changing the dimensions enables very flexible usage. For example, wh Question_answering_using_embeddings.ipynb There are many common cases where the model is not trained on data which contains key facts and information you want to make accessible when generating responses to a user query. One way of solving this, as shown below, is to put additional information into the context window of the model. This is effective in many use cases but leads to higher token costs. In this notebook, we explore the tradeoff between this approach and embeddings bases search. +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); +const article = + "At the 2022 Winter Olympics, Great Britain won women's curling and Sweden won men's curling."; +const question = `Use the article below to answer the question. If the answer cannot be found, say "I don't know." + +Article: +${article} + +Question: Which athletes won the gold medal in curling at the 2022 Winter Olympics?`; + +const response = await client.chat.completions.create({ + model: "gpt-4.1-mini", + messages: [ + { + role: "system", + content: "You answer questions about the 2022 Winter Olympics.", + }, + { role: "user", content: question }, + ], + temperature: 0, +}); + +console.log(response.choices[0].message.content); +``` + ```python query = f"""Use the below article on the 2022 Winter Olympics to answer the subsequent question. If the answer cannot be found, write "I don't know." @@ -434,6 +506,41 @@ client.chat().completions().create(params).choices().stream() Semantic_text_search_using_embeddings.ipynb To retrieve the most relevant documents we use the cosine similarity between the embedding vectors of the query and each document, and return the highest scored documents. +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); +const reviews = [ + "A rich cup of coffee.", + "Smooth beans in tomato sauce.", + "Dark chocolate with orange.", +]; + +const { data } = await client.embeddings.create({ + model: "text-embedding-3-small", + input: [...reviews, "delicious beans"], +}); + +const query = data.at(-1).embedding; +const similarity = (embedding) => { + const dotProduct = embedding.reduce( + (total, value, index) => total + value * query[index], + 0 + ); + return dotProduct / (Math.hypot(...embedding) * Math.hypot(...query)); +}; + +const results = reviews + .map((review, index) => ({ + review, + score: similarity(data[index].embedding), + })) + .sort((left, right) => right.score - left.score) + .slice(0, 3); + +console.log(results); +``` + ```python def search_reviews(df, product_description, n=3, pprint=True): embedding = get_embedding(product_description, model="text-embedding-3-small") @@ -513,6 +620,39 @@ Code_search.ipynb To perform a code search, we embed the query in natural language using the same model. Then we calculate cosine similarity between the resulting query embedding and each of the function embeddings. The highest cosine similarity results are most relevant. +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); +const functions = [ + "function add(a, b) { return a + b; }", + "function complete(prompt) { return prompt; }", +]; + +const { data } = await client.embeddings.create({ + model: "text-embedding-3-small", + input: [...functions, "Completions API tests"], +}); + +const query = data.at(-1).embedding; +const similarity = (embedding) => { + const dotProduct = embedding.reduce( + (total, value, index) => total + value * query[index], + 0 + ); + return dotProduct / (Math.hypot(...embedding) * Math.hypot(...query)); +}; + +const results = functions + .map((source, index) => ({ + source, + score: similarity(data[index].embedding), + })) + .sort((left, right) => right.score - left.score); + +console.log(results); +``` + ```python df["code_embedding"] = df["code"].apply( lambda x: get_embedding(x, model="text-embedding-3-small") @@ -593,6 +733,37 @@ Recommendation_using_embeddings.ipynb Below, we illustrate a basic recommender. It takes in a list of strings and one 'source' string, computes their embeddings, and then returns a ranking of the strings, ranked from most similar to least similar. As a concrete example, the linked notebook below applies a version of this function to the [AG news dataset](http://groups.di.unipi.it/~gulli/AG_corpus_of_news_articles.html) (sampled down to 2,000 news article descriptions) to return the top 5 most similar articles to any given source article. +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); +const strings = [ + "A cheetah is a fast land animal.", + "A peregrine falcon is a fast bird.", + "A tortoise moves slowly.", +]; + +const { data } = await client.embeddings.create({ + model: "text-embedding-3-small", + input: strings, +}); + +const query = data[0].embedding; +const recommendations = data + .map(({ embedding }, index) => { + const dotProduct = embedding.reduce( + (total, value, dimension) => total + value * query[dimension], + 0 + ); + const similarity = + dotProduct / (Math.hypot(...embedding) * Math.hypot(...query)); + return { index, text: strings[index], similarity }; + }) + .sort((left, right) => right.similarity - left.similarity); + +console.log(recommendations); +``` + ```python def recommendations_from_strings( strings: List[str], @@ -812,6 +983,30 @@ preds = clf.predict(X_test) Zero-shot_classification_with_embeddings.ipynb We can use embeddings for zero shot classification without any labeled training data. For each class, we embed the class name or a short description of the class. To classify some new text in a zero-shot manner, we compare its embedding to all class embeddings and predict the class with the highest similarity. +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); +const labels = ["negative", "positive"]; + +const { data } = await client.embeddings.create({ + model: "text-embedding-3-small", + input: [...labels, "The coffee arrived quickly and tastes great."], +}); + +const review = data.at(-1).embedding; +const similarity = (embedding) => { + const dotProduct = embedding.reduce( + (total, value, index) => total + value * review[index], + 0 + ); + return dotProduct / (Math.hypot(...embedding) * Math.hypot(...review)); +}; + +const [negative, positive] = data.map(({ embedding }) => similarity(embedding)); +console.log(positive > negative ? "positive" : "negative"); +``` + ```python df = df[df.Score != 3] df["sentiment"] = df.Score.replace( diff --git a/docs/en/api/docs/guides/error-codes.md b/docs/en/api/docs/guides/error-codes.md index e41f1b3..8ede628 100644 --- a/docs/en/api/docs/guides/error-codes.md +++ b/docs/en/api/docs/guides/error-codes.md @@ -375,6 +375,30 @@ Our support team will investigate the issue and get back to you as soon as possi We advise you to programmatically handle errors returned by the API. To do so, you may want to use a code snippet like below: +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +try { + const response = await client.responses.create({ + model: "gpt-5.6", + input: "Hello world", + }); + console.log(response.output_text); +} catch (error) { + if (error instanceof OpenAI.APIConnectionError) { + console.error("Failed to connect to the OpenAI API:", error.message); + } else if (error instanceof OpenAI.RateLimitError) { + console.error("OpenAI API request exceeded its rate limit:", error.message); + } else if (error instanceof OpenAI.APIError) { + console.error("OpenAI API returned an error:", error.status, error.message); + } else { + throw error; + } +} +``` + ```python import openai from openai import OpenAI diff --git a/docs/en/api/docs/guides/evals.md b/docs/en/api/docs/guides/evals.md index b645138..f54bdbb 100644 --- a/docs/en/api/docs/guides/evals.md +++ b/docs/en/api/docs/guides/evals.md @@ -142,6 +142,26 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +ResponseResult response = await client.CreateResponseAsync( + "gpt-5.6", + [ + ResponseItem.CreateDeveloperMessageItem( + "Categorize the IT support ticket as Hardware, Software, or Other. Respond with only one of those words." + ), + ResponseItem.CreateUserMessageItem("My monitor will not turn on. Help!"), + ] +); + +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/file-inputs.md b/docs/en/api/docs/guides/file-inputs.md index 2625eb3..d8951cf 100644 --- a/docs/en/api/docs/guides/file-inputs.md +++ b/docs/en/api/docs/guides/file-inputs.md @@ -731,6 +731,35 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData fileBytes = BinaryData.FromBytes(await File.ReadAllBytesAsync("draconomicon.pdf")); +ResponseResult response = await client.CreateResponseAsync( + "gpt-5.6", + [ + ResponseItem.CreateUserMessageItem( + [ + ResponseContentPart.CreateInputFilePart( + fileBytes, + "application/pdf", + "draconomicon.pdf" + ), + ResponseContentPart.CreateInputTextPart( + "What is the first dragon in the book?" + ), + ] + ), + ] +); + +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "base64" require "openai" diff --git a/docs/en/api/docs/guides/flex-processing.md b/docs/en/api/docs/guides/flex-processing.md index b358afd..d633a78 100644 --- a/docs/en/api/docs/guides/flex-processing.md +++ b/docs/en/api/docs/guides/flex-processing.md @@ -105,6 +105,28 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using System.ClientModel; +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClientOptions clientOptions = new() { NetworkTimeout = TimeSpan.FromMinutes(15) }; +ResponsesClient client = new(new ApiKeyCredential(key), clientOptions); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + Instructions = "List and describe all the metaphors used in this book.", + ServiceTier = ResponseServiceTier.Flex, +}; +options.InputItems.Add(ResponseItem.CreateUserMessageItem("")); + +using CancellationTokenSource timeout = new(TimeSpan.FromMinutes(15)); +ResponseResult response = await client.CreateResponseAsync(options, timeout.Token); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/image-cost-calculator.md b/docs/en/api/docs/guides/image-cost-calculator.md new file mode 100644 index 0000000..7b2122d --- /dev/null +++ b/docs/en/api/docs/guides/image-cost-calculator.md @@ -0,0 +1,20 @@ +# Image input token and cost calculator + +> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. + +Estimate the input tokens and cost of sending an image to an OpenAI vision model. Select a model, enter your image dimensions, and choose a detail level. + +For GPT Image generation and editing costs, use the [image generation calculator](https://developers.openai.com/api/docs/guides/image-generation#calculating-costs). + +## Use the calculator + +1. Select the vision model you plan to use. +2. Enter the original image width and height in pixels. The calculator applies the model's resizing rules. +3. Select an image detail level supported by the model. +4. Read the image input tokens and estimated cost. Expand **Calculation details** to see the resized dimensions and token calculation. + +## Understand the estimate + +The estimate covers one image at standard input rates. It excludes other prompt tokens, model output, caching, long-context pricing, and data-residency adjustments. Billing can differ by one token due to rounding. + +For the resizing and tokenization rules, see [image input cost calculations](https://developers.openai.com/api/docs/guides/images-vision#calculating-costs). For current model rates and other charges, see [API pricing](https://developers.openai.com/api/docs/pricing). \ No newline at end of file diff --git a/docs/en/api/docs/guides/image-generation.md b/docs/en/api/docs/guides/image-generation.md index c221d35..5672cf9 100644 --- a/docs/en/api/docs/guides/image-generation.md +++ b/docs/en/api/docs/guides/image-generation.md @@ -341,6 +341,29 @@ String encoded = Files.write(Path.of("otter.png"), Base64.getDecoder().decode(encoded)); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); +options.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); + +ResponseResult response = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem image = response + .OutputItems.OfType() + .FirstOrDefault() + ?? throw new InvalidOperationException("No generated image was returned."); +await File.WriteAllBytesAsync("otter.png", image.ImageResultBytes.ToArray()); +``` + ```ruby require "base64" require "openai" @@ -492,6 +515,34 @@ Files.write(output, Base64.getDecoder().decode(imageResult)); System.out.println(output); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); +options.Tools.Add( + ResponseTool.CreateImageGenerationTool( + model: "gpt-image-2", + action: ImageGenerationToolAction.Generate + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem image = response + .OutputItems.OfType() + .FirstOrDefault() + ?? throw new InvalidOperationException("No generated image was returned."); +await File.WriteAllBytesAsync("otter.png", image.ImageResultBytes.ToArray()); +``` + ```ruby require "base64" require "openai" @@ -730,6 +781,45 @@ Files.write( .orElseThrow(() -> new IllegalStateException("No follow-up image returned")))); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); + +ResponseResult first = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem initialImage = first + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync("cat_and_otter.png", initialImage.ImageResultBytes.ToArray()); + +CreateResponseOptions followUp = new() +{ + Model = "gpt-5.6", + PreviousResponseId = first.Id, +}; +followUp.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +followUp.InputItems.Add(ResponseItem.CreateUserMessageItem("Now make it look realistic.")); + +ResponseResult second = await client.CreateResponseAsync(followUp); +ImageGenerationCallResponseItem updatedImage = second + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync( + "cat_and_otter_realistic.png", + updatedImage.ImageResultBytes.ToArray() +); +``` + ```ruby require "base64" require "openai" @@ -1029,6 +1119,42 @@ Files.write( .orElseThrow(() -> new IllegalStateException("No follow-up image returned")))); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); + +ResponseResult first = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem initialImage = first + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync("cat_and_otter.png", initialImage.ImageResultBytes.ToArray()); + +CreateResponseOptions followUp = new() { Model = "gpt-5.6" }; +followUp.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +followUp.InputItems.Add(ResponseItem.CreateUserMessageItem("Now make it look realistic.")); +followUp.InputItems.Add(ResponseItem.CreateReferenceItem(initialImage.Id)); + +ResponseResult second = await client.CreateResponseAsync(followUp); +ImageGenerationCallResponseItem updatedImage = second + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync( + "cat_and_otter_realistic.png", + updatedImage.ImageResultBytes.ToArray() +); +``` + ```ruby require "base64" require "openai" diff --git a/docs/en/api/docs/guides/images-vision.md b/docs/en/api/docs/guides/images-vision.md index be96486..9d00f81 100644 --- a/docs/en/api/docs/guides/images-vision.md +++ b/docs/en/api/docs/guides/images-vision.md @@ -1001,7 +1001,7 @@ For tasks that require fine visual detail or precise coordinates, such as optica ### Model sizing behavior -The following table covers the general-purpose vision models available in the [image input cost calculator](#image-input-cost-calculator). Other models and specialized variants can use different limits. All resizing preserves aspect ratio without enlarging smaller images. +The following table covers the general-purpose vision models available in the [image input cost calculator](https://developers.openai.com/api/docs/guides/image-cost-calculator). Other models and specialized variants can use different limits. All resizing preserves aspect ratio without enlarging smaller images. @@ -1089,13 +1089,13 @@ The following table covers the general-purpose vision models available in the [i ## Calculating costs -Vision models convert image inputs into billable input tokens. The calculator and patch/tile rules in this section cover vision-model inputs, not GPT Image generation or editing. See [GPT Image model inputs](#gpt-image-model-inputs) for that separate pricing. +Vision models convert image inputs into billable input tokens. The [image input cost calculator](https://developers.openai.com/api/docs/guides/image-cost-calculator) and patch/tile rules in this section cover vision-model inputs, not GPT Image generation or editing. See [GPT Image model inputs](#gpt-image-model-inputs) for that separate pricing. Image tokens also count toward your [tokens per minute (TPM) limits](https://developers.openai.com/api/docs/guides/rate-limits). The calculator estimates one image at standard input rates; it does not include the rest of your prompt or model output. ### Image input cost calculator -Estimate input tokens and cost for one image. +Use the [image input cost calculator](https://developers.openai.com/api/docs/guides/image-cost-calculator) to estimate input tokens and cost for one image by model, image size, and detail level. ### Patch-based image tokenization diff --git a/docs/en/api/docs/guides/latest-model/gpt-5.2.md b/docs/en/api/docs/guides/latest-model/gpt-5.2.md index c9e6b45..6f75ca8 100644 --- a/docs/en/api/docs/guides/latest-model/gpt-5.2.md +++ b/docs/en/api/docs/guides/latest-model/gpt-5.2.md @@ -133,6 +133,31 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.2", + ReasoningOptions = new ResponseReasoningOptions + { + ReasoningEffortLevel = ResponseReasoningEffortLevel.None, + }, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Think carefully and outline your steps before answering. How much gold would it take to coat the Statue of Liberty in a 1mm layer?" + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -792,7 +817,7 @@ compaction = client.responses.compact( model: "gpt-5.2", input: [ {role: :user, content: "Write a very long poem about a dog."}, - *response.output.map(&:to_h) + *response.output ] ) diff --git a/docs/en/api/docs/guides/latest-model/gpt-5.4.md b/docs/en/api/docs/guides/latest-model/gpt-5.4.md index be0f34b..71eba01 100644 --- a/docs/en/api/docs/guides/latest-model/gpt-5.4.md +++ b/docs/en/api/docs/guides/latest-model/gpt-5.4.md @@ -136,6 +136,31 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.4", + ReasoningOptions = new ResponseReasoningOptions + { + ReasoningEffortLevel = ResponseReasoningEffortLevel.None, + }, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Think carefully and outline your steps before answering. How much gold would it take to coat the Statue of Liberty in a 1mm layer?" + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/latest-model/gpt-5.6.md b/docs/en/api/docs/guides/latest-model/gpt-5.6.md index d236e60..53d4c82 100644 --- a/docs/en/api/docs/guides/latest-model/gpt-5.6.md +++ b/docs/en/api/docs/guides/latest-model/gpt-5.6.md @@ -25,7 +25,7 @@ When migrating from GPT-5.5 or GPT-5.4, start with your current GPT-5.5 or GPT-5 - **Persisted reasoning:** GPT-5.6 can reuse available reasoning items across turns to improve multi-turn quality and cache efficiency. Use `reasoning.context` to select the behavior. Learn how to [preserve reasoning across calls](https://developers.openai.com/api/docs/guides/reasoning#preserve-reasoning-across-calls). - **Max reasoning effort:** GPT-5.6 supports `max` reasoning effort for demanding tasks that need more exploration and verification. If you currently use `xhigh`, compare both settings on representative workloads. - **Pro mode:** GPT-5.6 can perform more model work to improve reliability on difficult tasks and return a single final answer. Enable it with `reasoning.mode: "pro"` when quality matters more than latency and token usage. Learn how to [use pro mode](https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode). -- **Token efficiency:** GPT-5.6 reaches frontier performance with fewer output tokens. +- **Token efficiency:** GPT-5.6 reaches flagship-level performance with fewer output tokens. - **Frontend design:** GPT-5.6 creates more polished and usable websites and applications, with stronger layout, visual hierarchy, and design judgment. - **Intent understanding:** GPT-5.6 can better infer the user's underlying goal and intended level of work from context, so you often do not need to prescribe every step. Continue to provide domain context, hard constraints, approval boundaries, and success criteria. Tell the model when an important ambiguity should trigger a question. - **Original image detail:** GPT-5.6 preserves the original dimensions of images sent with `original` or `auto` detail instead of resizing them to a patch budget or pixel-dimension limit. Large images can use more input tokens and increase latency. Learn how to [choose an image detail level](https://developers.openai.com/api/docs/guides/images-vision#choose-an-image-detail-level). @@ -56,7 +56,7 @@ To use this skill in other coding agents, download it from the [OpenAI skills re ### Update API and model parameters -- Choose the target model for the workload. Use `gpt-5.6-sol` for frontier capability, `gpt-5.6-terra` for a balance of intelligence and cost, or `gpt-5.6-luna` for efficient, high-volume workloads. The `gpt-5.6` alias routes requests to `gpt-5.6-sol`. +- Choose the target model for the workload. Use `gpt-5.6-sol` for flagship capability, `gpt-5.6-terra` for a balance of intelligence and cost, or `gpt-5.6-luna` for efficient, high-volume workloads. The `gpt-5.6` alias routes requests to `gpt-5.6-sol`. - Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses) for reasoning, tool-calling, and multi-turn workflows. - Set `reasoning.effort` intentionally. GPT-5.6 supports `none`, `low`, `medium`, `high`, `xhigh`, and `max`. - If you are migrating from GPT-5.5 or GPT-5.4, preserve your current reasoning effort as the baseline, then compare one level lower. diff --git a/docs/en/api/docs/guides/migrate-to-responses.md b/docs/en/api/docs/guides/migrate-to-responses.md index 3a876b1..636dbde 100644 --- a/docs/en/api/docs/guides/migrate-to-responses.md +++ b/docs/en/api/docs/guides/migrate-to-responses.md @@ -911,6 +911,26 @@ client .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +List history = +[ + ResponseItem.CreateUserMessageItem("What is the capital of France?"), +]; + +ResponseResult first = await client.CreateResponseAsync("gpt-5.6", history); +history.AddRange(first.OutputItems); +history.Add(ResponseItem.CreateUserMessageItem("And its population?")); + +ResponseResult second = await client.CreateResponseAsync("gpt-5.6", history); +Console.WriteLine(second.GetOutputText()); +``` + ```ruby require "openai" @@ -921,7 +941,7 @@ first = client.responses.create( model: "gpt-5.6", input: context ) -context.concat(first.output.map(&:to_h)) +context.concat(first.output) context << {role: :user, content: "And its population?"} second = client.responses.create( @@ -1955,6 +1975,23 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add(ResponseTool.CreateWebSearchTool()); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Who is the current president of France?") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -2014,4 +2051,4 @@ We recommend migrating all flows to the Responses API over time to take advantag Based on developer feedback from the [Assistants API](https://developers.openai.com/api/reference/resources/beta/subresources/assistants) beta, we've incorporated key improvements into the Responses API to make it more flexible, faster, and easier to use. The Responses API represents the future direction for building agents on OpenAI. -We now have Assistant-like and Thread-like objects in the Responses API. Learn more in the [migration guide](https://developers.openai.com/api/docs/assistants/migration). As of August 26, 2025, we're deprecating the Assistants API, with a sunset date of August 26, 2026. \ No newline at end of file +The Assistants API was officially sunset on August 26, 2026, and is no longer available. Follow the [migration guide](https://developers.openai.com/api/docs/assistants/migration) to update your integration to the Responses API. \ No newline at end of file diff --git a/docs/en/api/docs/guides/predicted-outputs.md b/docs/en/api/docs/guides/predicted-outputs.md index 0e146c5..547c0e0 100644 --- a/docs/en/api/docs/guides/predicted-outputs.md +++ b/docs/en/api/docs/guides/predicted-outputs.md @@ -183,6 +183,41 @@ client.chat().completions().create(params).choices().stream() .forEach(System.out::println); ``` +```csharp +using OpenAI.Chat; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string model = "gpt-4.1"; +ChatClient client = new(model, key); + +string code = + """ + class User { + firstName = ""; + lastName = ""; + username = ""; + } + + export default User; + """; +ChatCompletionOptions options = new() +{ + OutputPrediction = ChatOutputPrediction.CreateStaticContentPrediction(code), +}; +ChatCompletion completion = await client.CompleteChatAsync( + [ + new UserChatMessage( + "Replace the username property with an email property. Respond only with code, and with no markdown formatting." + ), + new UserChatMessage(code), + ], + options +); + +Console.WriteLine(completion.Content[0].Text); +``` + ```ruby require "openai" @@ -443,6 +478,48 @@ try (StreamResponse stream = } ``` +```csharp +using OpenAI.Chat; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string model = "gpt-4.1"; +ChatClient client = new(model, key); + +string code = + """ + class User { + firstName = ""; + lastName = ""; + username = ""; + } + + export default User; + """; +ChatCompletionOptions options = new() +{ + OutputPrediction = ChatOutputPrediction.CreateStaticContentPrediction(code), +}; + +await foreach ( + StreamingChatCompletionUpdate update in client.CompleteChatStreamingAsync( + [ + new UserChatMessage( + "Replace the username property with an email property. Respond only with code, and with no markdown formatting." + ), + new UserChatMessage(code), + ], + options + ) +) +{ + foreach (ChatMessageContentPart part in update.ContentUpdate) + { + Console.Write(part.Text); + } +} +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/prompt-engineering.md b/docs/en/api/docs/guides/prompt-engineering.md index c0ffd50..0505cd9 100644 --- a/docs/en/api/docs/guides/prompt-engineering.md +++ b/docs/en/api/docs/guides/prompt-engineering.md @@ -703,6 +703,27 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +string instructions = await File.ReadAllTextAsync("prompt.txt"); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + Instructions = instructions, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("How would I declare a variable for a last name?") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/prompt-generation.md b/docs/en/api/docs/guides/prompt-generation.md index 9818cd7..d89a184 100644 --- a/docs/en/api/docs/guides/prompt-generation.md +++ b/docs/en/api/docs/guides/prompt-generation.md @@ -27,6 +27,75 @@ Text-out Text meta-prompt +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const metaPrompt = `Given a task description or existing prompt, produce a detailed system prompt to guide a language model in completing the task effectively. + +# Guidelines + +- Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output. +- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure. +- Reasoning Before Conclusions**: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS! + - Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed. + - Conclusion, classifications, or results should ALWAYS appear last. +- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements. + - What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from placeholders. +- Clarity and Conciseness: Use clear, specific language. Avoid unnecessary instructions or bland statements. +- Formatting: Use markdown features for readability. DO NOT USE \`\`\` CODE BLOCKS UNLESS SPECIFICALLY REQUESTED. +- Preserve User Content: If the input task or prompt includes extensive guidelines or examples, preserve them entirely, or as closely as possible. If they are vague, consider breaking down into sub-steps. Keep any details, guidelines, examples, variables, or placeholders provided by the user. +- Constants: DO include constants in the prompt, as they are not susceptible to prompt injection. Such as guides, rubrics, and examples. +- Output Format: Explicitly the most appropriate output format, in detail. This should include length and syntax (e.g. short sentence, paragraph, JSON, etc.) + - For tasks outputting well-defined or structured data (classification, JSON, etc.) bias toward outputting a JSON. + - JSON should never be wrapped in code blocks (\`\`\`) unless explicitly requested. + +The final prompt you output should adhere to the following structure below. Do not include any additional commentary, only output the completed system prompt. SPECIFICALLY, do not include any additional messages at the start or end of the prompt. (e.g. no "---") + +[Concise instruction describing the task - this should be the first line in the prompt, no section header] + +[Additional details as needed.] + +[Optional sections with headings or bullet points for detailed steps.] + +# Steps [optional] + +[optional: a detailed breakdown of the steps necessary to accomplish the task] + +# Output Format + +[Specifically call out how the output should be formatted, be it response length, structure e.g. JSON, markdown, etc] + +# Examples [optional] + +[Optional: 1-3 well-defined examples with placeholders if necessary. Clearly mark where examples start and end, and what the input and output are. User placeholders as necessary.] +[If the examples are shorter than what a realistic example is expected to be, make a reference with () explaining how real examples should be longer / shorter / different. AND USE PLACEHOLDERS! ] + +# Notes [optional] + +[optional: edge cases, details, and an area to call or repeat out specific important considerations]`; + +async function generatePrompt(taskOrPrompt) { + const completion = await client.chat.completions.create({ + model: "gpt-5.6", + messages: [ + { role: "system", content: metaPrompt }, + { + role: "user", + content: "Task, Goal, or Current Prompt:\n" + taskOrPrompt, + }, + ], + }); + + return completion.choices[0].message.content; +} + +console.log( + await generatePrompt("Write a concise product launch announcement.") +); +``` + ````python from openai import OpenAI @@ -172,6 +241,66 @@ Audio-out Audio meta-prompt +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const metaPrompt = `Given a task description or existing prompt, produce a detailed system prompt to guide a realtime audio output language model in completing the task effectively. + +# Guidelines + +- Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output. +- Tone: Make sure to specifically call out the tone. By default it should be emotive and friendly, and speak quickly to avoid keeping the user just waiting. +- Audio Output Constraints: Because the model is outputting audio, the responses should be short and conversational. +- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure. +- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements. + - What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from placeholders. + - It is very important that any examples included reflect the short, conversational output responses of the model. +Keep the sentences very short by default. Instead of 3 sentences in a row by the assistant, it should be split up with a back and forth with the user instead. + - By default each sentence should be a few words only (5-20ish words). However, if the user specifically asks for "short" responses, then the examples should truly have 1-10 word responses max. + - Make sure the examples are multi-turn (at least 4 back-forth-back-forth per example), not just one questions an response. They should reflect an organic conversation. +- Clarity and Conciseness: Use clear, specific language. Avoid unnecessary instructions or bland statements. +- Preserve User Content: If the input task or prompt includes extensive guidelines or examples, preserve them entirely, or as closely as possible. If they are vague, consider breaking down into sub-steps. Keep any details, guidelines, examples, variables, or placeholders provided by the user. +- Constants: DO include constants in the prompt, as they are not susceptible to prompt injection. Such as guides, rubrics, and examples. + +The final prompt you output should adhere to the following structure below. Do not include any additional commentary, only output the completed system prompt. SPECIFICALLY, do not include any additional messages at the start or end of the prompt. (e.g. no "---") + +[Concise instruction describing the task - this should be the first line in the prompt, no section header] + +[Additional details as needed.] + +[Optional sections with headings or bullet points for detailed steps.] + +# Examples [optional] + +[Optional: 1-3 well-defined examples with placeholders if necessary. Clearly mark where examples start and end, and what the input and output are. User placeholders as necessary.] +[If the examples are shorter than what a realistic example is expected to be, make a reference with () explaining how real examples should be longer / shorter / different. AND USE PLACEHOLDERS! ] + +# Notes [optional] + +[optional: edge cases, details, and an area to call or repeat out specific important considerations]`; + +async function generatePrompt(taskOrPrompt) { + const completion = await client.chat.completions.create({ + model: "gpt-5.6", + messages: [ + { role: "system", content: metaPrompt }, + { + role: "user", + content: "Task, Goal, or Current Prompt:\n" + taskOrPrompt, + }, + ], + }); + + return completion.choices[0].message.content; +} + +console.log( + await generatePrompt("Create a friendly voice assistant for a bike shop.") +); +``` + ```python from openai import OpenAI @@ -303,6 +432,94 @@ Text-out Text meta-prompt for edits +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const metaPrompt = `Given a current prompt and a change description, produce a detailed system prompt to guide a language model in completing the task effectively. + +Your final output will be the full corrected prompt verbatim. However, before that, at the very beginning of your response, use tags to analyze the prompt and determine the following, explicitly: + +- Simple Change: (yes/no) Is the change description explicit and simple? (If so, skip the rest of these questions.) +- Reasoning: (yes/no) Does the current prompt use reasoning, analysis, or chain of thought? + - Identify: (max 10 words) if so, which section(s) utilize reasoning? + - Conclusion: (yes/no) is the chain of thought used to determine a conclusion? + - Ordering: (before/after) is the chain of though located before or after +- Structure: (yes/no) does the input prompt have a well defined structure +- Examples: (yes/no) does the input prompt have few-shot examples + - Representative: (1-5) if present, how representative are the examples? +- Complexity: (1-5) how complex is the input prompt? + - Task: (1-5) how complex is the implied task? + - Necessity: () +- Specificity: (1-5) how detailed and specific is the prompt? (not to be confused with length) +- Prioritization: (list) what 1-3 categories are the MOST important to address. +- Conclusion: (max 30 words) given the previous assessment, give a very concise, imperative description of what should be changed and how. this does not have to adhere strictly to only the categories listed + + +# Guidelines + +- Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output. +- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure. +- Reasoning Before Conclusions**: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS! + - Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed. + - Conclusion, classifications, or results should ALWAYS appear last. +- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements. + - What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from placeholders. +- Clarity and Conciseness: Use clear, specific language. Avoid unnecessary instructions or bland statements. +- Formatting: Use markdown features for readability. DO NOT USE \`\`\` CODE BLOCKS UNLESS SPECIFICALLY REQUESTED. +- Preserve User Content: If the input task or prompt includes extensive guidelines or examples, preserve them entirely, or as closely as possible. If they are vague, consider breaking down into sub-steps. Keep any details, guidelines, examples, variables, or placeholders provided by the user. +- Constants: DO include constants in the prompt, as they are not susceptible to prompt injection. Such as guides, rubrics, and examples. +- Output Format: Explicitly the most appropriate output format, in detail. This should include length and syntax (e.g. short sentence, paragraph, JSON, etc.) + - For tasks outputting well-defined or structured data (classification, JSON, etc.) bias toward outputting a JSON. + - JSON should never be wrapped in code blocks (\`\`\`) unless explicitly requested. + +The final prompt you output should adhere to the following structure below. Do not include any additional commentary, only output the completed system prompt. SPECIFICALLY, do not include any additional messages at the start or end of the prompt. (e.g. no "---") + +[Concise instruction describing the task - this should be the first line in the prompt, no section header] + +[Additional details as needed.] + +[Optional sections with headings or bullet points for detailed steps.] + +# Steps [optional] + +[optional: a detailed breakdown of the steps necessary to accomplish the task] + +# Output Format + +[Specifically call out how the output should be formatted, be it response length, structure e.g. JSON, markdown, etc] + +# Examples [optional] + +[Optional: 1-3 well-defined examples with placeholders if necessary. Clearly mark where examples start and end, and what the input and output are. User placeholders as necessary.] +[If the examples are shorter than what a realistic example is expected to be, make a reference with () explaining how real examples should be longer / shorter / different. AND USE PLACEHOLDERS! ] + +# Notes [optional] + +[optional: edge cases, details, and an area to call or repeat out specific important considerations] +[NOTE: you must start with a section. the immediate next token you produce should be ]`; + +async function generatePrompt(taskOrPrompt) { + const completion = await client.chat.completions.create({ + model: "gpt-5.6", + messages: [ + { role: "system", content: metaPrompt }, + { + role: "user", + content: "Task, Goal, or Current Prompt:\n" + taskOrPrompt, + }, + ], + }); + + return completion.choices[0].message.content; +} + +console.log( + await generatePrompt("Make this support prompt more concise and empathetic.") +); +``` + ````python from openai import OpenAI @@ -486,6 +703,87 @@ Audio-out Audio meta-prompt for edits +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const metaPrompt = `Given a current prompt and a change description, produce a detailed system prompt to guide a realtime audio output language model in completing the task effectively. + +Your final output will be the full corrected prompt verbatim. However, before that, at the very beginning of your response, use tags to analyze the prompt and determine the following, explicitly: + +- Simple Change: (yes/no) Is the change description explicit and simple? (If so, skip the rest of these questions.) +- Reasoning: (yes/no) Does the current prompt use reasoning, analysis, or chain of thought? + - Identify: (max 10 words) if so, which section(s) utilize reasoning? + - Conclusion: (yes/no) is the chain of thought used to determine a conclusion? + - Ordering: (before/after) is the chain of though located before or after +- Structure: (yes/no) does the input prompt have a well defined structure +- Examples: (yes/no) does the input prompt have few-shot examples + - Representative: (1-5) if present, how representative are the examples? +- Complexity: (1-5) how complex is the input prompt? + - Task: (1-5) how complex is the implied task? + - Necessity: () +- Specificity: (1-5) how detailed and specific is the prompt? (not to be confused with length) +- Prioritization: (list) what 1-3 categories are the MOST important to address. +- Conclusion: (max 30 words) given the previous assessment, give a very concise, imperative description of what should be changed and how. this does not have to adhere strictly to only the categories listed + + +# Guidelines + +- Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output. +- Tone: Make sure to specifically call out the tone. By default it should be emotive and friendly, and speak quickly to avoid keeping the user just waiting. +- Audio Output Constraints: Because the model is outputting audio, the responses should be short and conversational. +- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure. +- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements. + - What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from placeholders. + - It is very important that any examples included reflect the short, conversational output responses of the model. +Keep the sentences very short by default. Instead of 3 sentences in a row by the assistant, it should be split up with a back and forth with the user instead. + - By default each sentence should be a few words only (5-20ish words). However, if the user specifically asks for "short" responses, then the examples should truly have 1-10 word responses max. + - Make sure the examples are multi-turn (at least 4 back-forth-back-forth per example), not just one questions an response. They should reflect an organic conversation. +- Clarity and Conciseness: Use clear, specific language. Avoid unnecessary instructions or bland statements. +- Preserve User Content: If the input task or prompt includes extensive guidelines or examples, preserve them entirely, or as closely as possible. If they are vague, consider breaking down into sub-steps. Keep any details, guidelines, examples, variables, or placeholders provided by the user. +- Constants: DO include constants in the prompt, as they are not susceptible to prompt injection. Such as guides, rubrics, and examples. + +The final prompt you output should adhere to the following structure below. Do not include any additional commentary, only output the completed system prompt. SPECIFICALLY, do not include any additional messages at the start or end of the prompt. (e.g. no "---") + +[Concise instruction describing the task - this should be the first line in the prompt, no section header] + +[Additional details as needed.] + +[Optional sections with headings or bullet points for detailed steps.] + +# Examples [optional] + +[Optional: 1-3 well-defined examples with placeholders if necessary. Clearly mark where examples start and end, and what the input and output are. User placeholders as necessary.] +[If the examples are shorter than what a realistic example is expected to be, make a reference with () explaining how real examples should be longer / shorter / different. AND USE PLACEHOLDERS! ] + +# Notes [optional] + +[optional: edge cases, details, and an area to call or repeat out specific important considerations] +[NOTE: you must start with a section. the immediate next token you produce should be ]`; + +async function generatePrompt(taskOrPrompt) { + const completion = await client.chat.completions.create({ + model: "gpt-5.6", + messages: [ + { role: "system", content: metaPrompt }, + { + role: "user", + content: "Task, Goal, or Current Prompt:\n" + taskOrPrompt, + }, + ], + }); + + return completion.choices[0].message.content; +} + +console.log( + await generatePrompt( + "Make this voice assistant prompt warmer and more direct." + ) +); +``` + ```python from openai import OpenAI @@ -702,45 +1000,342 @@ Structured output schema Structured output meta-schema -```python -from openai import OpenAI -import json - -client = OpenAI() - -META_SCHEMA = { - "name": "metaschema", - "schema": { - "type": "object", - "properties": { - "name": {"type": "string", "description": "The name of the schema"}, - "type": { - "type": "string", - "enum": ["object", "array", "string", "number", "boolean", "null"], +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const metaSchema = { + name: "metaschema", + schema: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the schema", + }, + type: { + type: "string", + enum: ["object", "array", "string", "number", "boolean", "null"], + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/$defs/schema_definition", + }, + }, + items: { + anyOf: [ + { + $ref: "#/$defs/schema_definition", + }, + { + type: "array", + items: { + $ref: "#/$defs/schema_definition", }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#/$defs/schema_definition"}, + }, + ], + }, + required: { + type: "array", + items: { + type: "string", + }, + }, + additionalProperties: { + type: "boolean", + }, + }, + required: ["type"], + additionalProperties: false, + if: { + properties: { + type: { + const: "object", + }, + }, + }, + then: { + required: ["properties"], + }, + $defs: { + schema_definition: { + type: "object", + properties: { + type: { + type: "string", + enum: ["object", "array", "string", "number", "boolean", "null"], + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/$defs/schema_definition", }, - "items": { - "anyOf": [ - {"$ref": "#/$defs/schema_definition"}, - {"type": "array", "items": {"$ref": "#/$defs/schema_definition"}}, - ] + }, + items: { + anyOf: [ + { + $ref: "#/$defs/schema_definition", + }, + { + type: "array", + items: { + $ref: "#/$defs/schema_definition", + }, + }, + ], + }, + required: { + type: "array", + items: { + type: "string", }, - "required": {"type": "array", "items": {"type": "string"}}, - "additionalProperties": {"type": "boolean"}, + }, + additionalProperties: { + type: "boolean", + }, }, - "required": ["type"], - "additionalProperties": False, - "if": {"properties": {"type": {"const": "object"}}}, - "then": {"required": ["properties"]}, - "$defs": { - "schema_definition": { - "type": "object", - "properties": { - "type": { - "type": "string", + required: ["type"], + additionalProperties: false, + if: { + properties: { + type: { + const: "object", + }, + }, + }, + then: { + required: ["properties"], + }, + }, + }, + }, +}; + +const metaPrompt = `# Instructions +Return a valid schema for the described JSON. + +You must also make sure: +- all fields in an object are set as required +- I REPEAT, ALL FIELDS MUST BE MARKED AS REQUIRED +- all objects must have additionalProperties set to false + - because of this, some cases like "attributes" or "metadata" properties that would normally allow additional properties should instead have a fixed set of properties +- all objects must have properties defined +- field order matters. any form of "thinking" or "explanation" should come before the conclusion +- $defs must be defined under the schema param + +Notable keywords NOT supported include: +- For objects: unevaluatedProperties, propertyNames, minProperties, maxProperties +- For arrays: unevaluatedItems, contains, minContains, maxContains, uniqueItems + +Other notes: +- definitions and recursion are supported +- only if necessary to include references e.g. "$defs", it must be inside the "schema" object + +# Examples +Input: Generate a math reasoning schema with steps and a final answer. +Output: { + "name": "math_reasoning", + "type": "object", + "properties": { + "steps": { + "type": "array", + "description": "A sequence of steps involved in solving the math problem.", + "items": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "Description of the reasoning or method used in this step." + }, + "output": { + "type": "string", + "description": "Result or outcome of this specific step." + } + }, + "required": [ + "explanation", + "output" + ], + "additionalProperties": false + } + }, + "final_answer": { + "type": "string", + "description": "The final solution or answer to the math problem." + } + }, + "required": [ + "steps", + "final_answer" + ], + "additionalProperties": false +} + +Input: Give me a linked list +Output: { + "name": "linked_list", + "type": "object", + "properties": { + "linked_list": { + "$ref": "#/$defs/linked_list_node", + "description": "The head node of the linked list." + } + }, + "$defs": { + "linked_list_node": { + "type": "object", + "description": "Defines a node in a singly linked list.", + "properties": { + "value": { + "type": "number", + "description": "The value stored in this node." + }, + "next": { + "anyOf": [ + { + "$ref": "#/$defs/linked_list_node" + }, + { + "type": "null" + } + ], + "description": "Reference to the next node; null if it is the last node." + } + }, + "required": [ + "value", + "next" + ], + "additionalProperties": false + } + }, + "required": [ + "linked_list" + ], + "additionalProperties": false +} + +Input: Dynamically generated UI +Output: { + "name": "ui", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of the UI component", + "enum": [ + "div", + "button", + "header", + "section", + "field", + "form" + ] + }, + "label": { + "type": "string", + "description": "The label of the UI component, used for buttons or form fields" + }, + "children": { + "type": "array", + "description": "Nested UI components", + "items": { + "$ref": "#" + } + }, + "attributes": { + "type": "array", + "description": "Arbitrary attributes for the UI component, suitable for any element", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the attribute, for example onClick or className" + }, + "value": { + "type": "string", + "description": "The value of the attribute" + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "type", + "label", + "children", + "attributes" + ], + "additionalProperties": false +}`; + +async function generateSchema(description) { + const completion = await client.chat.completions.create({ + model: "gpt-5.6-terra", + response_format: { type: "json_schema", json_schema: metaSchema }, + messages: [ + { role: "system", content: metaPrompt }, + { role: "user", content: "Description:\n" + description }, + ], + }); + + const content = completion.choices[0].message.content; + if (!content) throw new Error("The model did not return a schema."); + return JSON.parse(content); +} + +console.log( + JSON.stringify(await generateSchema("Describe a calendar event."), null, 2) +); +``` + +```python +from openai import OpenAI +import json + +client = OpenAI() + +META_SCHEMA = { + "name": "metaschema", + "schema": { + "type": "object", + "properties": { + "name": {"type": "string", "description": "The name of the schema"}, + "type": { + "type": "string", + "enum": ["object", "array", "string", "number", "boolean", "null"], + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#/$defs/schema_definition"}, + }, + "items": { + "anyOf": [ + {"$ref": "#/$defs/schema_definition"}, + {"type": "array", "items": {"$ref": "#/$defs/schema_definition"}}, + ] + }, + "required": {"type": "array", "items": {"type": "string"}}, + "additionalProperties": {"type": "boolean"}, + }, + "required": ["type"], + "additionalProperties": False, + "if": {"properties": {"type": {"const": "object"}}}, + "then": {"required": ["properties"]}, + "$defs": { + "schema_definition": { + "type": "object", + "properties": { + "type": { + "type": "string", "enum": [ "object", "array", @@ -1303,6 +1898,236 @@ Function schema Structured output meta-schema +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const metaSchema = { + name: "function-metaschema", + schema: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the function", + }, + description: { + type: "string", + description: "A description of what the function does", + }, + parameters: { + $ref: "#/$defs/schema_definition", + description: "A JSON schema that defines the function's parameters", + }, + }, + required: ["name", "description", "parameters"], + additionalProperties: false, + $defs: { + schema_definition: { + type: "object", + properties: { + type: { + type: "string", + enum: ["object", "array", "string", "number", "boolean", "null"], + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/$defs/schema_definition", + }, + }, + items: { + anyOf: [ + { + $ref: "#/$defs/schema_definition", + }, + { + type: "array", + items: { + $ref: "#/$defs/schema_definition", + }, + }, + ], + }, + required: { + type: "array", + items: { + type: "string", + }, + }, + additionalProperties: { + type: "boolean", + }, + }, + required: ["type"], + additionalProperties: false, + if: { + properties: { + type: { + const: "object", + }, + }, + }, + then: { + required: ["properties"], + }, + }, + }, + }, +}; + +const metaPrompt = `# Instructions +Return a valid schema for the described function. + +Pay special attention to making sure that "required" and "type" are always at the correct level of nesting. For example, "required" should be at the same level as "properties", not inside it. +Make sure that every property, no matter how short, has a type and description correctly nested inside it. + +# Examples +Input: Assign values to NN hyperparameters +Output: { + "name": "set_hyperparameters", + "description": "Assign values to NN hyperparameters", + "parameters": { + "type": "object", + "required": [ + "learning_rate", + "epochs" + ], + "properties": { + "epochs": { + "type": "number", + "description": "Number of complete passes through dataset" + }, + "learning_rate": { + "type": "number", + "description": "Speed of model learning" + } + } + } +} + +Input: Plans a motion path for the robot +Output: { + "name": "plan_motion", + "description": "Plans a motion path for the robot", + "parameters": { + "type": "object", + "required": [ + "start_position", + "end_position" + ], + "properties": { + "end_position": { + "type": "object", + "properties": { + "x": { + "type": "number", + "description": "End X coordinate" + }, + "y": { + "type": "number", + "description": "End Y coordinate" + } + } + }, + "obstacles": { + "type": "array", + "description": "Array of obstacle coordinates", + "items": { + "type": "object", + "properties": { + "x": { + "type": "number", + "description": "Obstacle X coordinate" + }, + "y": { + "type": "number", + "description": "Obstacle Y coordinate" + } + } + } + }, + "start_position": { + "type": "object", + "properties": { + "x": { + "type": "number", + "description": "Start X coordinate" + }, + "y": { + "type": "number", + "description": "Start Y coordinate" + } + } + } + } + } +} + +Input: Calculates various technical indicators +Output: { + "name": "technical_indicator", + "description": "Calculates various technical indicators", + "parameters": { + "type": "object", + "required": [ + "ticker", + "indicators" + ], + "properties": { + "indicators": { + "type": "array", + "description": "List of technical indicators to calculate", + "items": { + "type": "string", + "description": "Technical indicator", + "enum": [ + "RSI", + "MACD", + "Bollinger_Bands", + "Stochastic_Oscillator" + ] + } + }, + "period": { + "type": "number", + "description": "Time period for the analysis" + }, + "ticker": { + "type": "string", + "description": "Stock ticker symbol" + } + } + } +}`; + +async function generateFunctionSchema(description) { + const completion = await client.chat.completions.create({ + model: "gpt-5.6-terra", + response_format: { type: "json_schema", json_schema: metaSchema }, + messages: [ + { role: "system", content: metaPrompt }, + { role: "user", content: "Description:\n" + description }, + ], + }); + + const content = completion.choices[0].message.content; + if (!content) throw new Error("The model did not return a schema."); + return JSON.parse(content); +} + +console.log( + JSON.stringify( + await generateFunctionSchema( + "Create a function that checks the weather in a city." + ), + null, + 2 + ) +); +``` + ```python from openai import OpenAI import json diff --git a/docs/en/api/docs/guides/prompting/migrate-from-prompt-object.md b/docs/en/api/docs/guides/prompting/migrate-from-prompt-object.md index e092341..2afc8f6 100644 --- a/docs/en/api/docs/guides/prompting/migrate-from-prompt-object.md +++ b/docs/en/api/docs/guides/prompting/migrate-from-prompt-object.md @@ -258,6 +258,28 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +ResponseResult response = await client.CreateResponseAsync( + "gpt-5.6", + [ + ResponseItem.CreateSystemMessageItem( + "You are a helpful support assistant. Be concise, accurate, and friendly." + ), + ResponseItem.CreateUserMessageItem( + "Customer name: Acme. Issue: billing question. Write a response to the customer." + ), + ] +); + +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -451,6 +473,30 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +static ResponseItem[] BuildSupportPrompt(string customerName, string issue) => +[ + ResponseItem.CreateSystemMessageItem( + "You are a helpful support assistant. Be concise, accurate, and friendly. Do not invent policy details." + ), + ResponseItem.CreateUserMessageItem( + $"Customer name: {customerName}. Issue: {issue}. Write a response to the customer." + ), +]; + +ResponseResult response = await client.CreateResponseAsync( + "gpt-5.6", + BuildSupportPrompt("Acme", "billing question") +); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/realtime-conversations.md b/docs/en/api/docs/guides/realtime-conversations.md index 30711db..9e17e3d 100644 --- a/docs/en/api/docs/guides/realtime-conversations.md +++ b/docs/en/api/docs/guides/realtime-conversations.md @@ -119,6 +119,30 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.session.update( + type: :realtime, + model: "gpt-realtime-2.1", + output_modalities: [:audio], + audio: { + input: { + format: {type: :"audio/pcm", rate: 24_000}, + turn_detection: {type: :semantic_vad} + }, + output: { + format: {type: :"audio/pcm", rate: 24_000}, + voice: :marin + } + }, + prompt: { + id: ENV.fetch("OPENAI_REALTIME_PROMPT_ID"), + version: "89", + variables: {city: "Paris"} + }, + instructions: "Speak clearly and briefly. Confirm before taking action." +) +``` + When the session has been updated, the server will emit a [`session.updated`](https://developers.openai.com/api/reference/resources/realtime) event with the new state of the session. @@ -184,6 +208,14 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.conversation.items.create( + type: :message, + role: :user, + content: [{type: :input_text, text: "What is the weather like today?"}] +) +``` + After adding the user message to the conversation, send the [`response.create`](https://developers.openai.com/api/reference/resources/realtime) event to initiate a response from the model. If both audio and text are enabled for the current session, the model will respond with both audio and text content. If you'd like to generate text only, you can specify that when sending the `response.create` client event, as shown below. @@ -206,6 +238,13 @@ event = {"type": "response.create", "response": {"output_modalities": ["text"]}} ws.send(json.dumps(event)) ``` +```ruby +connection.response.create( + output_modalities: [:text], + instructions: "Respond with a concise text message." +) +``` + When the response is completely finished, the server will emit the [`response.done`](https://developers.openai.com/api/reference/resources/realtime) event. This event will contain the full text generated by the model, as shown below. @@ -234,6 +273,22 @@ def on_message(ws, message): print(server_event["response"]["output"][0]) ``` +```ruby +connection.each do |event| + next unless event.is_a?(OpenAI::Realtime::ResponseDoneEvent) + + puts("Response status: #{event.response.status}") + Array(event.response.output).each do |item| + next unless item.is_a?(OpenAI::Realtime::RealtimeConversationItemAssistantMessage) + + item.content.each do |content| + puts(content.text) if content.type == :output_text + end + end + break +end +``` + While the model response is being generated, the server will emit a number of lifecycle events during the process. You can listen for these events, such as [`response.output_text.delta`](https://developers.openai.com/api/reference/resources/realtime), to provide realtime feedback to users as the response is generated. A full listing of the events emitted by the server is found below under **related server events**. They are provided in the rough order of when they are emitted, along with relevant client-side events for text generation. @@ -548,6 +603,14 @@ for filename in files: ws.send(json.dumps(event)) ``` +```ruby +File.open("speech.pcm", "rb") do |audio| + while (chunk = audio.read(9_600)) + connection.input_audio_buffer.append_bytes(chunk) + end +end +``` + ### Send full audio messages @@ -596,6 +659,16 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +audio = Base64.strict_encode64(File.binread("speech.pcm")) + +connection.conversation.items.create( + type: :message, + role: :user, + content: [{type: :input_audio, audio: audio}] +) +``` + ### Working with audio output from a WebSocket @@ -633,6 +706,18 @@ def on_message(ws, message): print(server_event["delta"]) ``` +```ruby +connection.each do |event| + case event + when OpenAI::Realtime::ResponseAudioDeltaEvent + audio_bytes = Base64.strict_decode64(event.delta) + puts("Received #{audio_bytes.bytesize} audio bytes") + when OpenAI::Realtime::ResponseDoneEvent + break + end +end +``` + ## Image inputs @@ -661,6 +746,20 @@ const event = { dataChannel.send(JSON.stringify(event)); ``` +```ruby +encoded_image = Base64.strict_encode64(File.binread("image.png")) + +connection.conversation.items.create( + type: :message, + role: :user, + content: [ + {type: :input_image, image_url: "data:image/png;base64,#{encoded_image}"}, + {type: :input_text, text: "Describe this image."} + ] +) +connection.response.create(output_modalities: [:text]) +``` + ## Voice activity detection @@ -743,6 +842,15 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.response.create( + conversation: :none, + metadata: {topic: "classification"}, + output_modalities: [:text], + instructions: "Classify the conversation as support or sales." +) +``` + Now, when you listen for the [`response.done`](https://developers.openai.com/api/reference/resources/realtime) server event, you can identify the result of your out-of-band response. @@ -784,6 +892,23 @@ def on_message(ws, message): print(server_event["response"]["output"][0]) ``` +```ruby +connection.each do |event| + next unless event.is_a?(OpenAI::Realtime::ResponseDoneEvent) + next unless event.response.metadata&.fetch(:topic, nil) == "classification" + + puts("Classification response completed: #{event.response.status}") + Array(event.response.output).each do |item| + next unless item.is_a?(OpenAI::Realtime::RealtimeConversationItemAssistantMessage) + + item.content.each do |content| + puts("Classification: #{content.text}") if content.type == :output_text + end + end + break +end +``` + ### Create a custom context for responses @@ -855,6 +980,22 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.response.create( + conversation: :none, + metadata: {topic: "classification"}, + output_modalities: [:text], + input: [ + {type: :item_reference, id: ENV.fetch("OPENAI_REALTIME_CONTEXT_ITEM_ID")}, + { + type: :message, + role: :user, + content: [{type: :input_text, text: "Classify this issue: my order is late."}] + } + ] +) +``` + ### Create responses with no context @@ -901,6 +1042,14 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.response.create( + input: [], + output_modalities: [:text], + instructions: "Generate a concise greeting without conversation context." +) +``` + ## Function calling diff --git a/docs/en/api/docs/guides/realtime-mcp.md b/docs/en/api/docs/guides/realtime-mcp.md index 01b47f5..8969bda 100644 --- a/docs/en/api/docs/guides/realtime-mcp.md +++ b/docs/en/api/docs/guides/realtime-mcp.md @@ -85,6 +85,29 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.session.update( + type: :realtime, + model: "gpt-realtime-2.1", + tools: [{ + type: :function, + name: "lookup_order", + description: "Look up an order by its order number.", + parameters: { + type: "object", + properties: { + order_number: { + type: "string", + description: "The customer-facing order number." + } + }, + required: ["order_number"] + } + }], + tool_choice: :auto +) +``` + When the model calls the function, listen for the function call item, run your application logic, then send the output back: @@ -126,6 +149,15 @@ ws.send(json.dumps(event)) ws.send(json.dumps({"type": "response.create"})) ``` +```ruby +connection.conversation.items.create( + type: :function_call_output, + call_id: call_id, + output: JSON.generate(status: "shipped", delivery_date: "2026-05-09") +) +connection.response.create(tool_choice: :none) +``` + For a full event-by-event walkthrough of function calling, see [Managing conversations](https://developers.openai.com/api/docs/guides/realtime-conversations#function-calling). @@ -191,6 +223,21 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.session.update( + type: :realtime, + model: "gpt-realtime-2.1", + output_modalities: [:text], + tools: [{ + type: :mcp, + server_label: "openai_docs", + server_url: "https://developers.openai.com/mcp", + allowed_tools: ["search_openai_docs", "fetch_openai_doc"], + require_approval: :never + }] +) +``` + Built-in connectors use the same MCP tool shape, but pass `connector_id` instead of `server_url`. For example, Google Calendar uses @@ -251,6 +298,24 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +access_token = ENV.fetch("OPENAI_MCP_ACCESS_TOKEN") + +connection.session.update( + type: :realtime, + model: "gpt-realtime-2.1", + output_modalities: [:text], + tools: [{ + type: :mcp, + server_label: "google_calendar", + connector_id: "connector_googlecalendar", + authorization: access_token, + allowed_tools: ["search_events", "read_event"], + require_approval: :never + }] +) +``` + Remote MCP servers **don't automatically receive the full conversation context**, @@ -425,6 +490,67 @@ def on_message(ws, message): print("Realtime turn complete.") ``` +```ruby +connection.each do |event| + case event + when OpenAI::Realtime::McpListToolsInProgress + puts("Listing MCP tools for item: #{event.item_id}") + when OpenAI::Realtime::McpListToolsFailed + warn("MCP tool listing failed for item: #{event.item_id}") + break + when OpenAI::Realtime::McpListToolsCompleted + puts("MCP tools ready for item: #{event.item_id}") + connection.response.create( + output_modalities: [:text], + input: [{ + type: :message, + role: :user, + content: [{ + type: :input_text, + text: "Which Realtime API transport should browser clients use?" + }] + }], + tool_choice: :required + ) + when OpenAI::Realtime::ConversationItemDone + item = event.item + case item + when OpenAI::Realtime::RealtimeMcpListTools + names = item.tools.map(&:name).join(", ") + puts("MCP tools ready on #{item.server_label}: #{names}") + when OpenAI::Realtime::RealtimeMcpApprovalRequest + puts("Approval required for: #{item.name} #{item.arguments}") + end + when OpenAI::Realtime::ResponseMcpCallArgumentsDone + puts("Final MCP call arguments: #{event.arguments}") + when OpenAI::Realtime::ResponseMcpCallInProgress + puts("Running MCP tool for item: #{event.item_id}") + when OpenAI::Realtime::ResponseMcpCallCompleted + puts("MCP tool call completed: #{event.item_id}") + when OpenAI::Realtime::ResponseMcpCallFailed + warn("MCP tool call failed: #{event.item_id}") + break + when OpenAI::Realtime::ResponseOutputItemDoneEvent + item = event.item + case item + when OpenAI::Realtime::RealtimeMcpToolCall + puts("MCP output from #{item.server_label}.#{item.name}: #{item.output}") + when OpenAI::Realtime::RealtimeConversationItemAssistantMessage + text = item.content.filter_map do |content| + content.text if content.type == :output_text + end.join + puts("Assistant: #{text}") + end + when OpenAI::Realtime::RealtimeErrorEvent + warn("Realtime API error: #{event.error.message}") + break + when OpenAI::Realtime::ResponseDoneEvent + puts("Realtime turn complete.") + break + end +end +``` + ## Common failures @@ -472,6 +598,17 @@ def approve_mcp_request(ws, approval_request_id): ws.send(json.dumps(event)) ``` +```ruby +approval_request_id = item.id + +connection.conversation.items.create( + type: :mcp_approval_response, + id: "mcp_approval_#{approval_request_id}", + approval_request_id: approval_request_id, + approve: true +) +``` + If you reject the request, set `approve` to `false` and optionally include a `reason`. @@ -545,6 +682,27 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.response.create( + output_modalities: [:text], + input: [{ + type: :message, + role: :user, + content: [{ + type: :input_text, + text: "Which Realtime API transport should browser clients use?" + }] + }], + tools: [{ + type: :mcp, + server_label: "openai_docs", + server_url: "https://developers.openai.com/mcp", + allowed_tools: ["search_openai_docs", "fetch_openai_doc"], + require_approval: :never + }] +) +``` + This is useful when only one response needs external context, or when different turns should use different MCP servers. @@ -619,6 +777,18 @@ event = { ws.send(json.dumps(event)) ``` +```ruby +connection.response.create( + output_modalities: [:text], + input: [{ + type: :message, + role: :user, + content: [{type: :input_text, text: "Check my schedule this afternoon."}] + }], + tools: [{type: :mcp, server_label: "google_calendar"}] +) +``` + This reuse is session-scoped. If you start a new Realtime session, send the full MCP definition again so the server can import its tool list. \ No newline at end of file diff --git a/docs/en/api/docs/guides/realtime-sip.md b/docs/en/api/docs/guides/realtime-sip.md index d9c8ab7..7ea369c 100644 --- a/docs/en/api/docs/guides/realtime-sip.md +++ b/docs/en/api/docs/guides/realtime-sip.md @@ -203,16 +203,16 @@ allow bidirectional SRTP traffic over UDP to and from the following CIDRs: - `40.67.149.176/28` - `40.83.204.240/28` -## Python example +## Server examples The following is an example of a `realtime.call.incoming` handler. It accepts the call and then logs all the events from the Realtime API. +For the Ruby example, set the `OPENAI_API_KEY` and `OPENAI_WEBHOOK_SECRET` +environment variables, then install the required dependencies with +`gem install openai webrick async-websocket`. - -Python - - Python +Handle an incoming SIP call ```python from flask import Flask, request, Response, jsonify, make_response @@ -286,6 +286,69 @@ if __name__ == "__main__": app.run(port=8000) ``` +```ruby +require "openai" +require "webrick" + +client = OpenAI::Client.new(webhook_secret: ENV.fetch("OPENAI_WEBHOOK_SECRET")) +server = WEBrick::HTTPServer.new( + BindAddress: "127.0.0.1", + Port: Integer(ENV.fetch("OPENAI_WEBHOOK_PORT", "8000")), + Logger: WEBrick::Log.new($stderr, WEBrick::BasicLog::WARN), + AccessLog: [] +) +sideband_workers = [] + +server.mount_proc("/webhook") do |request, response| + if request.request_method != "POST" + response.status = 405 + next + end + + headers = request.header.transform_values(&:first) + event = client.webhooks.unwrap(request.body, headers) + + if event.is_a?(OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent) + call_id = event.data.call_id + sideband_workers.select!(&:alive?) + sideband_workers << Thread.new(call_id) do |active_call_id| + client.realtime.calls.accept( + active_call_id, + type: :realtime, + model: "gpt-realtime-2.1", + instructions: "You are a helpful support agent." + ) + + client.realtime.connect_to_call(call_id: active_call_id) do |connection| + connection.response.create( + instructions: "Thank the caller and ask how you can help." + ) + connection.each do |server_event| + puts "Realtime event: #{server_event.type}" + end + end + end + end + + response.status = 200 + response.body = "ok" +rescue OpenAI::Errors::InvalidWebhookSignatureError, ArgumentError + response.status = 400 + response.body = "Invalid signature" +ensure + server.shutdown if ENV["OPENAI_WEBHOOK_EXIT_AFTER_REQUEST"] == "1" +end + +Signal.trap("INT") do + sideband_workers.each(&:kill) + server.shutdown +end +port = server.listeners.first.addr[1] +puts "Webhook server listening on http://127.0.0.1:#{port}/webhook" +$stdout.flush +server.start +sideband_workers.each(&:join) +``` ## Next steps diff --git a/docs/en/api/docs/guides/realtime-websocket.md b/docs/en/api/docs/guides/realtime-websocket.md index 99f102e..3ea87f2 100644 --- a/docs/en/api/docs/guides/realtime-websocket.md +++ b/docs/en/api/docs/guides/realtime-websocket.md @@ -90,6 +90,34 @@ ws.run_forever() +OpenAI SDK (Ruby) + + + + Install the required gems with + `gem install openai async-websocket`. + + + Connect with the OpenAI SDK (Ruby) + +```ruby +require "openai" + +client = OpenAI::Client.new( + default_headers: {"OpenAI-Safety-Identifier" => "hashed-user-id"} +) + +client.realtime.connect(model: "gpt-realtime-2.1") do |connection| + puts("Connected to the Realtime API: #{connection.url.host}") + connection.each { |event| puts("Received event: #{event.type}") } +end +``` + + + + + + WebSocket (browsers) Connect with standard WebSocket (browsers) diff --git a/docs/en/api/docs/guides/reasoning.md b/docs/en/api/docs/guides/reasoning.md index 6448100..8db6b6a 100644 --- a/docs/en/api/docs/guides/reasoning.md +++ b/docs/en/api/docs/guides/reasoning.md @@ -416,6 +416,57 @@ if (response.status().filter(ResponseStatus.INCOMPLETE::equals).isPresent() } ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + MaxOutputTokenCount = 300, + ReasoningOptions = new ResponseReasoningOptions + { + ReasoningEffortLevel = ResponseReasoningEffortLevel.Medium, + }, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Write a bash script that transposes a matrix.") +); + +ResponseResult response = await client.CreateResponseAsync(options); +if ( + response.Status == ResponseStatus.Incomplete + && response.IncompleteStatusDetails?.Reason == ResponseIncompleteStatusReason.MaxOutputTokens +) +{ + Console.WriteLine("The response ended before all output tokens were generated."); + string partialOutput = response.GetOutputText(); + Console.WriteLine( + string.IsNullOrWhiteSpace(partialOutput) + ? "Ran out of tokens during reasoning." + : $"Partial output: {partialOutput}" + ); +} +else if ( + response.Status == ResponseStatus.Incomplete + && response.IncompleteStatusDetails?.Reason == ResponseIncompleteStatusReason.ContentFilter +) +{ + Console.WriteLine("The response was interrupted by the content filter."); +} +else if (response.Status == ResponseStatus.Completed) +{ + Console.WriteLine(response.GetOutputText()); +} +else +{ + throw new InvalidOperationException($"The response ended with status: {response.Status}"); +} +``` + ```ruby require "openai" @@ -867,7 +918,7 @@ first = client.responses.create( input: history, reasoning: {context: :current_turn} ) -history.concat(first.output.map(&:to_h)) +history.concat(first.output) history << {role: :user, content: "Now patch the bug and explain the change."} second = client.responses.create( @@ -979,6 +1030,32 @@ client.responses().create(params).output().stream() .forEach(summary -> System.out.println(summary.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + ReasoningOptions = new ResponseReasoningOptions + { + ReasoningEffortLevel = ResponseReasoningEffortLevel.Low, + ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Auto, + }, +}; +options.InputItems.Add(ResponseItem.CreateUserMessageItem("What is the capital of France?")); + +ResponseResult response = await client.CreateResponseAsync(options); +foreach (ReasoningResponseItem reasoning in response.OutputItems.OfType()) +{ + Console.WriteLine(reasoning.GetSummaryText()); +} +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -1404,6 +1481,47 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +string prompt = + """ + Instructions: + - Given the React component below, make nonfiction book titles red. + - Return only the updated component code in your reply. + - Do not include any additional formatting, such as markdown code blocks. + - For formatting, use four space tabs, and do not allow any lines of code to + exceed 80 columns. + + const books = [ + { title: 'Dune', category: 'fiction', id: 1 }, + { title: 'Frankenstein', category: 'fiction', id: 2 }, + { title: 'Moneyball', category: 'nonfiction', id: 3 }, + ]; + + export default function BookList() { + const listItems = books.map(book => +
  • + {book.title} +
  • + ); + + return ( +
      {listItems}
    + ); + } + """; +ResponseResult response = await client.CreateResponseAsync( + "gpt-5.6", + [ResponseItem.CreateUserMessageItem(prompt)] +); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -1709,6 +1827,25 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +string prompt = + """ + What are three compounds we should investigate to advance research into + new antibiotics? Why should we consider them? + """; +ResponseResult response = await client.CreateResponseAsync( + "gpt-5.6", + [ResponseItem.CreateUserMessageItem(prompt)] +); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/safety-best-practices.md b/docs/en/api/docs/guides/safety-best-practices.md index 83dd784..e9ab1d4 100644 --- a/docs/en/api/docs/guides/safety-best-practices.md +++ b/docs/en/api/docs/guides/safety-best-practices.md @@ -62,6 +62,21 @@ requests with the `safety_identifier` parameter: Example: Providing a safety identifier +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const response = await client.chat.completions.create({ + model: "gpt-5.6", + messages: [{ role: "user", content: "This is a test" }], + max_completion_tokens: 5, + safety_identifier: "user_123456", +}); + +console.log(response.choices[0].message.content); +``` + ```python from openai import OpenAI diff --git a/docs/en/api/docs/guides/safety-checks.md b/docs/en/api/docs/guides/safety-checks.md index 64f301f..c87cd65 100644 --- a/docs/en/api/docs/guides/safety-checks.md +++ b/docs/en/api/docs/guides/safety-checks.md @@ -33,6 +33,20 @@ Responses API Providing a safety identifier with the Responses API +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const response = await client.responses.create({ + model: "gpt-5.6-terra", + input: "This is a test", + safety_identifier: "user_123456", +}); + +console.log(response.output_text); +``` + ```python from openai import OpenAI @@ -122,6 +136,20 @@ Chat Completions API Providing a safety identifier with the Chat Completions API +```javascript +import OpenAI from "openai"; + +const client = new OpenAI(); + +const response = await client.chat.completions.create({ + model: "gpt-5.6-terra", + messages: [{ role: "user", content: "This is a test" }], + safety_identifier: "user_123456", +}); + +console.log(response.choices[0].message.content); +``` + ```python from openai import OpenAI diff --git a/docs/en/api/docs/guides/speech-to-text.md b/docs/en/api/docs/guides/speech-to-text.md index 1da1871..6dd98c7 100644 --- a/docs/en/api/docs/guides/speech-to-text.md +++ b/docs/en/api/docs/guides/speech-to-text.md @@ -756,6 +756,33 @@ result word -> System.out.println(word.word() + ": " + word.start() + " - " + word.end())); ``` +```csharp +using OpenAI.Audio; + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string model = "whisper-1"; +AudioClient client = new(model, key); + +await using FileStream audio = File.OpenRead("speech.wav"); +AudioTranscriptionOptions options = new() +{ + ResponseFormat = AudioTranscriptionFormat.Verbose, + TimestampGranularities = AudioTimestampGranularities.Word, +}; +AudioTranscription transcription = await client.TranscribeAudioAsync( + audio, + "speech.wav", + options +); + +foreach (TranscribedWord word in transcription.Words) +{ + Console.WriteLine( + $"{word.Word}: {word.StartTime.TotalSeconds:0.00}s - {word.EndTime.TotalSeconds:0.00}s" + ); +} +``` + ```ruby require "openai" require "pathname" @@ -1066,6 +1093,28 @@ try (HttpResponse result = } ``` +```csharp +using OpenAI.Audio; + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string model = "whisper-1"; +AudioClient client = new(model, key); + +await using FileStream audio = File.OpenRead("speech.wav"); +AudioTranscriptionOptions options = new() +{ + ResponseFormat = AudioTranscriptionFormat.Text, + Prompt = "ZyntriQix, Digique Plus, CynapseFive, VortiQore V8, EchoNix Array, OrbitalLink Seven, DigiFractal Matrix, PULSE, RAPT, B.R.I.C.K., Q.U.A.R.T.Z., F.L.I.N.T.", +}; +AudioTranscription transcription = await client.TranscribeAudioAsync( + audio, + "speech.wav", + options +); + +Console.WriteLine(transcription.Text); +``` + ```ruby require "openai" require "pathname" @@ -1264,6 +1313,41 @@ completion.choices().stream() .forEach(System.out::println); ``` +```csharp +using OpenAI.Audio; +using OpenAI.Chat; + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string model = "gpt-4.1"; +ChatClient client = new(model, key); + +string transcriptionModel = "gpt-4o-transcribe"; +AudioClient audio = new(transcriptionModel, key); + +await using FileStream source = File.OpenRead("speech.wav"); +AudioTranscription transcription = await audio.TranscribeAudioAsync(source, "speech.wav"); + +string systemPrompt = + """ + You are a helpful assistant for the company ZyntriQix. Correct any + spelling discrepancies in the transcribed text. Make sure the names + of these products are spelled correctly: ZyntriQix, Digique Plus, + CynapseFive, VortiQore V8, EchoNix Array, OrbitalLink Seven, + DigiFractal Matrix, PULSE, RAPT, B.R.I.C.K., Q.U.A.R.T.Z., F.L.I.N.T. + Only add necessary punctuation such as periods, commas, and + capitalization, and use only the context provided. + """; +ChatCompletionOptions correctionOptions = new() { Temperature = 0 }; +ChatCompletion completion = await client.CompleteChatAsync( + [ + new SystemChatMessage(systemPrompt), + new UserChatMessage(transcription.Text), + ], + correctionOptions +); +Console.WriteLine(completion.Content[0].Text); +``` + ```ruby require "openai" require "pathname" diff --git a/docs/en/api/docs/guides/streaming-responses.md b/docs/en/api/docs/guides/streaming-responses.md index 7b44b96..1278971 100644 --- a/docs/en/api/docs/guides/streaming-responses.md +++ b/docs/en/api/docs/guides/streaming-responses.md @@ -141,6 +141,18 @@ The Responses API uses semantic events for streaming. Each event is typed with a For a full list of event types, see the [API reference for streaming](https://developers.openai.com/api/reference/resources/responses). Here are a few examples: +```javascript +for await (const event of stream) { + if (event.type === "response.output_text.delta") { + process.stdout.write(event.delta); + } else if (event.type === "response.completed") { + console.log("\nResponse completed."); + } else if (event.type === "error") { + console.error(event.message); + } +} +``` + ```python StreamingEvent = ( ResponseCreatedEvent diff --git a/docs/en/api/docs/guides/structured-outputs.md b/docs/en/api/docs/guides/structured-outputs.md index e11252c..3c8ab48 100644 --- a/docs/en/api/docs/guides/structured-outputs.md +++ b/docs/en/api/docs/guides/structured-outputs.md @@ -556,6 +556,58 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using System.Text.Json; +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "explanation": { "type": "string" }, + "output": { "type": "string" } + }, + "required": ["explanation", "output"], + "additionalProperties": false + } + }, + "final_answer": { "type": "string" } + }, + "required": ["steps", "final_answer"], + "additionalProperties": false + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "math_response", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("You are a helpful math tutor. Guide the user through the solution step by step.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("How can I solve 8x + 7 = -23?")); + +ResponseResult response = await client.CreateResponseAsync(options); +using JsonDocument parsed = JsonDocument.Parse(response.GetOutputText()); +Console.WriteLine(parsed.RootElement); +``` + ```ruby require "openai" @@ -895,6 +947,60 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using System.Text.Json; +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "title": { "type": "string" }, + "authors": { "type": "array", "items": { "type": "string" } }, + "abstract": { "type": "string" }, + "keywords": { "type": "array", "items": { "type": "string" } } + }, + "required": ["title", "authors", "abstract", "keywords"], + "additionalProperties": false + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "research_paper", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("Extract the title, authors, abstract, and keywords from the research paper.")); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + """ + Attention Is All You Need by Ashish Vaswani, Noam Shazeer, + Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, + Łukasz Kaiser, and Illia Polosukhin. We propose the + Transformer, a sequence transduction architecture based + entirely on attention. Keywords: transformers, attention, + sequence transduction. + """ + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +using JsonDocument parsed = JsonDocument.Parse(response.GetOutputText()); +Console.WriteLine(parsed.RootElement); +``` + ```ruby require "openai" @@ -1255,6 +1361,67 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using System.Text.Json; +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "ui": { "$ref": "#/$defs/component" } + }, + "required": ["ui"], + "additionalProperties": false, + "$defs": { + "component": { + "type": "object", + "properties": { + "type": { "type": "string", "enum": ["div", "button", "header", "section", "field", "form"] }, + "label": { "type": "string" }, + "children": { "type": "array", "items": { "$ref": "#/$defs/component" } }, + "attributes": { + "type": "array", + "items": { + "type": "object", + "properties": { "name": { "type": "string" }, "value": { "type": "string" } }, + "required": ["name", "value"], + "additionalProperties": false + } + } + }, + "required": ["type", "label", "children", "attributes"], + "additionalProperties": false + } + } + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "ui", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("You are a UI generator. Convert the user request into a component tree.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("Make a User Profile Form")); + +ResponseResult response = await client.CreateResponseAsync(options); +using JsonDocument parsed = JsonDocument.Parse(response.GetOutputText()); +Console.WriteLine(parsed.RootElement); +``` + ```ruby require "openai" @@ -1663,6 +1830,51 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using System.Text.Json; +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "is_violating": { "type": "boolean" }, + "category": { + "type": ["string", "null"], + "enum": ["violence", "sexual", "self_harm", null] + }, + "explanation_if_violating": { "type": ["string", "null"] } + }, + "required": ["is_violating", "category", "explanation_if_violating"], + "additionalProperties": false + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "content_compliance", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("Determine whether the user input violates content guidelines.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("How do I prepare for a job interview?")); + +ResponseResult response = await client.CreateResponseAsync(options); +using JsonDocument parsed = JsonDocument.Parse(response.GetOutputText()); +Console.WriteLine(parsed.RootElement); +``` + ```ruby require "openai" @@ -2035,6 +2247,58 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using System.Text.Json; +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "explanation": { "type": "string" }, + "output": { "type": "string" } + }, + "required": ["explanation", "output"], + "additionalProperties": false + } + }, + "final_answer": { "type": "string" } + }, + "required": ["steps", "final_answer"], + "additionalProperties": false + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "math_response", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("You are a helpful math tutor. Guide the user through the solution step by step.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("How can I solve 8x + 7 = -23?")); + +ResponseResult response = await client.CreateResponseAsync(options); +using JsonDocument parsed = JsonDocument.Parse(response.GetOutputText()); +Console.WriteLine(parsed.RootElement); +``` + ```ruby require "openai" @@ -2460,6 +2724,77 @@ if (content.refusal().isPresent()) { } ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "explanation": { "type": "string" }, + "output": { "type": "string" } + }, + "required": ["explanation", "output"], + "additionalProperties": false + } + }, + "final_answer": { "type": "string" } + }, + "required": ["steps", "final_answer"], + "additionalProperties": false + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + MaxOutputTokenCount = 300, + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "math_response", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("You are a helpful math tutor. Guide the user through the solution step by step.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("How can I solve 8x + 7 = -23?")); + +ResponseResult response = await client.CreateResponseAsync(options); +if ( + response.Status == ResponseStatus.Incomplete + && response.IncompleteStatusDetails?.Reason == ResponseIncompleteStatusReason.MaxOutputTokens +) +{ + throw new InvalidOperationException("The structured response was incomplete."); +} +if ( + response.Status == ResponseStatus.Incomplete + && response.IncompleteStatusDetails?.Reason == ResponseIncompleteStatusReason.ContentFilter +) +{ + throw new InvalidOperationException("The structured response was interrupted by the content filter."); +} +MessageResponseItem message = response.OutputItems.OfType().FirstOrDefault() + ?? throw new InvalidOperationException("The response did not include an output message."); +ResponseContentPart content = message.Content.FirstOrDefault() + ?? throw new InvalidOperationException("The response did not include output content."); +Console.WriteLine( + content.Kind == ResponseContentPartKind.Refusal ? content.Refusal : content.Text +); +``` + ```ruby require "openai" @@ -2767,6 +3102,64 @@ for (var output : response.output()) { } ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +BinaryData schema = BinaryData.FromString( + """ + { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "explanation": { "type": "string" }, + "output": { "type": "string" } + }, + "required": ["explanation", "output"], + "additionalProperties": false + } + }, + "final_answer": { "type": "string" } + }, + "required": ["steps", "final_answer"], + "additionalProperties": false + } + """ +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonSchemaFormat( + "math_response", + schema, + jsonSchemaIsStrict: true + ), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("You are a helpful math tutor. Guide the user through the solution step by step.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("How can I solve 8x + 7 = -23?")); + +ResponseResult response = await client.CreateResponseAsync(options); +foreach (MessageResponseItem message in response.OutputItems.OfType()) +{ + foreach (ResponseContentPart content in message.Content) + { + Console.WriteLine( + content.Kind == ResponseContentPartKind.Refusal ? content.Refusal : content.Text + ); + } +} +``` + ```ruby require "openai" @@ -3845,6 +4238,55 @@ try { } ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + TextOptions = new ResponseTextOptions + { + TextFormat = ResponseTextFormat.CreateJsonObjectFormat(), + }, +}; +options.InputItems.Add(ResponseItem.CreateSystemMessageItem("You are a helpful assistant designed to output JSON.")); +options.InputItems.Add(ResponseItem.CreateUserMessageItem("Who won the World Series in 2020? Respond with the winner in JSON.")); + +ResponseResult response = await client.CreateResponseAsync(options); +if ( + response.Status == ResponseStatus.Incomplete + && response.IncompleteStatusDetails?.Reason == ResponseIncompleteStatusReason.MaxOutputTokens +) +{ + Console.WriteLine("The response was truncated before the JSON completed."); +} +else if ( + response.Status == ResponseStatus.Incomplete + && response.IncompleteStatusDetails?.Reason == ResponseIncompleteStatusReason.ContentFilter +) +{ + Console.WriteLine("The response was interrupted by the content filter."); +} +else if (response.Status == ResponseStatus.Completed) +{ + MessageResponseItem message = response.OutputItems.OfType().FirstOrDefault() + ?? throw new InvalidOperationException("The response did not include an output message."); + ResponseContentPart content = message.Content.FirstOrDefault() + ?? throw new InvalidOperationException("The response did not include output content."); + Console.WriteLine( + content.Kind == ResponseContentPartKind.Refusal ? content.Refusal : content.Text + ); +} +else +{ + throw new InvalidOperationException($"The response ended with status: {response.Status}"); +} +``` + ```ruby require "json" require "openai" diff --git a/docs/en/api/docs/guides/tools-apply-patch.md b/docs/en/api/docs/guides/tools-apply-patch.md index ac3b15a..9a0fb0c 100644 --- a/docs/en/api/docs/guides/tools-apply-patch.md +++ b/docs/en/api/docs/guides/tools-apply-patch.md @@ -44,6 +44,18 @@ At a high level, using `apply_patch` with the Responses API looks like this: Ask the model to plan and emit patches +```javascript +const response = await client.responses.create({ + model: "gpt-5.6", + input: fileContext, + tools: [{ type: "apply_patch" }], +}); + +const patchCalls = response.output.filter( + (item) => item.type === "apply_patch_call" +); +``` + ```python from openai import OpenAI @@ -170,6 +182,29 @@ Example apply_patch_call object Apply the patch and return results +```javascript +/** @type {import("openai/resources/responses/responses").ResponseInput} */ +const results = patchCalls.map((call) => { + const { success, output } = applyOperation(call.operation); + + return { + type: "apply_patch_call_output", + call_id: call.call_id, + status: success ? "completed" : "failed", + output, + }; +}); + +const followup = await client.responses.create({ + model: "gpt-5.6", + previous_response_id: response.id, + input: results, + tools: [{ type: "apply_patch" }], +}); + +console.log(followup.output_text); +``` + ```python from apply_patch_harness import apply_operation # your implementation diff --git a/docs/en/api/docs/guides/tools-file-search.md b/docs/en/api/docs/guides/tools-file-search.md index da1dce6..03c9814 100644 --- a/docs/en/api/docs/guides/tools-file-search.md +++ b/docs/en/api/docs/guides/tools-file-search.md @@ -617,6 +617,26 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string vectorStoreId = ""; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add( + ResponseTool.CreateFileSearchTool([vectorStoreId], maxResultCount: 2) +); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("What is deep research by OpenAI?") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" @@ -730,6 +750,31 @@ client.responses().create(params).output().stream() .forEach(System.out::println); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string vectorStoreId = ""; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add(ResponseTool.CreateFileSearchTool([vectorStoreId])); +options.IncludedProperties.Add(IncludedResponseProperty.FileSearchCallResults); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("What is deep research by OpenAI?") +); + +ResponseResult response = await client.CreateResponseAsync(options); +foreach (FileSearchCallResponseItem search in response.OutputItems.OfType()) +{ + foreach (FileSearchCallResult result in search.Results) + { + Console.WriteLine($"{result.Filename}: {result.Text}"); + } +} +``` + ```ruby require "openai" @@ -874,6 +919,31 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +string vectorStoreId = ""; +ResponsesClient client = new(key); + +BinaryData filters = BinaryData.FromString( + """ + { "type": "in", "key": "category", "value": ["blog", "announcement"] } + """ +); +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add( + ResponseTool.CreateFileSearchTool([vectorStoreId], filters: filters) +); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("What is deep research by OpenAI?") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/docs/guides/tools-image-generation.md b/docs/en/api/docs/guides/tools-image-generation.md index 5803d06..7f896f9 100644 --- a/docs/en/api/docs/guides/tools-image-generation.md +++ b/docs/en/api/docs/guides/tools-image-generation.md @@ -134,6 +134,29 @@ String encoded = Files.write(Path.of("otter.png"), Base64.getDecoder().decode(encoded)); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); +options.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); + +ResponseResult response = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem image = response + .OutputItems.OfType() + .FirstOrDefault() + ?? throw new InvalidOperationException("No generated image was returned."); +await File.WriteAllBytesAsync("otter.png", image.ImageResultBytes.ToArray()); +``` + ```ruby require "base64" require "openai" @@ -417,6 +440,45 @@ Files.write( .orElseThrow(() -> new IllegalStateException("No follow-up image returned")))); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); + +ResponseResult first = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem initialImage = first + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync("cat_and_otter.png", initialImage.ImageResultBytes.ToArray()); + +CreateResponseOptions followUp = new() +{ + Model = "gpt-5.6", + PreviousResponseId = first.Id, +}; +followUp.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +followUp.InputItems.Add(ResponseItem.CreateUserMessageItem("Now make it look realistic.")); + +ResponseResult second = await client.CreateResponseAsync(followUp); +ImageGenerationCallResponseItem updatedImage = second + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync( + "cat_and_otter_realistic.png", + updatedImage.ImageResultBytes.ToArray() +); +``` + ```ruby require "base64" require "openai" @@ -716,6 +778,42 @@ Files.write( .orElseThrow(() -> new IllegalStateException("No follow-up image returned")))); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() { Model = "gpt-5.6" }; +options.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "Generate an image of a gray tabby cat hugging an otter with an orange scarf." + ) +); + +ResponseResult first = await client.CreateResponseAsync(options); +ImageGenerationCallResponseItem initialImage = first + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync("cat_and_otter.png", initialImage.ImageResultBytes.ToArray()); + +CreateResponseOptions followUp = new() { Model = "gpt-5.6" }; +followUp.Tools.Add(ResponseTool.CreateImageGenerationTool(model: "gpt-image-2")); +followUp.InputItems.Add(ResponseItem.CreateUserMessageItem("Now make it look realistic.")); +followUp.InputItems.Add(ResponseItem.CreateReferenceItem(initialImage.Id)); + +ResponseResult second = await client.CreateResponseAsync(followUp); +ImageGenerationCallResponseItem updatedImage = second + .OutputItems.OfType() + .First(); +await File.WriteAllBytesAsync( + "cat_and_otter_realistic.png", + updatedImage.ImageResultBytes.ToArray() +); +``` + ```ruby require "base64" require "openai" diff --git a/docs/en/api/docs/guides/webhooks.md b/docs/en/api/docs/guides/webhooks.md index 779241c..6057361 100644 --- a/docs/en/api/docs/guides/webhooks.md +++ b/docs/en/api/docs/guides/webhooks.md @@ -12,6 +12,10 @@ OpenAI [webhooks](http://chatgpt.com/?q=eli5+what+is+a+webhook?) allow you to re Below are examples of simple servers capable of ingesting webhooks from OpenAI, specifically for the [`response.completed`](https://developers.openai.com/api/reference/resources/webhooks) event. +For the Ruby examples, install the required dependencies with +`gem install openai webrick`, then set `OPENAI_API_KEY` and +`OPENAI_WEBHOOK_SECRET`. + Webhooks server ```javascript @@ -86,6 +90,57 @@ if __name__ == "__main__": app.run(port=8000) ``` +```ruby +require "openai" +require "webrick" + +client = OpenAI::Client.new( + webhook_secret: ENV.fetch("OPENAI_WEBHOOK_SECRET") +) + +server = WEBrick::HTTPServer.new( + BindAddress: "127.0.0.1", + Port: Integer(ENV.fetch("OPENAI_WEBHOOK_PORT", "8000")), + Logger: WEBrick::Log.new($stderr, WEBrick::BasicLog::WARN), + AccessLog: [] +) +response_workers = [] + +server.mount_proc("/webhook") do |request, response| + if request.request_method != "POST" + response.status = 405 + next + end + + headers = request.header.transform_values(&:first) + event = client.webhooks.unwrap(request.body, headers) + + if event.is_a?(OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent) + response_workers.select!(&:alive?) + response_workers << Thread.new(event.data.id) do |response_id| + completed_response = client.responses.retrieve(response_id) + puts "Response output: #{completed_response.output_text}" + end + end + + response.status = 200 + response.body = "ok" +rescue OpenAI::Errors::InvalidWebhookSignatureError, ArgumentError => error + warn "Invalid signature: #{error.message}" + response.status = 400 + response.body = "Invalid signature" +ensure + server.shutdown if ENV["OPENAI_WEBHOOK_EXIT_AFTER_REQUEST"] == "1" +end + +Signal.trap("INT") { server.shutdown } +port = server.listeners.first.addr[1] +puts "Webhook server listening on http://127.0.0.1:#{port}/webhook" +$stdout.flush +server.start +response_workers.each(&:join) +``` + To see a webhook like this one in action, you can set up a webhook endpoint in the OpenAI dashboard subscribed to `response.completed`, and then make an API request to [generate a response in background mode](https://developers.openai.com/api/docs/guides/background). @@ -176,6 +231,26 @@ var response = client.responses().create(params); System.out.println(response.status().orElseThrow()); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + BackgroundModeEnabled = true, +}; +options.InputItems.Add( + ResponseItem.CreateUserMessageItem("Write a very long novel about otters in space.") +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.Status); +``` + ```ruby require "openai" @@ -288,6 +363,47 @@ event = client.webhooks.unwrap( ) ``` +```ruby +require "openai" +require "webrick" + +client = OpenAI::Client.new( + api_key: ENV.fetch("OPENAI_API_KEY"), + webhook_secret: ENV.fetch("OPENAI_WEBHOOK_SECRET") +) +server = WEBrick::HTTPServer.new( + BindAddress: "127.0.0.1", + Port: Integer(ENV.fetch("OPENAI_WEBHOOK_PORT", "8000")), + Logger: WEBrick::Log.new($stderr, WEBrick::BasicLog::WARN), + AccessLog: [] +) + +server.mount_proc("/webhook") do |request, response| + if request.request_method != "POST" + response.status = 405 + next + end + + headers = request.header.transform_values(&:first) + event = client.webhooks.unwrap(request.body, headers) + puts "Verified webhook event: #{event.type}" + + response.status = 200 + response.body = "ok" +rescue OpenAI::Errors::InvalidWebhookSignatureError, ArgumentError + response.status = 400 + response.body = "Invalid signature" +ensure + server.shutdown if ENV["OPENAI_WEBHOOK_EXIT_AFTER_REQUEST"] == "1" +end + +Signal.trap("INT") { server.shutdown } +port = server.listeners.first.addr[1] +puts "Webhook server listening on http://127.0.0.1:#{port}/webhook" +$stdout.flush +server.start +``` + Signatures can also be verified with the [Standard Webhooks libraries](https://github.com/standard-webhooks/standard-webhooks/tree/main?tab=readme-ov-file#reference-implementations): diff --git a/docs/en/api/docs/guides/workload-identity-federation/oracle-cloud.md b/docs/en/api/docs/guides/workload-identity-federation/oracle-cloud.md index 87aa4b0..cc0ab1f 100644 --- a/docs/en/api/docs/guides/workload-identity-federation/oracle-cloud.md +++ b/docs/en/api/docs/guides/workload-identity-federation/oracle-cloud.md @@ -126,6 +126,12 @@ Install the OpenAI, OCI, and Requests Python packages: pip install openai oci requests ``` +For Ruby, install the OpenAI and OCI gems: + +```bash +gem install openai oci +``` + Set `OCI_IDENTITY_DOMAIN_URL` to the base URL of the identity domain in the same tenancy as the workload. Set `OPENAI_IDENTITY_PROVIDER_ID` and `OPENAI_SERVICE_ACCOUNT_ID` to the IDs from your OpenAI provider and service account mapping. The following example signs an Oracle token exchange request with the OCI instance principal, returns the IDCS access token to the OpenAI SDK, and lets the SDK exchange it for a short-lived OpenAI access token when needed: @@ -188,6 +194,114 @@ response = client.responses.create( print(response.output_text) ``` +```ruby +require "json" +require "net/http" +require "oci" +require "openai" +require "uri" + +class OracleInstancePrincipalTokenProvider + include OpenAI::Auth::SubjectTokenProvider + + def initialize(identity_domain_url:) + @identity_domain_url = identity_domain_url.sub(%r{/+\z}, "") + end + + def token_type + OpenAI::Auth::TokenType::JWT + end + + def get_token + uri = URI("#{@identity_domain_url}/oauth2/v1/token") + unless uri.is_a?(URI::HTTPS) + raise OpenAI::Errors::SubjectTokenProviderError.new( + message: "Oracle identity domain URL must use HTTPS", + provider: "oracle-instance-principal" + ) + end + + body = URI.encode_www_form( + grant_type: "urn:ietf:params:oauth:grant-type:token-exchange", + scope: "urn:opc:idm:__myscopes__", + requested_token_type: "urn:ietf:params:oauth:token-type:access_token" + ) + headers = { + "content-type": "application/x-www-form-urlencoded;charset=utf-8" + } + + signer = OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner.new + signer.sign(:post, uri.to_s, headers, body) + + request = Net::HTTP::Post.new(uri) + headers.each { |name, value| request[name.to_s] = value } + request.body = body + + response = Net::HTTP.start( + uri.hostname, + uri.port, + use_ssl: true, + open_timeout: 10, + read_timeout: 30 + ) do |http| + http.request(request) + end + + unless response.is_a?(Net::HTTPSuccess) + raise OpenAI::Errors::SubjectTokenProviderError.new( + message: "Oracle identity token request failed with status #{response.code}", + provider: "oracle-instance-principal" + ) + end + + token = JSON.parse(response.body).fetch("access_token") + unless token.is_a?(String) && !token.empty? + raise OpenAI::Errors::SubjectTokenProviderError.new( + message: "Oracle identity domain did not return an access token", + provider: "oracle-instance-principal" + ) + end + + token + rescue JSON::ParserError + raise OpenAI::Errors::SubjectTokenProviderError.new( + message: "Oracle identity token response was not valid JSON", + provider: "oracle-instance-principal" + ), cause: nil + rescue KeyError + raise OpenAI::Errors::SubjectTokenProviderError.new( + message: "Oracle identity domain did not return an access token", + provider: "oracle-instance-principal" + ), cause: nil + rescue SystemCallError, Timeout::Error => error + raise OpenAI::Errors::SubjectTokenProviderError.new( + message: "Failed to request Oracle identity token: #{error.message}", + provider: "oracle-instance-principal", + cause: error + ) + end +end + +provider = OracleInstancePrincipalTokenProvider.new( + identity_domain_url: ENV.fetch("OCI_IDENTITY_DOMAIN_URL") +) + +workload_identity = OpenAI::Auth::WorkloadIdentity.new( + identity_provider_id: ENV.fetch("OPENAI_IDENTITY_PROVIDER_ID"), + service_account_id: ENV.fetch("OPENAI_SERVICE_ACCOUNT_ID"), + provider: provider +) + +client = OpenAI::Client.new(workload_identity: workload_identity) + +response = client.responses.create( + model: "gpt-5.6-terra", + input: "Say hello from Oracle Cloud Infrastructure workload identity federation." +) + +puts(response.output_text) +``` + The subject token provider requests a fresh Oracle token when the OpenAI SDK needs to renew the workload identity credential. Never print or persist the Oracle subject token or the resulting OpenAI access token. diff --git a/docs/en/api/docs/guides/your-data.md b/docs/en/api/docs/guides/your-data.md index 68a9987..bb00066 100644 --- a/docs/en/api/docs/guides/your-data.md +++ b/docs/en/api/docs/guides/your-data.md @@ -205,6 +205,30 @@ response = client.with_options( print(response.output_text) ``` +```ruby +require "openai" + +client = OpenAI::Client.new + +response = client.responses.create( + model: "gpt-5.6-terra", + input: "Reply with OK." +) +puts(response.output_text) + +response = client.with_options(data_residency: :us).responses.create( + model: "gpt-5.6-terra", + input: "Reply with OK." +) +puts(response.output_text) + +response = client.with_options(data_residency: :eu).responses.create( + model: "gpt-5.6-terra", + input: "Reply with OK." +) +puts(response.output_text) +``` + ### Which models and features are eligible for data residency? diff --git a/docs/en/api/docs/libraries.md b/docs/en/api/docs/libraries.md index 0269a6d..c8956ab 100644 --- a/docs/en/api/docs/libraries.md +++ b/docs/en/api/docs/libraries.md @@ -173,7 +173,7 @@ OpenAI provides an API helper for the Java programming language, currently in be com.openai openai-java - 4.52.0 + 4.54.0 ``` diff --git a/docs/en/api/docs/llms.txt b/docs/en/api/docs/llms.txt index ff61264..3d55f13 100644 --- a/docs/en/api/docs/llms.txt +++ b/docs/en/api/docs/llms.txt @@ -17,12 +17,7 @@ Each entry has a Markdown twin at `/api/docs/.md`. - [Sending and returning files with GPT Actions](https://developers.openai.com/api/docs/actions/sending-files.md): Learn how to send and return files using GPT Actions in the OpenAI API. ## Assistants -- [Assistants API deep dive](https://developers.openai.com/api/docs/assistants/deep-dive.md): A detailed guide to creating and managing assistants with the Assistants API on the OpenAI platform. -- [Assistants API tools](https://developers.openai.com/api/docs/assistants/tools.md): Learn about the tools available for OpenAI Assistants, including file search, code interpreter, and function calling. -- [Assistants Code Interpreter](https://developers.openai.com/api/docs/assistants/tools/code-interpreter.md): Allow assistants to run Python code with the Code Interpreter tool. -- [Assistants File Search](https://developers.openai.com/api/docs/assistants/tools/file-search.md): Use File Search as a built-in RAG tool for assistants. -- [Assistants Function Calling](https://developers.openai.com/api/docs/assistants/tools/function-calling.md): Use function calling to extend assistants with your own tools. -- [Assistants migration guide](https://developers.openai.com/api/docs/assistants/migration.md): Guidance for migrating from the Assistants API to the Responses API, including side-by-side comparisons and updated patterns. +- [Assistants migration guide](https://developers.openai.com/api/docs/assistants/migration.md): Migrate from the retired Assistants API to the Responses API, with side-by-side comparisons and updated patterns. ## Bots - [Overview of OpenAI Crawlers](https://developers.openai.com/api/docs/bots.md) @@ -96,6 +91,7 @@ Each entry has a Markdown twin at `/api/docs/.md`. - [Guardrails and human review](https://developers.openai.com/api/docs/guides/agents/guardrails-approvals.md): Learn how to use guardrails and human review in the OpenAI Agents SDK for safer, more controlled workflows. - [Image generation](https://developers.openai.com/api/docs/guides/image-generation.md): Learn how to generate or edit images with the OpenAI API and image generation models. - [Image generation](https://developers.openai.com/api/docs/guides/tools-image-generation.md): Allow models to generate or edit images. +- [Image input token and cost calculator](https://developers.openai.com/api/docs/guides/image-cost-calculator.md): Estimate image input tokens and API costs for OpenAI vision models by model, image dimensions, and detail level. - [Images and vision](https://developers.openai.com/api/docs/guides/images-vision.md): Learn how to understand or generate images with the OpenAI API. - [Import and reconcile OpenAI resources](https://developers.openai.com/api/docs/guides/terraform/import-and-reconcile.md): Import existing OpenAI resources into Terraform, inspect current state, reconcile drift, and understand removal behavior. - [Integrations and observability](https://developers.openai.com/api/docs/guides/agents/integrations-observability.md): Learn how to integrate MCP into Agents SDK workflows and how to trace and debug runs. diff --git a/docs/en/api/docs/models.md b/docs/en/api/docs/models.md index 07c177e..843c89d 100644 --- a/docs/en/api/docs/models.md +++ b/docs/en/api/docs/models.md @@ -27,8 +27,8 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [codex-mini-latest](/api/docs/models/codex-mini-latest.md): Fast reasoning model optimized for the Codex CLI - [computer-use-preview](/api/docs/models/computer-use-preview.md): Specialized model for computer use tool - [davinci-002](/api/docs/models/davinci-002.md): Replacement for the GPT-3 curie and davinci base models -- [Daybreak Blue](/api/docs/models/daybreak-blue-latest.md): An alias for frontier general-purpose models with safeguards for defensive cybersecurity work. -- [Daybreak Red](/api/docs/models/daybreak-red-latest.md): An alias for advanced cybersecurity models for authorized vulnerability research and security testing. +- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): An alias for flagship general-purpose models with safeguards for defensive cybersecurity work. +- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): An alias for advanced cybersecurity models for authorized vulnerability research and security testing. - [GPT-3.5 Turbo](/api/docs/models/gpt-3.5-turbo.md): Legacy GPT model for cheaper chat and non-chat tasks - [GPT-4](/api/docs/models/gpt-4.md): An older high-intelligence GPT model - [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): An older high-intelligence GPT model @@ -51,7 +51,7 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Transcription model that identifies who's speaking when - [GPT-5](/api/docs/models/gpt-5.md): Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort - [GPT-5 Chat](/api/docs/models/gpt-5-chat-latest.md): GPT-5 model used in ChatGPT -- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Near-frontier intelligence for cost sensitive, low latency, high volume workloads +- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Strong intelligence for cost sensitive, low latency, high volume workloads - [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Fastest, most cost-efficient version of GPT-5 - [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Version of GPT-5 that produces smarter and more precise responses - [GPT-5-Codex](/api/docs/models/gpt-5-codex.md): A version of GPT-5 optimized for agentic coding in Codex @@ -60,7 +60,7 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [GPT-5.1-Codex](/api/docs/models/gpt-5.1-codex.md): A version of GPT-5.1 optimized for agentic coding in Codex. - [GPT-5.1-Codex Mini](/api/docs/models/gpt-5.1-codex-mini.md): Smaller, more cost-effective, less-capable version of GPT-5.1-Codex - [GPT-5.1-Codex-Max](/api/docs/models/gpt-5.1-codex-max.md): A version of GPT-5.1-codex optimized for long running tasks. -- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous frontier model for professional work with configurable reasoning effort +- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort - [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): GPT-5.2 model used in ChatGPT - [GPT-5.2 Pro](/api/docs/models/gpt-5.2-pro.md): Previous pro model for professional work that produces smarter and more precise responses. - [GPT-5.2-Codex](/api/docs/models/gpt-5.2-codex.md): Our most intelligent coding model optimized for long-horizon, agentic coding tasks. @@ -74,7 +74,7 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [GPT-5.5 Pro](/api/docs/models/gpt-5.5-pro.md): Version of GPT-5.5 that produces smarter and more precise responses. - [GPT-5.6 Cyber](/api/docs/models/gpt-5.6-cyber.md): Our most advanced cybersecurity model for authorized vulnerability research and security testing. - [GPT-5.6 Luna](/api/docs/models/gpt-5.6-luna.md): GPT-5.6 model optimized for cost-sensitive workloads -- [GPT-5.6 Sol](/api/docs/models/gpt-5.6-sol.md): Frontier model for complex professional work +- [GPT-5.6 Sol](/api/docs/models/gpt-5.6-sol.md): Flagship model for complex professional work - [GPT-5.6 Terra](/api/docs/models/gpt-5.6-terra.md): GPT-5.6 model that balances intelligence and cost - [GPT-Audio](/api/docs/models/gpt-audio.md): For audio inputs and outputs with Chat Completions API - [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): A cost-efficient version of GPT Audio diff --git a/docs/en/api/docs/models/all.md b/docs/en/api/docs/models/all.md index 07c177e..843c89d 100644 --- a/docs/en/api/docs/models/all.md +++ b/docs/en/api/docs/models/all.md @@ -27,8 +27,8 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [codex-mini-latest](/api/docs/models/codex-mini-latest.md): Fast reasoning model optimized for the Codex CLI - [computer-use-preview](/api/docs/models/computer-use-preview.md): Specialized model for computer use tool - [davinci-002](/api/docs/models/davinci-002.md): Replacement for the GPT-3 curie and davinci base models -- [Daybreak Blue](/api/docs/models/daybreak-blue-latest.md): An alias for frontier general-purpose models with safeguards for defensive cybersecurity work. -- [Daybreak Red](/api/docs/models/daybreak-red-latest.md): An alias for advanced cybersecurity models for authorized vulnerability research and security testing. +- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): An alias for flagship general-purpose models with safeguards for defensive cybersecurity work. +- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): An alias for advanced cybersecurity models for authorized vulnerability research and security testing. - [GPT-3.5 Turbo](/api/docs/models/gpt-3.5-turbo.md): Legacy GPT model for cheaper chat and non-chat tasks - [GPT-4](/api/docs/models/gpt-4.md): An older high-intelligence GPT model - [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): An older high-intelligence GPT model @@ -51,7 +51,7 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Transcription model that identifies who's speaking when - [GPT-5](/api/docs/models/gpt-5.md): Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort - [GPT-5 Chat](/api/docs/models/gpt-5-chat-latest.md): GPT-5 model used in ChatGPT -- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Near-frontier intelligence for cost sensitive, low latency, high volume workloads +- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Strong intelligence for cost sensitive, low latency, high volume workloads - [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Fastest, most cost-efficient version of GPT-5 - [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Version of GPT-5 that produces smarter and more precise responses - [GPT-5-Codex](/api/docs/models/gpt-5-codex.md): A version of GPT-5 optimized for agentic coding in Codex @@ -60,7 +60,7 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [GPT-5.1-Codex](/api/docs/models/gpt-5.1-codex.md): A version of GPT-5.1 optimized for agentic coding in Codex. - [GPT-5.1-Codex Mini](/api/docs/models/gpt-5.1-codex-mini.md): Smaller, more cost-effective, less-capable version of GPT-5.1-Codex - [GPT-5.1-Codex-Max](/api/docs/models/gpt-5.1-codex-max.md): A version of GPT-5.1-codex optimized for long running tasks. -- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous frontier model for professional work with configurable reasoning effort +- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort - [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): GPT-5.2 model used in ChatGPT - [GPT-5.2 Pro](/api/docs/models/gpt-5.2-pro.md): Previous pro model for professional work that produces smarter and more precise responses. - [GPT-5.2-Codex](/api/docs/models/gpt-5.2-codex.md): Our most intelligent coding model optimized for long-horizon, agentic coding tasks. @@ -74,7 +74,7 @@ See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [depre - [GPT-5.5 Pro](/api/docs/models/gpt-5.5-pro.md): Version of GPT-5.5 that produces smarter and more precise responses. - [GPT-5.6 Cyber](/api/docs/models/gpt-5.6-cyber.md): Our most advanced cybersecurity model for authorized vulnerability research and security testing. - [GPT-5.6 Luna](/api/docs/models/gpt-5.6-luna.md): GPT-5.6 model optimized for cost-sensitive workloads -- [GPT-5.6 Sol](/api/docs/models/gpt-5.6-sol.md): Frontier model for complex professional work +- [GPT-5.6 Sol](/api/docs/models/gpt-5.6-sol.md): Flagship model for complex professional work - [GPT-5.6 Terra](/api/docs/models/gpt-5.6-terra.md): GPT-5.6 model that balances intelligence and cost - [GPT-Audio](/api/docs/models/gpt-audio.md): For audio inputs and outputs with Chat Completions API - [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): A cost-efficient version of GPT Audio diff --git a/docs/en/api/docs/pricing.md b/docs/en/api/docs/pricing.md index 839342a..adaca45 100644 --- a/docs/en/api/docs/pricing.md +++ b/docs/en/api/docs/pricing.md @@ -208,11 +208,11 @@ Prices per 1M tokens. - `daybreak-blue-latest` and `daybreak-red-latest` are - aliases that currently point to `gpt-5.6-sol` and - `gpt-5.6-cyber`, respectively. As new frontier models are released - through the Daybreak program, these aliases will be updated to point to the - latest models, with pricing adjusted to match each underlying model. + `gpt-daybreak-blue-latest` and `gpt-daybreak-red-latest` + are aliases that currently point to `gpt-5.6-sol` and + `gpt-5.6-cyber`, respectively. As new models are released through + the Daybreak program, these aliases will be updated to point to the latest + models, with pricing adjusted to match each underlying model. @@ -228,6 +228,8 @@ Multimodal models +To estimate vision model input costs, use the [image input cost +calculator](https://developers.openai.com/api/docs/guides/image-cost-calculator). diff --git a/docs/en/api/docs/quickstart.md b/docs/en/api/docs/quickstart.md index 38b5d60..e063578 100644 --- a/docs/en/api/docs/quickstart.md +++ b/docs/en/api/docs/quickstart.md @@ -190,7 +190,7 @@ OpenAI provides an API helper for the Java programming language, currently in be com.openai openai-java - 4.52.0 + 4.54.0 ``` @@ -1460,6 +1460,32 @@ client.responses().create(params).output().stream() .forEach(text -> System.out.println(text.text())); ``` +```csharp +using OpenAI.Responses; +#pragma warning disable OPENAI001 + +string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!; +ResponsesClient client = new(key); + +CodeInterpreterToolContainer container = new( + CodeInterpreterToolContainerConfiguration.CreateAutomaticContainerConfiguration([]) +); +CreateResponseOptions options = new() +{ + Model = "gpt-5.6", + Instructions = "You are a personal math tutor. Write and run code to answer math questions.", +}; +options.Tools.Add(ResponseTool.CreateCodeInterpreterTool(container)); +options.InputItems.Add( + ResponseItem.CreateUserMessageItem( + "I need to solve the equation 3x + 11 = 14. Can you help me?" + ) +); + +ResponseResult response = await client.CreateResponseAsync(options); +Console.WriteLine(response.GetOutputText()); +``` + ```ruby require "openai" diff --git a/docs/en/api/reference/llms.txt b/docs/en/api/reference/llms.txt index b94d517..f8e9478 100644 --- a/docs/en/api/reference/llms.txt +++ b/docs/en/api/reference/llms.txt @@ -20,7 +20,6 @@ Each entry has a Markdown twin at `/api/reference/.md`. - [Realtime Beta Overview](https://developers.openai.com/api/reference/realtime-beta/overview.md) ## Resources -- [Assistants streaming events](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/streaming-events.md): OpenAI API streaming event reference. - [Audio](https://developers.openai.com/api/reference/resources/audio.md): OpenAI API endpoint reference. - [Audio Speech — Create](https://developers.openai.com/api/reference/resources/audio/subresources/speech/methods/create.md): OpenAI API endpoint method reference. - [Audio Transcriptions — Create](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create.md): OpenAI API endpoint method reference. @@ -36,12 +35,6 @@ Each entry has a Markdown twin at `/api/reference/.md`. - [Batches — Create](https://developers.openai.com/api/reference/resources/batches/methods/create.md): OpenAI API endpoint method reference. - [Batches — List](https://developers.openai.com/api/reference/resources/batches/methods/list.md): OpenAI API endpoint method reference. - [Batches — Retrieve](https://developers.openai.com/api/reference/resources/batches/methods/retrieve.md): OpenAI API endpoint method reference. -- [Beta Assistants](https://developers.openai.com/api/reference/resources/beta/subresources/assistants.md): OpenAI API endpoint reference. -- [Beta Assistants — Create](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/create.md): OpenAI API endpoint method reference. -- [Beta Assistants — Delete](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/delete.md): OpenAI API endpoint method reference. -- [Beta Assistants — List](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/list.md): OpenAI API endpoint method reference. -- [Beta Assistants — Retrieve](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/retrieve.md): OpenAI API endpoint method reference. -- [Beta Assistants — Update](https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/update.md): OpenAI API endpoint method reference. - [Beta Chatkit](https://developers.openai.com/api/reference/resources/beta/subresources/chatkit.md): OpenAI API endpoint reference. - [Beta Chatkit Sessions](https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/sessions.md): OpenAI API endpoint reference. - [Beta Chatkit Sessions — Cancel](https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/sessions/methods/cancel.md): OpenAI API endpoint method reference. @@ -53,27 +46,6 @@ Each entry has a Markdown twin at `/api/reference/.md`. - [Beta Chatkit Threads — Retrieve](https://developers.openai.com/api/reference/resources/beta/subresources/chatkit/subresources/threads/methods/retrieve.md): OpenAI API endpoint method reference. - [Beta Responses streaming events](https://developers.openai.com/api/reference/resources/beta/subresources/responses/streaming-events.md): OpenAI API streaming event reference. - [Beta Responses WebSocket events](https://developers.openai.com/api/reference/resources/beta/subresources/responses/websocket-events.md): OpenAI API streaming event reference. -- [Beta Threads](https://developers.openai.com/api/reference/resources/beta/subresources/threads.md): OpenAI API endpoint reference. -- [Beta Threads — Create](https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/create.md): OpenAI API endpoint method reference. -- [Beta Threads — Delete](https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/delete.md): OpenAI API endpoint method reference. -- [Beta Threads — Retrieve](https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/retrieve.md): OpenAI API endpoint method reference. -- [Beta Threads — Update](https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/update.md): OpenAI API endpoint method reference. -- [Beta Threads Messages](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages.md): OpenAI API endpoint reference. -- [Beta Threads Messages — Create](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md): OpenAI API endpoint method reference. -- [Beta Threads Messages — Delete](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md): OpenAI API endpoint method reference. -- [Beta Threads Messages — List](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md): OpenAI API endpoint method reference. -- [Beta Threads Messages — Retrieve](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md): OpenAI API endpoint method reference. -- [Beta Threads Messages — Update](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md): OpenAI API endpoint method reference. -- [Beta Threads Runs](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs.md): OpenAI API endpoint reference. -- [Beta Threads Runs — Cancel](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md): OpenAI API endpoint method reference. -- [Beta Threads Runs — Create](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md): OpenAI API endpoint method reference. -- [Beta Threads Runs — List](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md): OpenAI API endpoint method reference. -- [Beta Threads Runs — Retrieve](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md): OpenAI API endpoint method reference. -- [Beta Threads Runs — Submit Tool Outputs](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md): OpenAI API endpoint method reference. -- [Beta Threads Runs — Update](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md): OpenAI API endpoint method reference. -- [Beta Threads Runs Steps](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md): OpenAI API endpoint reference. -- [Beta Threads Runs Steps — List](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md): OpenAI API endpoint method reference. -- [Beta Threads Runs Steps — Retrieve](https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md): OpenAI API endpoint method reference. - [Chat](https://developers.openai.com/api/reference/resources/chat.md): OpenAI API endpoint reference. - [Chat Completions — Retrieve](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve.md): OpenAI API endpoint method reference. - [Chat Completions streaming events](https://developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events.md): OpenAI API streaming event reference. diff --git a/docs/en/api/reference/resources/beta/subresources/assistants.md b/docs/en/api/reference/resources/beta/subresources/assistants.md deleted file mode 100644 index 8820f5c..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants.md +++ /dev/null @@ -1,5690 +0,0 @@ -# Assistants - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create assistant - -**post** `/assistants` - -Create an assistant with a model and instructions. - -### Body Parameters - -- `model: string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `description: optional string or null` - - The description of the assistant. The maximum length is 512 characters. - -- `instructions: optional string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `name: optional string or null` - - The name of the assistant. The maximum length is 256 characters. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids, vector_stores }` - - - `vector_store_ids: optional array of string` - - The [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `vector_stores: optional array of object { chunking_strategy, file_ids, metadata }` - - A helper to create a [vector store](/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `chunking_strategy: optional object { type } or object { static, type }` - - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - - - `Auto object { type }` - - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - - `type: "auto"` - - Always `auto`. - - - `"auto"` - - - `Static object { static, type }` - - - `static: object { chunk_overlap_tokens, max_chunk_size_tokens }` - - - `chunk_overlap_tokens: number` - - 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`. - - - `max_chunk_size_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`. - - - `type: "static"` - - Always `static`. - - - `"static"` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Returns - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Example - -```http -curl https://api.openai.com/v1/assistants \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-4o", - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` - -### Code Interpreter - -```http -curl "https://api.openai.com/v1/assistants" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", - "name": "Math Tutor", - "tools": [{"type": "code_interpreter"}], - "model": "gpt-4o" - }' -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant", - "created_at": 1698984975, - "name": "Math Tutor", - "description": null, - "model": "gpt-4o", - "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` - -### Files - -```http -curl https://api.openai.com/v1/assistants \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", - "tools": [{"type": "file_search"}], - "tool_resources": {"file_search": {"vector_store_ids": ["vs_123"]}}, - "model": "gpt-4o" - }' -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant", - "created_at": 1699009403, - "name": "HR Helper", - "description": null, - "model": "gpt-4o", - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": ["vs_123"] - } - }, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` - -## Delete assistant - -**delete** `/assistants/{assistant_id}` - -Delete an assistant. - -### Path Parameters - -- `assistant_id: string` - -### Returns - -- `AssistantDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "assistant.deleted"` - - - `"assistant.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/assistants/$ASSISTANT_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "assistant.deleted" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/assistants/asst_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X DELETE -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant.deleted", - "deleted": true -} -``` - -## List assistants - -**get** `/assistants` - -Returns a list of assistants. - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of Assistant` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/assistants \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 - } - ], - "first_id": "asst_abc123", - "has_more": false, - "last_id": "asst_abc456", - "object": "list" -} -``` - -### Example - -```http -curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "asst_abc123", - "object": "assistant", - "created_at": 1698982736, - "name": "Coding Tutor", - "description": null, - "model": "gpt-4o", - "instructions": "You are a helpful assistant designed to make me better at coding!", - "tools": [], - "tool_resources": {}, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" - }, - { - "id": "asst_abc456", - "object": "assistant", - "created_at": 1698982718, - "name": "My Assistant", - "description": null, - "model": "gpt-4o", - "instructions": "You are a helpful assistant designed to make me better at coding!", - "tools": [], - "tool_resources": {}, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" - }, - { - "id": "asst_abc789", - "object": "assistant", - "created_at": 1698982643, - "name": null, - "description": null, - "model": "gpt-4o", - "instructions": null, - "tools": [], - "tool_resources": {}, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" - } - ], - "first_id": "asst_abc123", - "last_id": "asst_abc789", - "has_more": false -} -``` - -## Retrieve assistant - -**get** `/assistants/{assistant_id}` - -Retrieves an assistant. - -### Path Parameters - -- `assistant_id: string` - -### Returns - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Example - -```http -curl https://api.openai.com/v1/assistants/$ASSISTANT_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/assistants/asst_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant", - "created_at": 1699009709, - "name": "HR Helper", - "description": null, - "model": "gpt-4o", - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", - "tools": [ - { - "type": "file_search" - } - ], - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` - -## Modify assistant - -**post** `/assistants/{assistant_id}` - -Modifies an assistant. - -### Path Parameters - -- `assistant_id: string` - -### Body Parameters - -- `description: optional string or null` - - The description of the assistant. The maximum length is 512 characters. - -- `instructions: optional string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `model: optional string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `name: optional string or null` - - The name of the assistant. The maximum length is 256 characters. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - Overrides the list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - Overrides the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Returns - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Example - -```http -curl https://api.openai.com/v1/assistants/$ASSISTANT_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/assistants/asst_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", - "tools": [{"type": "file_search"}], - "model": "gpt-4o" - }' -``` - -#### Response - -```json -{ - "id": "asst_123", - "object": "assistant", - "created_at": 1699009709, - "name": "HR Helper", - "description": null, - "model": "gpt-4o", - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": [] - } - }, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` - -## Domain Types - -### Assistant - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Assistant Deleted - -- `AssistantDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "assistant.deleted"` - - - `"assistant.deleted"` - -### Assistant Stream Event - -- `AssistantStreamEvent = object { data, event, enabled } or object { data, event } or object { data, event } or 22 more` - - Represents an event emitted when streaming a Run. - - Each event in a server-sent events stream has an `event` and `data` property: - - ``` - event: thread.created - data: {"id": "thread_123", "object": "thread", ...} - ``` - - We emit events whenever a new object is created, transitions to a new state, or is being - streamed in parts (deltas). For example, we emit `thread.run.created` when a new run - is created, `thread.run.completed` when a run completes, and so on. When an Assistant chooses - to create a message during a run, we emit a `thread.message.created event`, a - `thread.message.in_progress` event, many `thread.message.delta` events, and finally a - `thread.message.completed` event. - - We may add additional events over time, so we recommend handling unknown events gracefully - in your code. See the [Assistants API quickstart](/docs/assistants/overview) to learn how to - integrate the Assistants API with streaming. - - - `ThreadCreated object { data, event, enabled }` - - Occurs when a new [thread](/docs/api-reference/threads/object) is created. - - - `data: Thread` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - - - `event: "thread.created"` - - - `"thread.created"` - - - `enabled: optional boolean` - - Whether to enable input audio transcription. - - - `ThreadRunCreated object { data, event }` - - Occurs when a new [run](/docs/api-reference/runs/object) is created. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - - - `event: "thread.run.created"` - - - `"thread.run.created"` - - - `ThreadRunQueued object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.queued"` - - - `"thread.run.queued"` - - - `ThreadRunInProgress object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to an `in_progress` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.in_progress"` - - - `"thread.run.in_progress"` - - - `ThreadRunRequiresAction object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to a `requires_action` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.requires_action"` - - - `"thread.run.requires_action"` - - - `ThreadRunCompleted object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) is completed. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.completed"` - - - `"thread.run.completed"` - - - `ThreadRunIncomplete object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) ends with status `incomplete`. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.incomplete"` - - - `"thread.run.incomplete"` - - - `ThreadRunFailed object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) fails. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.failed"` - - - `"thread.run.failed"` - - - `ThreadRunCancelling object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.cancelling"` - - - `"thread.run.cancelling"` - - - `ThreadRunCancelled object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) is cancelled. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.cancelled"` - - - `"thread.run.cancelled"` - - - `ThreadRunExpired object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) expires. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.expired"` - - - `"thread.run.expired"` - - - `ThreadRunStepCreated object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is created. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `event: "thread.run.step.created"` - - - `"thread.run.step.created"` - - - `ThreadRunStepInProgress object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.in_progress"` - - - `"thread.run.step.in_progress"` - - - `ThreadRunStepDelta object { data, event }` - - Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object) are being streamed. - - - `data: RunStepDeltaEvent` - - Represents a run step delta i.e. any changed fields on a run step during streaming. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `delta: object { step_details }` - - The delta containing the fields that have changed on the run step. - - - `step_details: optional RunStepDeltaMessageDelta or ToolCallDeltaObject` - - The details of the run step. - - - `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - - - `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `object: "thread.run.step.delta"` - - The object type, which is always `thread.run.step.delta`. - - - `"thread.run.step.delta"` - - - `event: "thread.run.step.delta"` - - - `"thread.run.step.delta"` - - - `ThreadRunStepCompleted object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is completed. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.completed"` - - - `"thread.run.step.completed"` - - - `ThreadRunStepFailed object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.failed"` - - - `"thread.run.step.failed"` - - - `ThreadRunStepCancelled object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is cancelled. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.cancelled"` - - - `"thread.run.step.cancelled"` - - - `ThreadRunStepExpired object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.expired"` - - - `"thread.run.step.expired"` - - - `ThreadMessageCreated object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) is created. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - - - `event: "thread.message.created"` - - - `"thread.message.created"` - - - `ThreadMessageInProgress object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) moves to an `in_progress` state. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `event: "thread.message.in_progress"` - - - `"thread.message.in_progress"` - - - `ThreadMessageDelta object { data, event }` - - Occurs when parts of a [Message](/docs/api-reference/messages/object) are being streamed. - - - `data: MessageDeltaEvent` - - Represents a message delta i.e. any changed fields on a message during streaming. - - - `id: string` - - The identifier of the message, which can be referenced in API endpoints. - - - `delta: MessageDelta` - - The delta containing the fields that have changed on the Message. - - - `content: optional array of ImageFileDeltaBlock or TextDeltaBlock or RefusalDeltaBlock or ImageURLDeltaBlock` - - The content of the message in array of text and/or images. - - - `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - - - `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - - - `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `role: optional "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `object: "thread.message.delta"` - - The object type, which is always `thread.message.delta`. - - - `"thread.message.delta"` - - - `event: "thread.message.delta"` - - - `"thread.message.delta"` - - - `ThreadMessageCompleted object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) is completed. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `event: "thread.message.completed"` - - - `"thread.message.completed"` - - - `ThreadMessageIncomplete object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) ends before it is completed. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `event: "thread.message.incomplete"` - - - `"thread.message.incomplete"` - - - `ErrorEvent object { data, event }` - - Occurs when an [error](/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. - - - `data: ErrorObject` - - - `code: string or null` - - - `message: string` - - - `param: string or null` - - - `type: string` - - - `event: "error"` - - - `"error"` - - - `DoneEvent object { data, event }` - - Occurs when a stream ends. - - - `data: "[DONE]"` - - - `"[DONE]"` - - - `event: "done"` - - - `"done"` - -### Code Interpreter Tool - -- `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - -### File Search Tool - -- `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - -### Function Tool - -- `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -### Message Stream Event - -- `MessageStreamEvent = object { data, event } or object { data, event } or object { data, event } or 2 more` - - Occurs when a [message](/docs/api-reference/messages/object) is created. - - - `ThreadMessageCreated object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) is created. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - - - `event: "thread.message.created"` - - - `"thread.message.created"` - - - `ThreadMessageInProgress object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) moves to an `in_progress` state. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `event: "thread.message.in_progress"` - - - `"thread.message.in_progress"` - - - `ThreadMessageDelta object { data, event }` - - Occurs when parts of a [Message](/docs/api-reference/messages/object) are being streamed. - - - `data: MessageDeltaEvent` - - Represents a message delta i.e. any changed fields on a message during streaming. - - - `id: string` - - The identifier of the message, which can be referenced in API endpoints. - - - `delta: MessageDelta` - - The delta containing the fields that have changed on the Message. - - - `content: optional array of ImageFileDeltaBlock or TextDeltaBlock or RefusalDeltaBlock or ImageURLDeltaBlock` - - The content of the message in array of text and/or images. - - - `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - - - `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - - - `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `role: optional "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `object: "thread.message.delta"` - - The object type, which is always `thread.message.delta`. - - - `"thread.message.delta"` - - - `event: "thread.message.delta"` - - - `"thread.message.delta"` - - - `ThreadMessageCompleted object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) is completed. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `event: "thread.message.completed"` - - - `"thread.message.completed"` - - - `ThreadMessageIncomplete object { data, event }` - - Occurs when a [message](/docs/api-reference/messages/object) ends before it is completed. - - - `data: Message` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `event: "thread.message.incomplete"` - - - `"thread.message.incomplete"` - -### Run Step Stream Event - -- `RunStepStreamEvent = object { data, event } or object { data, event } or object { data, event } or 4 more` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is created. - - - `ThreadRunStepCreated object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is created. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `event: "thread.run.step.created"` - - - `"thread.run.step.created"` - - - `ThreadRunStepInProgress object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.in_progress"` - - - `"thread.run.step.in_progress"` - - - `ThreadRunStepDelta object { data, event }` - - Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object) are being streamed. - - - `data: RunStepDeltaEvent` - - Represents a run step delta i.e. any changed fields on a run step during streaming. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `delta: object { step_details }` - - The delta containing the fields that have changed on the run step. - - - `step_details: optional RunStepDeltaMessageDelta or ToolCallDeltaObject` - - The details of the run step. - - - `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - - - `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `object: "thread.run.step.delta"` - - The object type, which is always `thread.run.step.delta`. - - - `"thread.run.step.delta"` - - - `event: "thread.run.step.delta"` - - - `"thread.run.step.delta"` - - - `ThreadRunStepCompleted object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is completed. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.completed"` - - - `"thread.run.step.completed"` - - - `ThreadRunStepFailed object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.failed"` - - - `"thread.run.step.failed"` - - - `ThreadRunStepCancelled object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) is cancelled. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.cancelled"` - - - `"thread.run.step.cancelled"` - - - `ThreadRunStepExpired object { data, event }` - - Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires. - - - `data: RunStep` - - Represents a step in execution of a run. - - - `event: "thread.run.step.expired"` - - - `"thread.run.step.expired"` - -### Run Stream Event - -- `RunStreamEvent = object { data, event } or object { data, event } or object { data, event } or 7 more` - - Occurs when a new [run](/docs/api-reference/runs/object) is created. - - - `ThreadRunCreated object { data, event }` - - Occurs when a new [run](/docs/api-reference/runs/object) is created. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - - - `event: "thread.run.created"` - - - `"thread.run.created"` - - - `ThreadRunQueued object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.queued"` - - - `"thread.run.queued"` - - - `ThreadRunInProgress object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to an `in_progress` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.in_progress"` - - - `"thread.run.in_progress"` - - - `ThreadRunRequiresAction object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to a `requires_action` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.requires_action"` - - - `"thread.run.requires_action"` - - - `ThreadRunCompleted object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) is completed. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.completed"` - - - `"thread.run.completed"` - - - `ThreadRunIncomplete object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) ends with status `incomplete`. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.incomplete"` - - - `"thread.run.incomplete"` - - - `ThreadRunFailed object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) fails. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.failed"` - - - `"thread.run.failed"` - - - `ThreadRunCancelling object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling` status. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.cancelling"` - - - `"thread.run.cancelling"` - - - `ThreadRunCancelled object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) is cancelled. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.cancelled"` - - - `"thread.run.cancelled"` - - - `ThreadRunExpired object { data, event }` - - Occurs when a [run](/docs/api-reference/runs/object) expires. - - - `data: Run` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `event: "thread.run.expired"` - - - `"thread.run.expired"` - -### Thread Stream Event - -- `ThreadStreamEvent object { data, event, enabled }` - - Occurs when a new [thread](/docs/api-reference/threads/object) is created. - - - `data: Thread` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - - - `event: "thread.created"` - - - `"thread.created"` - - - `enabled: optional boolean` - - Whether to enable input audio transcription. diff --git a/docs/en/api/reference/resources/beta/subresources/assistants/methods/create.md b/docs/en/api/reference/resources/beta/subresources/assistants/methods/create.md deleted file mode 100644 index da0f978..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants/methods/create.md +++ /dev/null @@ -1,734 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create assistant - -**post** `/assistants` - -Create an assistant with a model and instructions. - -### Body Parameters - -- `model: string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `description: optional string or null` - - The description of the assistant. The maximum length is 512 characters. - -- `instructions: optional string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `name: optional string or null` - - The name of the assistant. The maximum length is 256 characters. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids, vector_stores }` - - - `vector_store_ids: optional array of string` - - The [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `vector_stores: optional array of object { chunking_strategy, file_ids, metadata }` - - A helper to create a [vector store](/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `chunking_strategy: optional object { type } or object { static, type }` - - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - - - `Auto object { type }` - - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - - `type: "auto"` - - Always `auto`. - - - `"auto"` - - - `Static object { static, type }` - - - `static: object { chunk_overlap_tokens, max_chunk_size_tokens }` - - - `chunk_overlap_tokens: number` - - 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`. - - - `max_chunk_size_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`. - - - `type: "static"` - - Always `static`. - - - `"static"` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Returns - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Example - -```http -curl https://api.openai.com/v1/assistants \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-4o", - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` - -### Code Interpreter - -```http -curl "https://api.openai.com/v1/assistants" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", - "name": "Math Tutor", - "tools": [{"type": "code_interpreter"}], - "model": "gpt-4o" - }' -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant", - "created_at": 1698984975, - "name": "Math Tutor", - "description": null, - "model": "gpt-4o", - "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.", - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` - -### Files - -```http -curl https://api.openai.com/v1/assistants \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", - "tools": [{"type": "file_search"}], - "tool_resources": {"file_search": {"vector_store_ids": ["vs_123"]}}, - "model": "gpt-4o" - }' -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant", - "created_at": 1699009403, - "name": "HR Helper", - "description": null, - "model": "gpt-4o", - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": ["vs_123"] - } - }, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/assistants/methods/delete.md b/docs/en/api/reference/resources/beta/subresources/assistants/methods/delete.md deleted file mode 100644 index 84a7997..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants/methods/delete.md +++ /dev/null @@ -1,62 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Delete assistant - -**delete** `/assistants/{assistant_id}` - -Delete an assistant. - -### Path Parameters - -- `assistant_id: string` - -### Returns - -- `AssistantDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "assistant.deleted"` - - - `"assistant.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/assistants/$ASSISTANT_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "assistant.deleted" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/assistants/asst_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X DELETE -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant.deleted", - "deleted": true -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/assistants/methods/list.md b/docs/en/api/reference/resources/beta/subresources/assistants/methods/list.md deleted file mode 100644 index 12823da..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants/methods/list.md +++ /dev/null @@ -1,379 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## List assistants - -**get** `/assistants` - -Returns a list of assistants. - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of Assistant` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/assistants \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 - } - ], - "first_id": "asst_abc123", - "has_more": false, - "last_id": "asst_abc456", - "object": "list" -} -``` - -### Example - -```http -curl "https://api.openai.com/v1/assistants?order=desc&limit=20" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "asst_abc123", - "object": "assistant", - "created_at": 1698982736, - "name": "Coding Tutor", - "description": null, - "model": "gpt-4o", - "instructions": "You are a helpful assistant designed to make me better at coding!", - "tools": [], - "tool_resources": {}, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" - }, - { - "id": "asst_abc456", - "object": "assistant", - "created_at": 1698982718, - "name": "My Assistant", - "description": null, - "model": "gpt-4o", - "instructions": "You are a helpful assistant designed to make me better at coding!", - "tools": [], - "tool_resources": {}, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" - }, - { - "id": "asst_abc789", - "object": "assistant", - "created_at": 1698982643, - "name": null, - "description": null, - "model": "gpt-4o", - "instructions": null, - "tools": [], - "tool_resources": {}, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" - } - ], - "first_id": "asst_abc123", - "last_id": "asst_abc789", - "has_more": false -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/assistants/methods/retrieve.md b/docs/en/api/reference/resources/beta/subresources/assistants/methods/retrieve.md deleted file mode 100644 index 18fdfa8..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants/methods/retrieve.md +++ /dev/null @@ -1,312 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Retrieve assistant - -**get** `/assistants/{assistant_id}` - -Retrieves an assistant. - -### Path Parameters - -- `assistant_id: string` - -### Returns - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Example - -```http -curl https://api.openai.com/v1/assistants/$ASSISTANT_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/assistants/asst_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "asst_abc123", - "object": "assistant", - "created_at": 1699009709, - "name": "HR Helper", - "description": null, - "model": "gpt-4o", - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.", - "tools": [ - { - "type": "file_search" - } - ], - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/assistants/methods/update.md b/docs/en/api/reference/resources/beta/subresources/assistants/methods/update.md deleted file mode 100644 index 45a2a54..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants/methods/update.md +++ /dev/null @@ -1,647 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Modify assistant - -**post** `/assistants/{assistant_id}` - -Modifies an assistant. - -### Path Parameters - -- `assistant_id: string` - -### Body Parameters - -- `description: optional string or null` - - The description of the assistant. The maximum length is 512 characters. - -- `instructions: optional string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `model: optional string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `name: optional string or null` - - The name of the assistant. The maximum length is 256 characters. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - Overrides the list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - Overrides the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Returns - -- `Assistant object { id, created_at, description, 10 more }` - - Represents an `assistant` that can call the model and use tools. - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the assistant was created. - - - `description: string or null` - - The description of the assistant. The maximum length is 512 characters. - - - `instructions: string or null` - - The system instructions that the assistant uses. The maximum length is 256,000 characters. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them. - - - `name: string or null` - - The name of the assistant. The maximum length is 256 characters. - - - `object: "assistant"` - - The object type, which is always `assistant`. - - - `"assistant"` - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - - `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -### Example - -```http -curl https://api.openai.com/v1/assistants/$ASSISTANT_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - { - "type": "code_interpreter" - } - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/assistants/asst_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", - "tools": [{"type": "file_search"}], - "model": "gpt-4o" - }' -``` - -#### Response - -```json -{ - "id": "asst_123", - "object": "assistant", - "created_at": 1699009709, - "name": "HR Helper", - "description": null, - "model": "gpt-4o", - "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": [] - } - }, - "metadata": {}, - "top_p": 1.0, - "temperature": 1.0, - "response_format": "auto" -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/assistants/streaming-events.md b/docs/en/api/reference/resources/beta/subresources/assistants/streaming-events.md deleted file mode 100644 index 7781f22..0000000 --- a/docs/en/api/reference/resources/beta/subresources/assistants/streaming-events.md +++ /dev/null @@ -1,44146 +0,0 @@ -# Assistants streaming events - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -Stream the result of executing a Run or resuming a Run after submitting tool outputs. -You can stream events from the [Create Thread and Run](https://developers.openai.com/docs/api-reference/runs/createThreadAndRun), -[Create Run](https://developers.openai.com/docs/api-reference/runs/createRun), and [Submit Tool Outputs](https://developers.openai.com/docs/api-reference/runs/submitToolOutputs) -endpoints by passing `"stream": true`. The response will be a [Server-Sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) stream. -Our Node and Python SDKs provide helpful utilities to make streaming easy. Reference the -[Assistants API quickstart](https://developers.openai.com/docs/assistants/overview) to learn more. - -## event - -Occurs when a new [thread](https://developers.openai.com/docs/api-reference/threads/object) is created. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ThreadStreamEvent/oneOf/0", - "docstring": "Occurs when a new [thread](/docs/api-reference/threads/object) is created.", - "ident": "ThreadCreated", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - }, - { - "ident": "enabled" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) event", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) enabled" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadStreamEvent/oneOf/0/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a thread that contains [messages](/docs/api-reference/messages).", - "title": "Thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Thread", - "$ref": "(resource) beta.threads > (model) thread > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) thread", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) thread > (schema) > (property) id", - "(resource) beta.threads > (model) thread > (schema) > (property) created_at", - "(resource) beta.threads > (model) thread > (schema) > (property) metadata", - "(resource) beta.threads > (model) thread > (schema) > (property) object", - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadStreamEvent/oneOf/0/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ThreadStreamEvent/oneOf/0/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.created" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) event > (member) 0" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) enabled": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadStreamEvent/oneOf/0/properties/enabled", - "deprecated": false, - "key": "enabled", - "docstring": "Whether to enable input audio transcription.", - "type": { - "kind": "HttpTypeBoolean" - }, - "optional": true, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the thread was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ThreadObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) thread > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources", - "deprecated": false, - "key": "tool_resources", - "docstring": "A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.\n", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code_interpreter" - }, - { - "ident": "file_search" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) code_interpreter", - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) file_search" - ] - }, - "(resource) beta.threads > (model) thread > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ThreadObject", - "docstring": "Represents a thread that contains [messages](/docs/api-reference/messages).", - "ident": "Thread", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "created_at" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "tool_resources" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) thread > (schema) > (property) id", - "(resource) beta.threads > (model) thread > (schema) > (property) created_at", - "(resource) beta.threads > (model) thread > (schema) > (property) metadata", - "(resource) beta.threads > (model) thread > (schema) > (property) object", - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 0 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.created" - } - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread" - } - }, - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources/anyOf/0/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_ids" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) code_interpreter > (property) file_ids" - ] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources/anyOf/0/properties/file_search", - "deprecated": false, - "key": "file_search", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "vector_store_ids" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) file_search > (property) vector_store_ids" - ] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) code_interpreter > (property) file_ids": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources/anyOf/0/properties/code_interpreter/properties/file_ids", - "deprecated": false, - "key": "file_ids", - "docstring": "A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources/anyOf/0/properties/code_interpreter/properties/file_ids", - "elementType": { - "kind": "HttpTypeString" - } - }, - "default": [], - "optional": true, - "nullable": false, - "schemaType": "array", - "children": [] - }, - "(resource) beta.threads > (model) thread > (schema) > (property) tool_resources > (property) file_search > (property) vector_store_ids": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources/anyOf/0/properties/file_search/properties/vector_store_ids", - "deprecated": false, - "key": "vector_store_ids", - "docstring": "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.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/ThreadObject/properties/tool_resources/anyOf/0/properties/file_search/properties/vector_store_ids", - "elementType": { - "kind": "HttpTypeString" - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "children": [] - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a new [run](https://developers.openai.com/docs/api-reference/runs/object) is created. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/0", - "docstring": "Occurs when a new [run](/docs/api-reference/runs/object) is created.", - "ident": "ThreadRunCreated", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/0/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/0/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/0/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.created" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 1 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.created" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) moves to a `queued` status. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/1", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) moves to a `queued` status.", - "ident": "ThreadRunQueued", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/1/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/1/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/1/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.queued" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 2 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) moves to an `in_progress` status. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/2", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) moves to an `in_progress` status.", - "ident": "ThreadRunInProgress", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/2/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/2/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/2/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.in_progress" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 3 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) moves to a `requires_action` status. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/3", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) moves to a `requires_action` status.", - "ident": "ThreadRunRequiresAction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/3/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/3/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/3/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.requires_action" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 4 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) is completed. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/4", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) is completed.", - "ident": "ThreadRunCompleted", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/4/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/4/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/4/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 5 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) ends with status `incomplete`. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/5", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) ends with status `incomplete`.", - "ident": "ThreadRunIncomplete", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/5/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/5/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/5/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.incomplete" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 6 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) fails. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/6", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) fails.", - "ident": "ThreadRunFailed", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/6/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/6/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/6/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.failed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 7 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) moves to a `cancelling` status. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/7", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) moves to a `cancelling` status.", - "ident": "ThreadRunCancelling", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/7/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/7/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/7/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.cancelling" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 8 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) is cancelled. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/8", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) is cancelled.", - "ident": "ThreadRunCancelled", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/8/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/8/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/8/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.cancelled" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 9 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run](https://developers.openai.com/docs/api-reference/runs/object) expires. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/9", - "docstring": "Occurs when a [run](/docs/api-reference/runs/object) expires.", - "ident": "ThreadRunExpired", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/9/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "title": "A run on a thread", - "type": { - "kind": "HttpTypeReference", - "ident": "Run", - "$ref": "(resource) beta.threads.runs > (model) run > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs > (model) run", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/9/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStreamEvent/oneOf/9/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/expires_at", - "deprecated": false, - "key": "expires_at", - "docstring": "The Unix timestamp (in seconds) for when the run will expire.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/instructions", - "deprecated": false, - "key": "instructions", - "docstring": "The instructions that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_completion_tokens", - "deprecated": false, - "key": "max_completion_tokens", - "docstring": "The maximum number of completion tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/max_prompt_tokens", - "deprecated": false, - "key": "max_prompt_tokens", - "docstring": "The maximum number of prompt tokens specified to have been used over the course of the run.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 256 - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) model": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/model", - "deprecated": false, - "key": "model", - "docstring": "The model that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/parallel_tool_calls", - "deprecated": false, - "key": "parallel_tool_calls", - "docstring": "Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": true, - "optional": false, - "nullable": false, - "schemaType": "boolean", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action", - "deprecated": false, - "key": "required_action", - "docstring": "Details on the action required to continue the run. Will be `null` if no action is required.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "submit_tool_outputs" - }, - { - "ident": "type" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/response_format", - "deprecated": false, - "key": "response_format", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantResponseFormatOption", - "$ref": "(resource) beta.threads > (model) assistant_response_format_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_response_format_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/started_at", - "deprecated": false, - "key": "started_at", - "docstring": "The Unix timestamp (in seconds) for when the run was started.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "queued" - }, - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tool_choice", - "deprecated": false, - "key": "tool_choice", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceOption", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "union", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_option", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The list of tools that the [assistant](/docs/api-reference/assistants) used for this run.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - } - ] - } - }, - "default": [], - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/truncation_strategy", - "deprecated": false, - "key": "truncation_strategy", - "docstring": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "last_messages" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.).", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/temperature", - "deprecated": false, - "key": "temperature", - "docstring": "The sampling temperature used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/top_p", - "deprecated": false, - "key": "top_p", - "docstring": "The nucleus sampling value used for this run. If not set, defaults to 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": true, - "nullable": true, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunObject", - "docstring": "Represents an execution run on a [thread](/docs/api-reference/threads).", - "ident": "Run", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expires_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "instructions" - }, - { - "ident": "last_error" - }, - { - "ident": "max_completion_tokens" - }, - { - "ident": "max_prompt_tokens" - }, - { - "ident": "metadata" - }, - { - "ident": "model" - }, - { - "ident": "object" - }, - { - "ident": "parallel_tool_calls" - }, - { - "ident": "required_action" - }, - { - "ident": "response_format" - }, - { - "ident": "started_at" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - }, - { - "ident": "tool_choice" - }, - { - "ident": "tools" - }, - { - "ident": "truncation_strategy" - }, - { - "ident": "usage" - }, - { - "ident": "temperature" - }, - { - "ident": "top_p" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) assistant_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) completed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) created_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) expires_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) failed_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details", - "(resource) beta.threads.runs > (model) run > (schema) > (property) instructions", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_completion_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) max_prompt_tokens", - "(resource) beta.threads.runs > (model) run > (schema) > (property) metadata", - "(resource) beta.threads.runs > (model) run > (schema) > (property) model", - "(resource) beta.threads.runs > (model) run > (schema) > (property) object", - "(resource) beta.threads.runs > (model) run > (schema) > (property) parallel_tool_calls", - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action", - "(resource) beta.threads.runs > (model) run > (schema) > (property) response_format", - "(resource) beta.threads.runs > (model) run > (schema) > (property) started_at", - "(resource) beta.threads.runs > (model) run > (schema) > (property) status", - "(resource) beta.threads.runs > (model) run > (schema) > (property) thread_id", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tool_choice", - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy", - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage", - "(resource) beta.threads.runs > (model) run > (schema) > (property) temperature", - "(resource) beta.threads.runs > (model) run > (schema) > (property) top_p" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 10 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.expired" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/incomplete_details/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - }, - { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1", - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/last_error/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs", - "deprecated": false, - "key": "submit_tool_outputs", - "docstring": "Details on the tool outputs needed for this run to continue.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "deprecated": false, - "key": "type", - "docstring": "For now, this is always `submit_tool_outputs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "docstring": "`auto` is the default value\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "docstring": "Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.\n", - "ident": "AssistantResponseFormatOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiResponseFormatOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatText", - "$ref": "(resource) $shared > (model) response_format_text > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONObject", - "$ref": "(resource) $shared > (model) response_format_json_object > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ResponseFormatJSONSchema", - "$ref": "(resource) $shared > (model) response_format_json_schema > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 1", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 2", - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 3" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "queued" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "requires_action" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelling" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 5": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 6": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 7": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) status > (member) 8": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "docstring": "`none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user.\n", - "ident": "UnionMember0", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "docstring": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n", - "ident": "AssistantToolChoiceOption", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption", - "types": [ - { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsApiToolChoiceOption/oneOf/0", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "none" - }, - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "required" - } - ] - }, - { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoice", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice > (schema)" - } - ] - }, - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0", - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchTool", - "$ref": "(resource) beta.assistants > (model) file_search_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) tools > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionTool", - "$ref": "(resource) beta.assistants > (model) function_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFileSearch", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "file_search" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsFunction", - "ident": "FunctionTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function", - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/TruncationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0", - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) last_messages": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/TruncationObject/properties/last_messages", - "deprecated": false, - "key": "last_messages", - "docstring": "The number of most recent messages from the thread when constructing the context for the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1 - }, - "optional": true, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_completion_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_prompt_tokens" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) last_error > (property) code > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "invalid_prompt" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) submit_tool_outputs > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "A list of the relevant tool calls.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunObject/properties/required_action/properties/submit_tool_outputs/properties/tool_calls", - "elementType": { - "kind": "HttpTypeReference", - "ident": "RequiredActionFunctionToolCall", - "$ref": "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)" - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) required_action > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "submit_tool_outputs" - } - }, - "(resource) beta.threads > (model) assistant_response_format_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatText/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatText", - "docstring": "Default response format. Used to generate text responses.\n", - "ident": "ResponseFormatText", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_text > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_object`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonObject", - "docstring": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n", - "ident": "ResponseFormatJSONObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema", - "deprecated": false, - "key": "json_schema", - "docstring": "Structured Outputs configuration options, including a JSON Schema.\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "schema" - }, - { - "ident": "strict" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of response format being defined. Always `json_schema`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0" - ] - }, - "(resource) $shared > (model) response_format_json_schema > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema", - "docstring": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](/docs/guides/structured-outputs).\n", - "ident": "ResponseFormatJSONSchema", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "json_schema" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema", - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "none" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_option > (schema) > (variant) 0 > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "required" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the tool. If type is `function`, the function name must be set", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - }, - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "AssistantToolChoiceFunction", - "$ref": "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads > (model) assistant_tool_choice_function", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice", - "docstring": "Specifies a tool the model should use. Use to force the model to call a specific tool.", - "ident": "AssistantToolChoice", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type", - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) function" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "Overrides for the file search tool.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "max_num_results" - }, - { - "ident": "ranking_options" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/function", - "deprecated": false, - "key": "function", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionDefinition", - "$ref": "(resource) $shared > (model) function_definition > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) function_definition", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `function`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFunction/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs > (model) run > (schema) > (property) truncation_strategy > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "last_messages" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The function definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call the output is required for. For now, this is always `function`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunToolCallObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunToolCallObject", - "docstring": "Tool call objects", - "ident": "RequiredActionFunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type" - ] - }, - "(resource) $shared > (model) response_format_text > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) $shared > (model) response_format_json_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_object" - } - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\nunderscores and dashes, with a maximum length of 64.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the response format is for, used by the model to\ndetermine how to respond in the format.\n", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) schema": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "deprecated": false, - "key": "schema", - "docstring": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n", - "title": "JSON schema", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/schema", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "map", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) json_schema > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ResponseFormatJsonSchema/properties/json_schema/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) response_format_json_schema > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "json_schema" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice > (schema) > (property) type > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantsNamedToolChoice/properties/function", - "ident": "AssistantToolChoiceFunction", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads > (model) assistant_tool_choice_function > (schema) > (property) name" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) max_num_results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/max_num_results", - "deprecated": false, - "key": "max_num_results", - "docstring": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 1, - "maximum": 50 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearch/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.\n", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "score_threshold" - }, - { - "ident": "ranker" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker" - ] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) description": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/description", - "deprecated": false, - "key": "description", - "docstring": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) parameters": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/parameters", - "deprecated": false, - "key": "parameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionParameters", - "$ref": "(resource) $shared > (model) function_parameters > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) function_parameters", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema) > (property) strict": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FunctionObject/properties/strict", - "deprecated": false, - "key": "strict", - "docstring": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).", - "type": { - "kind": "HttpTypeBoolean" - }, - "default": false, - "optional": true, - "nullable": true, - "schemaType": "boolean", - "children": [] - }, - "(resource) $shared > (model) function_definition > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionObject", - "ident": "FunctionDefinition", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "name" - }, - { - "ident": "description" - }, - { - "ident": "parameters" - }, - { - "ident": "strict" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) function_definition > (schema) > (property) name", - "(resource) $shared > (model) function_definition > (schema) > (property) description", - "(resource) $shared > (model) function_definition > (schema) > (property) parameters", - "(resource) $shared > (model) function_definition > (schema) > (property) strict" - ] - }, - "(resource) beta.assistants > (model) function_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments that the model expects you to pass to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunToolCallObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs > (model) required_action_function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/FileSearchRankingOptions/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) $shared > (model) function_parameters > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/FunctionParameters", - "docstring": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list.", - "ident": "FunctionParameters", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/FunctionParameters", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeUnknown" - } - ] - }, - "children": [] - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.assistants > (model) file_search_tool > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) is created. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/0", - "docstring": "Occurs when a [run step](/docs/api-reference/run-steps/step-object) is created.", - "ident": "ThreadRunStepCreated", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/0/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a step in execution of a run.\n", - "title": "Run steps", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStep", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/0/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/0/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.created" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/expired_at", - "deprecated": false, - "key": "expired_at", - "docstring": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run step. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of run step, which can be either `message_creation` or `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - }, - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepObject", - "docstring": "Represents a step in execution of a run.\n", - "ident": "RunStep", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expired_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "last_error" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "step_details" - }, - { - "ident": "thread_id" - }, - { - "ident": "type" - }, - { - "ident": "usage" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 11 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.created" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error` or `rate_limit_exceeded`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "MessageCreationStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_creation" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallsStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "code_interpreter" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "file_search" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranking_options" - }, - { - "ident": "results" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search.", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranker" - }, - { - "ident": "score_threshold" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "deprecated": false, - "key": "results", - "docstring": "The results of the file search.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "file_name" - }, - { - "ident": "score" - }, - { - "ident": "content" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/0", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/1", - "ident": "CodeInterpreterImageOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_name", - "deprecated": false, - "key": "file_name", - "docstring": "The name of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/score", - "deprecated": false, - "key": "score", - "docstring": "The score of the result. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the result that was found. The content is only included if requested via the include query parameter.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text content of the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/1", - "docstring": "Occurs when a [run step](/docs/api-reference/run-steps/step-object) moves to an `in_progress` state.", - "ident": "ThreadRunStepInProgress", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/1/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a step in execution of a run.\n", - "title": "Run steps", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStep", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/1/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/1/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.in_progress" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/expired_at", - "deprecated": false, - "key": "expired_at", - "docstring": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run step. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of run step, which can be either `message_creation` or `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - }, - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepObject", - "docstring": "Represents a step in execution of a run.\n", - "ident": "RunStep", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expired_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "last_error" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "step_details" - }, - { - "ident": "thread_id" - }, - { - "ident": "type" - }, - { - "ident": "usage" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 12 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error` or `rate_limit_exceeded`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "MessageCreationStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_creation" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallsStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "code_interpreter" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "file_search" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranking_options" - }, - { - "ident": "results" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search.", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranker" - }, - { - "ident": "score_threshold" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "deprecated": false, - "key": "results", - "docstring": "The results of the file search.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "file_name" - }, - { - "ident": "score" - }, - { - "ident": "content" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/0", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/1", - "ident": "CodeInterpreterImageOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_name", - "deprecated": false, - "key": "file_name", - "docstring": "The name of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/score", - "deprecated": false, - "key": "score", - "docstring": "The score of the result. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the result that was found. The content is only included if requested via the include query parameter.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text content of the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when parts of a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) are being streamed. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/2", - "docstring": "Occurs when parts of a [run step](/docs/api-reference/run-steps/step-object) are being streamed.", - "ident": "ThreadRunStepDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/2/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a run step delta i.e. any changed fields on a run step during streaming.\n", - "title": "Run step delta object", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStepDeltaEvent", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step_delta_event", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta", - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) object" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/2/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/2/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.delta" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaObject/properties/delta", - "deprecated": false, - "key": "delta", - "docstring": "The delta containing the fields that have changed on the run step.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "step_details" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta > (property) step_details" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step.delta`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.delta" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaObject", - "docstring": "Represents a run step delta i.e. any changed fields on a run step during streaming.\n", - "ident": "RunStepDeltaEvent", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "delta" - }, - { - "ident": "object" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta", - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) object" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 13 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.delta" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaObject/properties/delta/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaObject/properties/delta/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "RunStepDeltaMessageDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallDeltaObject", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema)" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.delta" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStepDeltaMessageDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) message_creation" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_event > (schema) > (property) delta > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallDeltaObject", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "RunStepDeltaMessageDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "message_creation" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) message_creation" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallDeltaObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - }, - { - "ident": "tool_calls" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCallDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCallDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCallDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema)" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step_delta_message_delta > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCallDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCallDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) id" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_call_delta_object > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCallDelta", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCallDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "id" - }, - { - "ident": "code_interpreter" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCallDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_search" - }, - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "id" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) id" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCallDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "id" - }, - { - "ident": "function" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the tool call in the tool calls array.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeUnknown" - }, - "optional": false, - "nullable": false, - "schemaType": "unknown", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFileSearchObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the tool call in the tool calls array.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the tool call in the tool calls array.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterLogs", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterOutputImage", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema)" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call_delta > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call_delta > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterLogs", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) logs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call_delta > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterOutputImage", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) image" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogs", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "logs" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) logs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject", - "ident": "CodeInterpreterOutputImage", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "image" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) index", - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) image" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the output in the outputs array.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the output in the outputs array.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_logs > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_output_image > (schema) > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDeltaStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) is completed. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/3", - "docstring": "Occurs when a [run step](/docs/api-reference/run-steps/step-object) is completed.", - "ident": "ThreadRunStepCompleted", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/3/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a step in execution of a run.\n", - "title": "Run steps", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStep", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/3/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/3/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/expired_at", - "deprecated": false, - "key": "expired_at", - "docstring": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run step. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of run step, which can be either `message_creation` or `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - }, - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepObject", - "docstring": "Represents a step in execution of a run.\n", - "ident": "RunStep", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expired_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "last_error" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "step_details" - }, - { - "ident": "thread_id" - }, - { - "ident": "type" - }, - { - "ident": "usage" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 14 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error` or `rate_limit_exceeded`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "MessageCreationStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_creation" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallsStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "code_interpreter" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "file_search" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranking_options" - }, - { - "ident": "results" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search.", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranker" - }, - { - "ident": "score_threshold" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "deprecated": false, - "key": "results", - "docstring": "The results of the file search.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "file_name" - }, - { - "ident": "score" - }, - { - "ident": "content" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/0", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/1", - "ident": "CodeInterpreterImageOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_name", - "deprecated": false, - "key": "file_name", - "docstring": "The name of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/score", - "deprecated": false, - "key": "score", - "docstring": "The score of the result. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the result that was found. The content is only included if requested via the include query parameter.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text content of the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) fails. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/4", - "docstring": "Occurs when a [run step](/docs/api-reference/run-steps/step-object) fails.", - "ident": "ThreadRunStepFailed", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/4/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a step in execution of a run.\n", - "title": "Run steps", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStep", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/4/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/4/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.failed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/expired_at", - "deprecated": false, - "key": "expired_at", - "docstring": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run step. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of run step, which can be either `message_creation` or `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - }, - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepObject", - "docstring": "Represents a step in execution of a run.\n", - "ident": "RunStep", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expired_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "last_error" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "step_details" - }, - { - "ident": "thread_id" - }, - { - "ident": "type" - }, - { - "ident": "usage" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 15 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error` or `rate_limit_exceeded`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "MessageCreationStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_creation" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallsStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "code_interpreter" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "file_search" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranking_options" - }, - { - "ident": "results" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search.", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranker" - }, - { - "ident": "score_threshold" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "deprecated": false, - "key": "results", - "docstring": "The results of the file search.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "file_name" - }, - { - "ident": "score" - }, - { - "ident": "content" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/0", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/1", - "ident": "CodeInterpreterImageOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_name", - "deprecated": false, - "key": "file_name", - "docstring": "The name of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/score", - "deprecated": false, - "key": "score", - "docstring": "The score of the result. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the result that was found. The content is only included if requested via the include query parameter.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text content of the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) is cancelled. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/5", - "docstring": "Occurs when a [run step](/docs/api-reference/run-steps/step-object) is cancelled.", - "ident": "ThreadRunStepCancelled", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/5/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a step in execution of a run.\n", - "title": "Run steps", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStep", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/5/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/5/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.cancelled" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/expired_at", - "deprecated": false, - "key": "expired_at", - "docstring": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run step. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of run step, which can be either `message_creation` or `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - }, - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepObject", - "docstring": "Represents a step in execution of a run.\n", - "ident": "RunStep", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expired_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "last_error" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "step_details" - }, - { - "ident": "thread_id" - }, - { - "ident": "type" - }, - { - "ident": "usage" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 16 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error` or `rate_limit_exceeded`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "MessageCreationStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_creation" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallsStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "code_interpreter" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "file_search" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranking_options" - }, - { - "ident": "results" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search.", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranker" - }, - { - "ident": "score_threshold" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "deprecated": false, - "key": "results", - "docstring": "The results of the file search.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "file_name" - }, - { - "ident": "score" - }, - { - "ident": "content" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/0", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/1", - "ident": "CodeInterpreterImageOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_name", - "deprecated": false, - "key": "file_name", - "docstring": "The name of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/score", - "deprecated": false, - "key": "score", - "docstring": "The score of the result. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the result that was found. The content is only included if requested via the include query parameter.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text content of the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [run step](https://developers.openai.com/docs/api-reference/run-steps/step-object) expires. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/6", - "docstring": "Occurs when a [run step](/docs/api-reference/run-steps/step-object) expires.", - "ident": "ThreadRunStepExpired", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/6/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a step in execution of a run.\n", - "title": "Run steps", - "type": { - "kind": "HttpTypeReference", - "ident": "RunStep", - "$ref": "(resource) beta.threads.runs.steps > (model) run_step > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.runs.steps > (model) run_step", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/6/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepStreamEvent/oneOf/6/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the run step, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "The ID of the [assistant](/docs/api-reference/assistants) associated with the run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/cancelled_at", - "deprecated": false, - "key": "cancelled_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was cancelled.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the run step was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/expired_at", - "deprecated": false, - "key": "expired_at", - "docstring": "The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/failed_at", - "deprecated": false, - "key": "failed_at", - "docstring": "The Unix timestamp (in seconds) for when the run step failed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error", - "deprecated": false, - "key": "last_error", - "docstring": "The last error associated with this run step. Will be `null` if there are no errors.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.run.step`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) that this run step is a part of.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "failed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - }, - { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "deprecated": false, - "key": "step_details", - "docstring": "The details of the run step.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/step_details", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "union", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The ID of the [thread](/docs/api-reference/threads) that was run.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of run step, which can be either `message_creation` or `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - }, - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/usage", - "deprecated": false, - "key": "usage", - "docstring": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "completion_tokens" - }, - { - "ident": "prompt_tokens" - }, - { - "ident": "total_tokens" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepObject", - "docstring": "Represents a step in execution of a run.\n", - "ident": "RunStep", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "cancelled_at" - }, - { - "ident": "completed_at" - }, - { - "ident": "created_at" - }, - { - "ident": "expired_at" - }, - { - "ident": "failed_at" - }, - { - "ident": "last_error" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "step_details" - }, - { - "ident": "thread_id" - }, - { - "ident": "type" - }, - { - "ident": "usage" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) assistant_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) cancelled_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) completed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) created_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) expired_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) failed_at", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) metadata", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) run_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) thread_id", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 17 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step.expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "deprecated": false, - "key": "code", - "docstring": "One of `server_error` or `rate_limit_exceeded`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/code", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "server_error" - }, - { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0", - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepObject/properties/last_error/anyOf/0/properties/message", - "deprecated": false, - "key": "message", - "docstring": "A human-readable description of the error.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.run.step" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "cancelled" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "failed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) status > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "expired" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageCreationStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) step_details > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ToolCallsStepDetails", - "$ref": "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject", - "docstring": "Details of the message creation by the run step.", - "ident": "MessageCreationStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_creation" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation", - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject", - "docstring": "Details of the tool call.", - "ident": "ToolCallsStepDetails", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "tool_calls" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) type > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) completion_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/completion_tokens", - "deprecated": false, - "key": "completion_tokens", - "docstring": "Number of completion tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) prompt_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/prompt_tokens", - "deprecated": false, - "key": "prompt_tokens", - "docstring": "Number of prompt tokens used over the course of the run step.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) usage > (property) total_tokens": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepCompletionUsage/anyOf/0/properties/total_tokens", - "deprecated": false, - "key": "total_tokens", - "docstring": "Total number of tokens used (prompt + completion).", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "server_error" - } - }, - "(resource) beta.threads.runs.steps > (model) run_step > (schema) > (property) last_error > (property) code > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "rate_limit_exceeded" - } - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation", - "deprecated": false, - "key": "message_creation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "message_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `message_creation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "deprecated": false, - "key": "tool_calls", - "docstring": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.\n", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/tool_calls/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1", - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `tool_calls`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) message_creation > (property) message_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsMessageCreationObject/properties/message_creation/properties/message_id", - "deprecated": false, - "key": "message_id", - "docstring": "The ID of the message that was created by this run step.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) message_creation_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "message_creation" - } - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileSearchToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) tool_calls > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FunctionToolCall", - "$ref": "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject", - "docstring": "Details of the Code Interpreter tool call the run step was involved in.", - "ident": "CodeInterpreterToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "code_interpreter" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject", - "ident": "FileSearchToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "file_search" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject", - "ident": "FunctionToolCall", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "function" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) tool_calls_step_details > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "tool_calls" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter", - "deprecated": false, - "key": "code_interpreter", - "docstring": "The Code Interpreter tool call definition.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "input" - }, - { - "ident": "outputs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search", - "deprecated": false, - "key": "file_search", - "docstring": "For now, this is always going to be an empty object.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranking_options" - }, - { - "ident": "results" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The ID of the tool call object.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function", - "deprecated": false, - "key": "function", - "docstring": "The definition of the function that was called.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "arguments" - }, - { - "ident": "name" - }, - { - "ident": "output" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name", - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output" - ] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool call. This is always going to be `function` for this type of tool call.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "function" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) input": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/input", - "deprecated": false, - "key": "input", - "docstring": "The input to the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "deprecated": false, - "key": "outputs", - "docstring": "The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items", - "types": [ - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/ranking_options", - "deprecated": false, - "key": "ranking_options", - "docstring": "The ranking options for the file search.", - "title": "File search tool call ranking options", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "ranker" - }, - { - "ident": "score_threshold" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "deprecated": false, - "key": "results", - "docstring": "The results of the file search.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchObject/properties/file_search/properties/results", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "file_name" - }, - { - "ident": "score" - }, - { - "ident": "content" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) arguments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/arguments", - "deprecated": false, - "key": "arguments", - "docstring": "The arguments passed to the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/name", - "deprecated": false, - "key": "name", - "docstring": "The name of the function.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) function > (property) output": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFunctionObject/properties/function/properties/output", - "deprecated": false, - "key": "output", - "docstring": "The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) function_tool_call > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "function" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/0", - "docstring": "Text output from the Code Interpreter tool call as part of a run step.", - "ident": "CodeInterpreterLogOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "logs" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeObject/properties/code_interpreter/properties/outputs/items/oneOf/1", - "ident": "CodeInterpreterImageOutput", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image", - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "deprecated": false, - "key": "ranker", - "docstring": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/ranker", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) score_threshold": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchRankingOptionsObject/properties/score_threshold", - "deprecated": false, - "key": "score_threshold", - "docstring": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) file_name": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/file_name", - "deprecated": false, - "key": "file_name", - "docstring": "The name of the file that result was found in.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) score": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/score", - "deprecated": false, - "key": "score", - "docstring": "The score of the result. All values must be a floating point number between 0 and 1.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0, - "maximum": 1 - }, - "optional": false, - "nullable": false, - "schemaType": "number", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the result that was found. The content is only included if requested via the include query parameter.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text", - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) logs": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/logs", - "deprecated": false, - "key": "logs", - "docstring": "The text output from the Code Interpreter tool call.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `logs`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputLogsObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image", - "deprecated": false, - "key": "image", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) ranking_options > (property) ranker > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "default_2024_08_21" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text content of the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsFileSearchResultObject/properties/content/items/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 0 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "logs" - } - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) image > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/RunStepDetailsToolCallsCodeOutputImageObject/properties/image/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [file](/docs/api-reference/files) ID of the image.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.runs.steps > (model) code_interpreter_tool_call > (schema) > (property) code_interpreter > (property) outputs > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image" - } - }, - "(resource) beta.threads.runs.steps > (model) file_search_tool_call > (schema) > (property) file_search > (property) results > (items) > (property) content > (items) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [message](https://developers.openai.com/docs/api-reference/messages/object) is created. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/0", - "docstring": "Occurs when a [message](/docs/api-reference/messages/object) is created.", - "ident": "ThreadMessageCreated", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/0/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "title": "The message object", - "type": { - "kind": "HttpTypeReference", - "ident": "Message", - "$ref": "(resource) beta.threads.messages > (model) message > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) message", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/0/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/0/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message.created" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "deprecated": false, - "key": "attachments", - "docstring": "A list of files attached to the message, and the tools they were added to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "tools" - } - ] - } - }, - "optional": false, - "nullable": true, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the message was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the message in array of text and/or images.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/content/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the message was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_at", - "deprecated": false, - "key": "incomplete_at", - "docstring": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "On an incomplete message, details about why the message is incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.message`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "deprecated": false, - "key": "role", - "docstring": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "user" - }, - { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "ident": "Message", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "attachments" - }, - { - "ident": "completed_at" - }, - { - "ident": "content" - }, - { - "ident": "created_at" - }, - { - "ident": "incomplete_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "role" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 18 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message.created" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file to attach to the message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The tools to add this file to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject", - "docstring": "References an image [File](/docs/api-reference/files) in the content of a message.", - "ident": "ImageFileContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_file" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject", - "docstring": "References an image URL in the content of a message.", - "ident": "ImageURLContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_url" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject", - "docstring": "The text content that is part of a message.", - "ident": "TextContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentRefusalObject", - "docstring": "The refusal content generated by the assistant.", - "ident": "RefusalContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "refusal" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason the message is incomplete.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4" - ] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "user" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items/oneOf/1", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "deprecated": false, - "key": "image_file", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFile", - "$ref": "(resource) beta.threads.messages > (model) image_file > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_file", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image_file`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "deprecated": false, - "key": "image_url", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURL", - "$ref": "(resource) beta.threads.messages > (model) image_url > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_url", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content part.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "deprecated": false, - "key": "text", - "type": { - "kind": "HttpTypeReference", - "ident": "Text", - "$ref": "(resource) beta.threads.messages > (model) text > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) text", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/refusal", - "deprecated": false, - "key": "refusal", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `refusal`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose=\"vision\"` when uploading the File if you need to later display the file content.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "ident": "ImageFile", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/url", - "deprecated": false, - "key": "url", - "docstring": "The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.", - "type": { - "kind": "HttpTypeString" - }, - "constraints": { - "format": "uri" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_url > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "ident": "ImageURL", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "url" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "deprecated": false, - "key": "annotations", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) value": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/value", - "deprecated": false, - "key": "value", - "docstring": "The data that makes up the text.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "ident": "Text", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "annotations" - }, - { - "ident": "value" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject", - "docstring": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", - "ident": "FileCitationAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_citation" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject", - "docstring": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", - "ident": "FilePathAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_path" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation", - "deprecated": false, - "key": "file_citation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_citation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path", - "deprecated": false, - "key": "file_path", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_path`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the specific File the citation is from.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that was generated.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [message](https://developers.openai.com/docs/api-reference/messages/object) moves to an `in_progress` state. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/1", - "docstring": "Occurs when a [message](/docs/api-reference/messages/object) moves to an `in_progress` state.", - "ident": "ThreadMessageInProgress", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/1/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "title": "The message object", - "type": { - "kind": "HttpTypeReference", - "ident": "Message", - "$ref": "(resource) beta.threads.messages > (model) message > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) message", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/1/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/1/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message.in_progress" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "deprecated": false, - "key": "attachments", - "docstring": "A list of files attached to the message, and the tools they were added to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "tools" - } - ] - } - }, - "optional": false, - "nullable": true, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the message was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the message in array of text and/or images.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/content/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the message was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_at", - "deprecated": false, - "key": "incomplete_at", - "docstring": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "On an incomplete message, details about why the message is incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.message`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "deprecated": false, - "key": "role", - "docstring": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "user" - }, - { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "ident": "Message", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "attachments" - }, - { - "ident": "completed_at" - }, - { - "ident": "content" - }, - { - "ident": "created_at" - }, - { - "ident": "incomplete_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "role" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 19 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message.in_progress" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file to attach to the message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The tools to add this file to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject", - "docstring": "References an image [File](/docs/api-reference/files) in the content of a message.", - "ident": "ImageFileContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_file" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject", - "docstring": "References an image URL in the content of a message.", - "ident": "ImageURLContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_url" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject", - "docstring": "The text content that is part of a message.", - "ident": "TextContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentRefusalObject", - "docstring": "The refusal content generated by the assistant.", - "ident": "RefusalContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "refusal" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason the message is incomplete.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4" - ] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "user" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items/oneOf/1", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "deprecated": false, - "key": "image_file", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFile", - "$ref": "(resource) beta.threads.messages > (model) image_file > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_file", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image_file`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "deprecated": false, - "key": "image_url", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURL", - "$ref": "(resource) beta.threads.messages > (model) image_url > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_url", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content part.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "deprecated": false, - "key": "text", - "type": { - "kind": "HttpTypeReference", - "ident": "Text", - "$ref": "(resource) beta.threads.messages > (model) text > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) text", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/refusal", - "deprecated": false, - "key": "refusal", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `refusal`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose=\"vision\"` when uploading the File if you need to later display the file content.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "ident": "ImageFile", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/url", - "deprecated": false, - "key": "url", - "docstring": "The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.", - "type": { - "kind": "HttpTypeString" - }, - "constraints": { - "format": "uri" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_url > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "ident": "ImageURL", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "url" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "deprecated": false, - "key": "annotations", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) value": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/value", - "deprecated": false, - "key": "value", - "docstring": "The data that makes up the text.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "ident": "Text", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "annotations" - }, - { - "ident": "value" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject", - "docstring": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", - "ident": "FileCitationAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_citation" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject", - "docstring": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", - "ident": "FilePathAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_path" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation", - "deprecated": false, - "key": "file_citation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_citation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path", - "deprecated": false, - "key": "file_path", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_path`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the specific File the citation is from.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that was generated.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when parts of a [Message](https://developers.openai.com/docs/api-reference/messages/object) are being streamed. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/2", - "docstring": "Occurs when parts of a [Message](/docs/api-reference/messages/object) are being streamed.", - "ident": "ThreadMessageDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/2/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a message delta i.e. any changed fields on a message during streaming.\n", - "title": "Message delta object", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageDeltaEvent", - "$ref": "(resource) beta.threads.messages > (model) message_delta_event > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) message_delta_event", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) delta", - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) object" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/2/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/2/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message.delta" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier of the message, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) delta": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta", - "deprecated": false, - "key": "delta", - "docstring": "The delta containing the fields that have changed on the Message.", - "type": { - "kind": "HttpTypeReference", - "ident": "MessageDelta", - "$ref": "(resource) beta.threads.messages > (model) message_delta > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) message_delta", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role" - ] - }, - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.message.delta`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message.delta" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message_delta_event > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaObject", - "docstring": "Represents a message delta i.e. any changed fields on a message during streaming.\n", - "ident": "MessageDeltaEvent", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "delta" - }, - { - "ident": "object" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) delta", - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) object" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 20 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message.delta" - } - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the message in array of text and/or images.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta/properties/content", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta/properties/content/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "ImageFileDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_delta_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "TextDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) text_delta_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "RefusalDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_delta_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ImageURLDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_delta_block > (schema)" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 1", - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 2", - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 3" - ] - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta/properties/role", - "deprecated": false, - "key": "role", - "docstring": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta/properties/role", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "user" - }, - { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role > (member) 0", - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role > (member) 1" - ] - }, - "(resource) beta.threads.messages > (model) message_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaObject/properties/delta", - "docstring": "The delta containing the fields that have changed on the Message.", - "ident": "MessageDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "content" - }, - { - "ident": "role" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role" - ] - }, - "(resource) beta.threads.messages > (model) message_delta_event > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message.delta" - } - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFileDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_delta_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) image_file" - ] - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "TextDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) text_delta_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) text" - ] - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "RefusalDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_delta_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) refusal" - ] - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) content > (items) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURLDeltaBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_delta_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) image_url" - ] - }, - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject", - "docstring": "References an image [File](/docs/api-reference/files) in the content of a message.", - "ident": "ImageFileDeltaBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "image_file" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) image_file" - ] - }, - "(resource) beta.threads.messages > (model) text_delta_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject", - "docstring": "The text content that is part of a message.", - "ident": "TextDeltaBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "text" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) text" - ] - }, - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentRefusalObject", - "docstring": "The refusal content that is part of a message.", - "ident": "RefusalDeltaBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "refusal" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) refusal" - ] - }, - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject", - "docstring": "References an image URL in the content of a message.", - "ident": "ImageURLDeltaBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "image_url" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) index", - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) type", - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) image_url" - ] - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "user" - } - }, - "(resource) beta.threads.messages > (model) message_delta > (schema) > (property) role > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - }, - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the content part in the message.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image_file`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) image_file": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/image_file", - "deprecated": false, - "key": "image_file", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFileDelta", - "$ref": "(resource) beta.threads.messages > (model) image_file_delta > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_file_delta", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail", - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the content part in the message.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/text", - "deprecated": false, - "key": "text", - "type": { - "kind": "HttpTypeReference", - "ident": "TextDelta", - "$ref": "(resource) beta.threads.messages > (model) text_delta > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) text_delta", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentRefusalObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the refusal part in the message.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentRefusalObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `refusal`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentRefusalObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) refusal": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentRefusalObject/properties/refusal", - "deprecated": false, - "key": "refusal", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the content part in the message.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image_url`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) image_url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/image_url", - "deprecated": false, - "key": "image_url", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURLDelta", - "$ref": "(resource) beta.threads.messages > (model) image_url_delta > (schema)" - }, - "optional": true, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_url_delta", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail", - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) url" - ] - }, - "(resource) beta.threads.messages > (model) image_file_delta_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - }, - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/image_file/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/image_file/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/image_file/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose=\"vision\"` when uploading the File if you need to later display the file content.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_file_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentImageFileObject/properties/image_file", - "ident": "ImageFileDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "detail" - }, - { - "ident": "file_id" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail", - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) text_delta_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/text/properties/annotations", - "deprecated": false, - "key": "annotations", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/text/properties/annotations", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/text/properties/annotations/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "FileCitationDeltaAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FilePathDeltaAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema)" - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) value": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/text/properties/value", - "deprecated": false, - "key": "value", - "docstring": "The data that makes up the text.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) text_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentTextObject/properties/text", - "ident": "TextDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "annotations" - }, - { - "ident": "value" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) refusal_delta_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - }, - "(resource) beta.threads.messages > (model) image_url_delta_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - }, - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/image_url/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/image_url/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/image_url/properties/url", - "deprecated": false, - "key": "url", - "docstring": "The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.", - "type": { - "kind": "HttpTypeString" - }, - "constraints": { - "format": "uri" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url_delta > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentImageUrlObject/properties/image_url", - "ident": "ImageURLDelta", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "detail" - }, - { - "ident": "url" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail", - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) url" - ] - }, - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_file_delta > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileCitationDeltaAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) index", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) type", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) text" - ] - }, - "(resource) beta.threads.messages > (model) text_delta > (schema) > (property) annotations > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FilePathDeltaAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) index", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) type", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) text" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject", - "docstring": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", - "ident": "FileCitationDeltaAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "end_index" - }, - { - "ident": "file_citation" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) index", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) type", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) text" - ] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject", - "docstring": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", - "ident": "FilePathDeltaAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "index" - }, - { - "ident": "type" - }, - { - "ident": "end_index" - }, - { - "ident": "file_path" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) index", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) type", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) text" - ] - }, - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_url_delta > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the annotation in the text content part.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_citation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/file_citation", - "deprecated": false, - "key": "file_citation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "quote" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation > (property) file_id", - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation > (property) quote" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/index", - "deprecated": false, - "key": "index", - "docstring": "The index of the annotation in the text content part.", - "type": { - "kind": "HttpTypeNumber" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_path`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) file_path": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/file_path", - "deprecated": false, - "key": "file_path", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": true, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) file_path > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": true, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/file_citation/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the specific File the citation is from.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_delta_annotation > (schema) > (property) file_citation > (property) quote": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject/properties/file_citation/properties/quote", - "deprecated": false, - "key": "quote", - "docstring": "The specific quote in the file.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - }, - "(resource) beta.threads.messages > (model) file_path_delta_annotation > (schema) > (property) file_path > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject/properties/file_path/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that was generated.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [message](https://developers.openai.com/docs/api-reference/messages/object) is completed. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/3", - "docstring": "Occurs when a [message](/docs/api-reference/messages/object) is completed.", - "ident": "ThreadMessageCompleted", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/3/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "title": "The message object", - "type": { - "kind": "HttpTypeReference", - "ident": "Message", - "$ref": "(resource) beta.threads.messages > (model) message > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) message", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/3/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/3/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message.completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "deprecated": false, - "key": "attachments", - "docstring": "A list of files attached to the message, and the tools they were added to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "tools" - } - ] - } - }, - "optional": false, - "nullable": true, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the message was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the message in array of text and/or images.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/content/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the message was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_at", - "deprecated": false, - "key": "incomplete_at", - "docstring": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "On an incomplete message, details about why the message is incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.message`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "deprecated": false, - "key": "role", - "docstring": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "user" - }, - { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "ident": "Message", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "attachments" - }, - { - "ident": "completed_at" - }, - { - "ident": "content" - }, - { - "ident": "created_at" - }, - { - "ident": "incomplete_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "role" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 21 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message.completed" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file to attach to the message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The tools to add this file to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject", - "docstring": "References an image [File](/docs/api-reference/files) in the content of a message.", - "ident": "ImageFileContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_file" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject", - "docstring": "References an image URL in the content of a message.", - "ident": "ImageURLContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_url" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject", - "docstring": "The text content that is part of a message.", - "ident": "TextContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentRefusalObject", - "docstring": "The refusal content generated by the assistant.", - "ident": "RefusalContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "refusal" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason the message is incomplete.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4" - ] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "user" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items/oneOf/1", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "deprecated": false, - "key": "image_file", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFile", - "$ref": "(resource) beta.threads.messages > (model) image_file > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_file", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image_file`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "deprecated": false, - "key": "image_url", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURL", - "$ref": "(resource) beta.threads.messages > (model) image_url > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_url", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content part.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "deprecated": false, - "key": "text", - "type": { - "kind": "HttpTypeReference", - "ident": "Text", - "$ref": "(resource) beta.threads.messages > (model) text > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) text", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/refusal", - "deprecated": false, - "key": "refusal", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `refusal`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose=\"vision\"` when uploading the File if you need to later display the file content.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "ident": "ImageFile", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/url", - "deprecated": false, - "key": "url", - "docstring": "The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.", - "type": { - "kind": "HttpTypeString" - }, - "constraints": { - "format": "uri" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_url > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "ident": "ImageURL", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "url" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "deprecated": false, - "key": "annotations", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) value": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/value", - "deprecated": false, - "key": "value", - "docstring": "The data that makes up the text.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "ident": "Text", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "annotations" - }, - { - "ident": "value" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject", - "docstring": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", - "ident": "FileCitationAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_citation" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject", - "docstring": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", - "ident": "FilePathAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_path" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation", - "deprecated": false, - "key": "file_citation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_citation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path", - "deprecated": false, - "key": "file_path", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_path`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the specific File the citation is from.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that was generated.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a [message](https://developers.openai.com/docs/api-reference/messages/object) ends before it is completed. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/4", - "docstring": "Occurs when a [message](/docs/api-reference/messages/object) ends before it is completed.", - "ident": "ThreadMessageIncomplete", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/4/properties/data", - "deprecated": false, - "key": "data", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "title": "The message object", - "type": { - "kind": "HttpTypeReference", - "ident": "Message", - "$ref": "(resource) beta.threads.messages > (model) message > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) message", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/4/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageStreamEvent/oneOf/4/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message.incomplete" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22 > (property) event > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/id", - "deprecated": false, - "key": "id", - "docstring": "The identifier, which can be referenced in API endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/assistant_id", - "deprecated": false, - "key": "assistant_id", - "docstring": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "deprecated": false, - "key": "attachments", - "docstring": "A list of files attached to the message, and the tools they were added to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments", - "elementType": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "tools" - } - ] - } - }, - "optional": false, - "nullable": true, - "schemaType": "array", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/completed_at", - "deprecated": false, - "key": "completed_at", - "docstring": "The Unix timestamp (in seconds) for when the message was completed.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "deprecated": false, - "key": "content", - "docstring": "The content of the message in array of text and/or images.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/content", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/content/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/created_at", - "deprecated": false, - "key": "created_at", - "docstring": "The Unix timestamp (in seconds) for when the message was created.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_at", - "deprecated": false, - "key": "incomplete_at", - "docstring": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "format": "unixtime" - }, - "optional": false, - "nullable": true, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details", - "deprecated": false, - "key": "incomplete_details", - "docstring": "On an incomplete message, details about why the message is incomplete.", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "reason" - } - ] - }, - "optional": false, - "nullable": true, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/metadata", - "deprecated": false, - "key": "metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "type": { - "kind": "HttpTypeReference", - "ident": "Metadata", - "$ref": "(resource) $shared > (model) metadata > (schema)" - }, - "optional": false, - "nullable": true, - "modelImplicit": false, - "schemaType": "map", - "modelPath": "(resource) $shared > (model) metadata", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "deprecated": false, - "key": "object", - "docstring": "The object type, which is always `thread.message`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/object", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "deprecated": false, - "key": "role", - "docstring": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/role", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "user" - }, - { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/run_id", - "deprecated": false, - "key": "run_id", - "docstring": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "deprecated": false, - "key": "status", - "docstring": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/status", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - }, - { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - }, - { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/thread_id", - "deprecated": false, - "key": "thread_id", - "docstring": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject", - "docstring": "Represents a message within a [thread](/docs/api-reference/threads).", - "ident": "Message", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "id" - }, - { - "ident": "assistant_id" - }, - { - "ident": "attachments" - }, - { - "ident": "completed_at" - }, - { - "ident": "content" - }, - { - "ident": "created_at" - }, - { - "ident": "incomplete_at" - }, - { - "ident": "incomplete_details" - }, - { - "ident": "metadata" - }, - { - "ident": "object" - }, - { - "ident": "role" - }, - { - "ident": "run_id" - }, - { - "ident": "status" - }, - { - "ident": "thread_id" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) assistant_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments", - "(resource) beta.threads.messages > (model) message > (schema) > (property) completed_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) content", - "(resource) beta.threads.messages > (model) message > (schema) > (property) created_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_at", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details", - "(resource) beta.threads.messages > (model) message > (schema) > (property) metadata", - "(resource) beta.threads.messages > (model) message > (schema) > (property) object", - "(resource) beta.threads.messages > (model) message > (schema) > (property) role", - "(resource) beta.threads.messages > (model) message > (schema) > (property) run_id", - "(resource) beta.threads.messages > (model) message > (schema) > (property) status", - "(resource) beta.threads.messages > (model) message > (schema) > (property) thread_id" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 22 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message.incomplete" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file to attach to the message.", - "type": { - "kind": "HttpTypeString" - }, - "optional": true, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "deprecated": false, - "key": "tools", - "docstring": "The tools to add this file to.", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - } - ] - } - }, - "optional": true, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFileContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_file_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURLContentBlock", - "$ref": "(resource) beta.threads.messages > (model) image_url_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "TextContentBlock", - "$ref": "(resource) beta.threads.messages > (model) text_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) content > (items) > (variant) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "RefusalContentBlock", - "$ref": "(resource) beta.threads.messages > (model) refusal_content_block > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject", - "docstring": "References an image [File](/docs/api-reference/files) in the content of a message.", - "ident": "ImageFileContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_file" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file", - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject", - "docstring": "References an image URL in the content of a message.", - "ident": "ImageURLContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "image_url" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url", - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject", - "docstring": "The text content that is part of a message.", - "ident": "TextContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text", - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentRefusalObject", - "docstring": "The refusal content generated by the assistant.", - "ident": "RefusalContentBlock", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "refusal" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal", - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "deprecated": false, - "key": "reason", - "docstring": "The reason the message is incomplete.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageObject/properties/incomplete_details/anyOf/0/properties/reason", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - }, - { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - }, - { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3", - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4" - ] - }, - "(resource) $shared > (model) metadata > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Metadata", - "docstring": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n", - "ident": "Metadata", - "type": { - "kind": "HttpTypeReference", - "oasRef": "#/components/schemas/Metadata", - "ident": "Record", - "typeParameters": [ - { - "kind": "HttpTypeString" - }, - { - "kind": "HttpTypeString" - } - ] - }, - "children": [] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) object > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "thread.message" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "user" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) role > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "assistant" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "in_progress" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "incomplete" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) status > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "completed" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "CodeInterpreterTool", - "$ref": "(resource) beta.assistants > (model) code_interpreter_tool > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageObject/properties/attachments/anyOf/0/items/properties/tools/items/oneOf/1", - "ident": "FileSearchTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type" - ] - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantToolsCode", - "ident": "CodeInterpreterTool", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) image_file": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "deprecated": false, - "key": "image_file", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageFile", - "$ref": "(resource) beta.threads.messages > (model) image_file > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_file", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `image_file`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) image_url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "deprecated": false, - "key": "image_url", - "type": { - "kind": "HttpTypeReference", - "ident": "ImageURL", - "$ref": "(resource) beta.threads.messages > (model) image_url > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) image_url", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of the content part.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "deprecated": false, - "key": "text", - "type": { - "kind": "HttpTypeReference", - "ident": "Text", - "$ref": "(resource) beta.threads.messages > (model) text > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) beta.threads.messages > (model) text", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `text`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "text" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) refusal": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/refusal", - "deprecated": false, - "key": "refusal", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `refusal`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentRefusalObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "content_filter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "max_tokens" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_cancelled" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 3": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_expired" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) incomplete_details > (property) reason > (member) 4": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "run_failed" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `code_interpreter`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsCode/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "deprecated": false, - "key": "type", - "docstring": "The type of tool being defined: `file_search`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/AssistantToolsFileSearchTypeOnly/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose=\"vision\"` when uploading the File if you need to later display the file content.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_file > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageFileObject/properties/image_file", - "ident": "ImageFile", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) file_id", - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_file_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_file" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/url", - "deprecated": false, - "key": "url", - "docstring": "The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.", - "type": { - "kind": "HttpTypeString" - }, - "constraints": { - "format": "uri" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "deprecated": false, - "key": "detail", - "docstring": "Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto`", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url/properties/detail", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "auto" - }, - { - "kind": "HttpTypeLiteral", - "literal": "low" - }, - { - "kind": "HttpTypeLiteral", - "literal": "high" - } - ] - }, - "default": "auto", - "optional": true, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2" - ] - }, - "(resource) beta.threads.messages > (model) image_url > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentImageUrlObject/properties/image_url", - "ident": "ImageURL", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "url" - }, - { - "ident": "detail" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) url", - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail" - ] - }, - "(resource) beta.threads.messages > (model) image_url_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "image_url" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "deprecated": false, - "key": "annotations", - "type": { - "kind": "HttpTypeArray", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations", - "elementType": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/annotations/items", - "types": [ - { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - } - ] - } - }, - "optional": false, - "nullable": false, - "schemaType": "array", - "childrenParentSchema": "union", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0", - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) value": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text/properties/value", - "deprecated": false, - "key": "value", - "docstring": "The data that makes up the text.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) text > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextObject/properties/text", - "ident": "Text", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "annotations" - }, - { - "ident": "value" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations", - "(resource) beta.threads.messages > (model) text > (schema) > (property) value" - ] - }, - "(resource) beta.threads.messages > (model) text_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "text" - } - }, - "(resource) beta.threads.messages > (model) refusal_content_block > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "refusal" - } - }, - "(resource) beta.assistants > (model) code_interpreter_tool > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "code_interpreter" - } - }, - "(resource) beta.threads.messages > (model) message > (schema) > (property) attachments > (items) > (property) tools > (items) > (variant) 1 > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_search" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_file > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "auto" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "low" - } - }, - "(resource) beta.threads.messages > (model) image_url > (schema) > (property) detail > (member) 2": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "high" - } - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FileCitationAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) text > (schema) > (property) annotations > (items) > (variant) 1": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeReference", - "ident": "FilePathAnnotation", - "$ref": "(resource) beta.threads.messages > (model) file_path_annotation > (schema)" - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject", - "docstring": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", - "ident": "FileCitationAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_citation" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject", - "docstring": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", - "ident": "FilePathAnnotation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "end_index" - }, - { - "ident": "file_path" - }, - { - "ident": "start_index" - }, - { - "ident": "text" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text", - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation", - "deprecated": false, - "key": "file_citation", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_citation`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) end_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/end_index", - "deprecated": false, - "key": "end_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path", - "deprecated": false, - "key": "file_path", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "file_id" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "object", - "childrenParentSchema": "object", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id" - ] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) start_index": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/start_index", - "deprecated": false, - "key": "start_index", - "type": { - "kind": "HttpTypeNumber" - }, - "constraints": { - "minimum": 0 - }, - "optional": false, - "nullable": false, - "schemaType": "integer", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) text": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/text", - "deprecated": false, - "key": "text", - "docstring": "The text in the message content that needs to be replaced.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "deprecated": false, - "key": "type", - "docstring": "Always `file_path`.", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/type", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0" - ] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) file_citation > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFileCitationObject/properties/file_citation/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the specific File the citation is from.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_citation_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_citation" - } - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) file_path > (property) file_id": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/MessageContentTextAnnotationsFilePathObject/properties/file_path/properties/file_id", - "deprecated": false, - "key": "file_id", - "docstring": "The ID of the file that was generated.", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) beta.threads.messages > (model) file_path_annotation > (schema) > (property) type > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "file_path" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when an [error](https://developers.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantStreamEvent/oneOf/4", - "docstring": "Occurs when an [error](/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout.", - "ident": "ErrorEvent", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ErrorEvent/properties/data", - "deprecated": false, - "key": "data", - "type": { - "kind": "HttpTypeReference", - "ident": "ErrorObject", - "$ref": "(resource) $shared > (model) error_object > (schema)" - }, - "optional": false, - "nullable": false, - "modelImplicit": false, - "schemaType": "object", - "modelPath": "(resource) $shared > (model) error_object", - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) error_object > (schema) > (property) code", - "(resource) $shared > (model) error_object > (schema) > (property) message", - "(resource) $shared > (model) error_object > (schema) > (property) param", - "(resource) $shared > (model) error_object > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/ErrorEvent/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/ErrorEvent/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "error" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23 > (property) event > (member) 0" - ] - }, - "(resource) $shared > (model) error_object > (schema) > (property) code": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/Error/properties/code", - "deprecated": false, - "key": "code", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) error_object > (schema) > (property) message": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/Error/properties/message", - "deprecated": false, - "key": "message", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) error_object > (schema) > (property) param": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/Error/properties/param", - "deprecated": false, - "key": "param", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": true, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) error_object > (schema) > (property) type": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/Error/properties/type", - "deprecated": false, - "key": "type", - "type": { - "kind": "HttpTypeString" - }, - "optional": false, - "nullable": false, - "schemaType": "string", - "children": [] - }, - "(resource) $shared > (model) error_object > (schema)": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/Error", - "ident": "ErrorObject", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "code" - }, - { - "ident": "message" - }, - { - "ident": "param" - }, - { - "ident": "type" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) $shared > (model) error_object > (schema) > (property) code", - "(resource) $shared > (model) error_object > (schema) > (property) message", - "(resource) $shared > (model) error_object > (schema) > (property) param", - "(resource) $shared > (model) error_object > (schema) > (property) type" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 23 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "error" - } - } -} -``` - -### Example - -```json -{} -``` - -## event - -Occurs when a stream ends. - -### Schema - -Schema name: `(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24` - -```json -{ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24": { - "kind": "HttpDeclTypeAlias", - "oasRef": "#/components/schemas/AssistantStreamEvent/oneOf/5", - "docstring": "Occurs when a stream ends.", - "ident": "DoneEvent", - "type": { - "kind": "HttpTypeObject", - "members": [ - { - "ident": "data" - }, - { - "ident": "event" - } - ] - }, - "childrenParentSchema": "object", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) data", - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) event" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) data": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/DoneEvent/properties/data", - "deprecated": false, - "key": "data", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/DoneEvent/properties/data", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "[DONE]" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) data > (member) 0" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) event": { - "kind": "HttpDeclProperty", - "oasRef": "#/components/schemas/DoneEvent/properties/event", - "deprecated": false, - "key": "event", - "type": { - "kind": "HttpTypeUnion", - "oasRef": "#/components/schemas/DoneEvent/properties/event", - "types": [ - { - "kind": "HttpTypeLiteral", - "literal": "done" - } - ] - }, - "optional": false, - "nullable": false, - "schemaType": "enum", - "childrenParentSchema": "enum", - "children": [ - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) event > (member) 0" - ] - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) data > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "[DONE]" - } - }, - "(resource) beta.assistants > (model) assistant_stream_event > (schema) > (variant) 24 > (property) event > (member) 0": { - "kind": "HttpDeclReference", - "type": { - "kind": "HttpTypeLiteral", - "literal": "done" - } - } -} -``` - -### Example - -```json -{} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/responses/streaming-events.md b/docs/en/api/reference/resources/beta/subresources/responses/streaming-events.md index 3f71946..e4c24f3 100644 --- a/docs/en/api/reference/resources/beta/subresources/responses/streaming-events.md +++ b/docs/en/api/reference/resources/beta/subresources/responses/streaming-events.md @@ -2538,7 +2538,8 @@ Schema name: `BetaResponseCreatedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -8186,6 +8187,23 @@ Schema name: `BetaResponseCreatedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -8208,6 +8226,9 @@ Schema name: `BetaResponseCreatedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -8217,7 +8238,8 @@ Schema name: `BetaResponseCreatedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -66742,7 +66764,8 @@ Schema name: `BetaResponseInProgressEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -72390,6 +72413,23 @@ Schema name: `BetaResponseInProgressEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -72412,6 +72452,9 @@ Schema name: `BetaResponseInProgressEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -72421,7 +72464,8 @@ Schema name: `BetaResponseInProgressEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -130946,7 +130990,8 @@ Schema name: `BetaResponseCompletedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -136594,6 +136639,23 @@ Schema name: `BetaResponseCompletedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -136616,6 +136678,9 @@ Schema name: `BetaResponseCompletedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -136625,7 +136690,8 @@ Schema name: `BetaResponseCompletedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -195167,7 +195233,8 @@ Schema name: `BetaResponseFailedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -200815,6 +200882,23 @@ Schema name: `BetaResponseFailedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -200837,6 +200921,9 @@ Schema name: `BetaResponseFailedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -200846,7 +200933,8 @@ Schema name: `BetaResponseFailedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -259369,7 +259457,8 @@ Schema name: `BetaResponseIncompleteEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -265017,6 +265106,23 @@ Schema name: `BetaResponseIncompleteEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -265039,6 +265145,9 @@ Schema name: `BetaResponseIncompleteEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -265048,7 +265157,8 @@ Schema name: `BetaResponseIncompleteEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -388657,7 +388767,8 @@ Schema name: `BetaResponseQueuedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -394305,6 +394416,23 @@ Schema name: `BetaResponseQueuedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -394327,6 +394455,9 @@ Schema name: `BetaResponseQueuedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -394336,7 +394467,8 @@ Schema name: `BetaResponseQueuedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -451597,7 +451729,16 @@ Schema name: `BetaResponseShellCallCommandAddedStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_command.added", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ## response.shell_call_command.delta @@ -451796,7 +451937,17 @@ Schema name: `BetaResponseShellCallCommandDeltaStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_command.delta", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "output_index": 0, + "command_index": 0, + "delta": "delta", + "obfuscation": "obfuscation" +} ``` ## response.shell_call_command.done @@ -451977,7 +452128,16 @@ Schema name: `BetaResponseShellCallCommandDoneStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_command.done", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ## response.shell_call_output_content.delta @@ -452217,7 +452377,20 @@ Schema name: `BetaResponseShellCallOutputContentDeltaStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_output_content.delta", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "delta": { + "stdout": "stdout", + "stderr": "stderr" + } +} ``` ## response.shell_call_output_content.done @@ -452641,5 +452814,24 @@ Schema name: `BetaResponseShellCallOutputContentDoneStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_output_content.done", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "output": [ + { + "stdout": "stdout", + "stderr": "stderr", + "outcome": { + "type": "timeout" + }, + "created_by": "created_by" + } + ] +} ``` diff --git a/docs/en/api/reference/resources/beta/subresources/responses/websocket-events.md b/docs/en/api/reference/resources/beta/subresources/responses/websocket-events.md index df64801..95c7898 100644 --- a/docs/en/api/reference/resources/beta/subresources/responses/websocket-events.md +++ b/docs/en/api/reference/resources/beta/subresources/responses/websocket-events.md @@ -100313,7 +100313,8 @@ Schema name: `BetaResponseCreatedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -105961,6 +105962,23 @@ Schema name: `BetaResponseCreatedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -105983,6 +106001,9 @@ Schema name: `BetaResponseCreatedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -105992,7 +106013,8 @@ Schema name: `BetaResponseCreatedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -164552,7 +164574,8 @@ Schema name: `BetaResponseInProgressEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -170200,6 +170223,23 @@ Schema name: `BetaResponseInProgressEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -170222,6 +170262,9 @@ Schema name: `BetaResponseInProgressEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -170231,7 +170274,8 @@ Schema name: `BetaResponseInProgressEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -228791,7 +228835,8 @@ Schema name: `BetaResponseCompletedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -234439,6 +234484,23 @@ Schema name: `BetaResponseCompletedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -234461,6 +234523,9 @@ Schema name: `BetaResponseCompletedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -234470,7 +234535,8 @@ Schema name: `BetaResponseCompletedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -293047,7 +293113,8 @@ Schema name: `BetaResponseFailedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -298695,6 +298762,23 @@ Schema name: `BetaResponseFailedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -298717,6 +298801,9 @@ Schema name: `BetaResponseFailedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -298726,7 +298813,8 @@ Schema name: `BetaResponseFailedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -357284,7 +357372,8 @@ Schema name: `BetaResponseIncompleteEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -362932,6 +363021,23 @@ Schema name: `BetaResponseIncompleteEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -362954,6 +363060,9 @@ Schema name: `BetaResponseIncompleteEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -362963,7 +363072,8 @@ Schema name: `BetaResponseIncompleteEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -488007,7 +488117,8 @@ Schema name: `BetaResponseQueuedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response > (schema) > (property) user": { @@ -493655,6 +493766,23 @@ Schema name: `BetaResponseQueuedEvent` "schemaType": "integer", "children": [] }, + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/BetaResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) beta.responses > (model) beta_response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/BetaResponseUsage", @@ -493677,6 +493805,9 @@ Schema name: `BetaResponseQueuedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -493686,7 +493817,8 @@ Schema name: `BetaResponseQueuedEvent` "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) input_tokens_details", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens", "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) output_tokens_details", - "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens" + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) total_tokens", + "(resource) beta.responses > (model) beta_response_usage > (schema) > (property) compute_units" ] }, "(resource) beta.responses > (model) beta_response_error > (schema) > (property) code > (member) 0": { @@ -551006,7 +551138,16 @@ Schema name: `BetaResponseShellCallCommandAddedStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_command.added", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ### response.shell_call_command.delta @@ -551240,7 +551381,17 @@ Schema name: `BetaResponseShellCallCommandDeltaStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_command.delta", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "output_index": 0, + "command_index": 0, + "delta": "delta", + "obfuscation": "obfuscation" +} ``` ### response.shell_call_command.done @@ -551456,7 +551607,16 @@ Schema name: `BetaResponseShellCallCommandDoneStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_command.done", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ### response.shell_call_output_content.delta @@ -551731,7 +551891,20 @@ Schema name: `BetaResponseShellCallOutputContentDeltaStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_output_content.delta", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "delta": { + "stdout": "stdout", + "stderr": "stderr" + } +} ``` ### response.shell_call_output_content.done @@ -552190,5 +552363,24 @@ Schema name: `BetaResponseShellCallOutputContentDoneStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_output_content.done", + "sequence_number": 0, + "agent": { + "agent_name": "agent_name" + }, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "output": [ + { + "stdout": "stdout", + "stderr": "stderr", + "outcome": { + "type": "timeout" + }, + "created_by": "created_by" + } + ] +} ``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads.md b/docs/en/api/reference/resources/beta/subresources/threads.md deleted file mode 100644 index 8b64ca4..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads.md +++ /dev/null @@ -1,11563 +0,0 @@ -# Threads - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create thread - -**post** `/threads` - -Create a thread. - -### Body Parameters - -- `messages: optional array of object { content, role, attachments, metadata }` - - A list of [messages](/docs/api-reference/messages) to start the thread with. - - - `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - - - `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids, vector_stores }` - - - `vector_store_ids: optional array of string` - - 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_stores: optional array of object { chunking_strategy, file_ids, metadata }` - - 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. - - - `chunking_strategy: optional object { type } or object { static, type }` - - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - - - `Auto object { type }` - - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - - `type: "auto"` - - Always `auto`. - - - `"auto"` - - - `Static object { static, type }` - - - `static: object { chunk_overlap_tokens, max_chunk_size_tokens }` - - - `chunk_overlap_tokens: number` - - 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`. - - - `max_chunk_size_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`. - - - `type: "static"` - - Always `static`. - - - `"static"` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Example - -```http -curl https://api.openai.com/v1/threads \ - -X POST \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` - -### Empty - -```http -curl https://api.openai.com/v1/threads \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '' -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699012949, - "metadata": {}, - "tool_resources": {} -} -``` - -### Messages - -```http -curl https://api.openai.com/v1/threads \ --H "Content-Type: application/json" \ --H "Authorization: Bearer $OPENAI_API_KEY" \ --H "OpenAI-Beta: assistants=v2" \ --d '{ - "messages": [{ - "role": "user", - "content": "Hello, what is AI?" - }, { - "role": "user", - "content": "How does AI work? Explain it in simple terms." - }] - }' -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699014083, - "metadata": {}, - "tool_resources": {} -} -``` - -## Create thread and run - -**post** `/threads/runs` - -Create a thread and run it in one request. - -### Body Parameters - -- `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. - -- `instructions: optional string or null` - - Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - -- `max_completion_tokens: optional number or null` - - The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `max_prompt_tokens: optional number or null` - - The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `model: optional string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 35 more or null` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `string` - - - `"gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 35 more` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `parallel_tool_calls: optional boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `thread: optional object { messages, metadata, tool_resources }` - - Options to create a new thread. If no thread is provided when running a - request, an empty thread will be created. - - - `messages: optional array of object { content, role, attachments, metadata }` - - A list of [messages](/docs/api-reference/messages) to start the thread with. - - - `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - - - `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids, vector_stores }` - - - `vector_store_ids: optional array of string` - - 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_stores: optional array of object { chunking_strategy, file_ids, metadata }` - - 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. - - - `chunking_strategy: optional object { type } or object { static, type }` - - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - - - `Auto object { type }` - - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - - `type: "auto"` - - Always `auto`. - - - `"auto"` - - - `Static object { static, type }` - - - `static: object { chunk_overlap_tokens, max_chunk_size_tokens }` - - - `chunk_overlap_tokens: number` - - 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`. - - - `max_chunk_size_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`. - - - `type: "static"` - - Always `static`. - - - `"static"` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tool_choice: optional AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - The ID of the [vector store](/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool or null` - - Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - - - `CodeInterpreterTool object { type }` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -- `truncation_strategy: optional object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/runs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "assistant_id": "assistant_id", - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123", - "thread": { - "messages": [ - {"role": "user", "content": "Explain deep learning to a 5 year old."} - ] - } - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699076792, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "queued", - "started_at": null, - "expires_at": 1699077392, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "required_action": null, - "last_error": null, - "model": "gpt-4o", - "instructions": "You are a helpful assistant.", - "tools": [], - "tool_resources": {}, - "metadata": {}, - "temperature": 1.0, - "top_p": 1.0, - "max_completion_tokens": null, - "max_prompt_tokens": null, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "incomplete_details": null, - "usage": null, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_123", - "thread": { - "messages": [ - {"role": "user", "content": "Hello"} - ] - }, - "stream": true - }' -``` - -#### Response - -```json -event: thread.created -data: {"id":"thread_123","object":"thread","created_at":1710348075,"metadata":{}} - -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"tool_resources":{},"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[], "metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}], "metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -{"id":"run_123","object":"thread.run","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1713226836,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1713226837,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} - -event: done -data: [DONE] -``` - -### Streaming with Functions - -```http -curl https://api.openai.com/v1/threads/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123", - "thread": { - "messages": [ - {"role": "user", "content": "What is the weather like in San Francisco?"} - ] - }, - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.created -data: {"id":"thread_123","object":"thread","created_at":1710351818,"metadata":{}} - -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710351819,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710352418,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[]},"usage":null} - -event: thread.run.step.delta -data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"","output":null}}]}}} - -event: thread.run.step.delta -data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"{\""}}]}}} - -event: thread.run.step.delta -data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"location"}}]}}} - -... - -event: thread.run.step.delta -data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"ahrenheit"}}]}}} - -event: thread.run.step.delta -data: {"id":"step_001","object":"thread.run.step.delta","delta":{"step_details":{"type":"tool_calls","tool_calls":[{"index":0,"type":"function","function":{"arguments":"\"}"}}]}}} - -event: thread.run.requires_action -data: {"id":"run_123","object":"thread.run","created_at":1710351818,"assistant_id":"asst_123","thread_id":"thread_123","status":"requires_action","started_at":1710351818,"expires_at":1710352418,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":{"type":"submit_tool_outputs","submit_tool_outputs":{"tool_calls":[{"id":"call_XXNp8YGaFrjrSjgqxtC8JJ1B","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}"}}]}},"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":345,"completion_tokens":11,"total_tokens":356},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -## Delete thread - -**delete** `/threads/{thread_id}` - -Delete a thread. - -### Path Parameters - -- `thread_id: string` - -### Returns - -- `ThreadDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.deleted"` - - - `"thread.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "thread.deleted" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X DELETE -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread.deleted", - "deleted": true -} -``` - -## Retrieve thread - -**get** `/threads/{thread_id}` - -Retrieves a thread. - -### Path Parameters - -- `thread_id: string` - -### Returns - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699014083, - "metadata": {}, - "tool_resources": { - "code_interpreter": { - "file_ids": [] - } - } -} -``` - -## Modify thread - -**post** `/threads/{thread_id}` - -Modifies a thread. - -### Path Parameters - -- `thread_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Returns - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "modified": "true", - "user": "abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699014083, - "metadata": { - "modified": "true", - "user": "abc123" - }, - "tool_resources": {} -} -``` - -## Domain Types - -### Assistant Response Format Option - -- `AssistantResponseFormatOption = "auto" or ResponseFormatText or ResponseFormatJSONObject or ResponseFormatJSONSchema` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -### Assistant Tool Choice - -- `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - -### Assistant Tool Choice Function - -- `AssistantToolChoiceFunction object { name }` - - - `name: string` - - The name of the function to call. - -### Assistant Tool Choice Option - -- `AssistantToolChoiceOption = "none" or "auto" or "required" or AssistantToolChoice` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - -### Thread - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Thread Deleted - -- `ThreadDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.deleted"` - - - `"thread.deleted"` - -# Messages - -## Create message - -**post** `/threads/{thread_id}/messages` - -Create a message. - -### Path Parameters - -- `thread_id: string` - -### Body Parameters - -- `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - -- `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - -- `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "content": "string", - "role": "user" - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "role": "user", - "content": "How does AI work? Explain it in simple terms." - }' -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1713226573, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} -} -``` - -## Delete message - -**delete** `/threads/{thread_id}/messages/{message_id}` - -Deletes a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Returns - -- `MessageDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.message.deleted"` - - - `"thread.message.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "thread.message.deleted" -} -``` - -### Example - -```http -curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message.deleted", - "deleted": true -} -``` - -## List messages - -**get** `/threads/{thread_id}/messages` - -Returns a list of messages for a given thread. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -- `run_id: optional string` - - Filter messages by the run ID that generated them. - -### Returns - -- `data: array of Message` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" - } - ], - "first_id": "msg_abc123", - "has_more": false, - "last_id": "msg_abc123", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699016383, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} - }, - { - "id": "msg_abc456", - "object": "thread.message", - "created_at": 1699016383, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "Hello, what is AI?", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} - } - ], - "first_id": "msg_abc123", - "last_id": "msg_abc456", - "has_more": false -} -``` - -## Retrieve message - -**get** `/threads/{thread_id}/messages/{message_id}` - -Retrieve a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699017614, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} -} -``` - -## Modify message - -**post** `/threads/{thread_id}/messages/{message_id}` - -Modifies a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "modified": "true", - "user": "abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699017614, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "file_ids": [], - "metadata": { - "modified": "true", - "user": "abc123" - } -} -``` - -## Domain Types - -### File Citation Annotation - -- `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - -### File Citation Delta Annotation - -- `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - -### File Path Annotation - -- `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - -### File Path Delta Annotation - -- `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - -### Image File - -- `ImageFile object { file_id, detail }` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - -### Image File Content Block - -- `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - -### Image File Delta - -- `ImageFileDelta object { detail, file_id }` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - -### Image File Delta Block - -- `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - -### Image URL - -- `ImageURL object { url, detail }` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - -### Image URL Content Block - -- `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - -### Image URL Delta - -- `ImageURLDelta object { detail, url }` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - -### Image URL Delta Block - -- `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - -### Message - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Message Deleted - -- `MessageDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.message.deleted"` - - - `"thread.message.deleted"` - -### Message Delta - -- `MessageDelta object { content, role }` - - The delta containing the fields that have changed on the Message. - - - `content: optional array of ImageFileDeltaBlock or TextDeltaBlock or RefusalDeltaBlock or ImageURLDeltaBlock` - - The content of the message in array of text and/or images. - - - `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - - - `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - - - `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `role: optional "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - -### Message Delta Event - -- `MessageDeltaEvent object { id, delta, object }` - - Represents a message delta i.e. any changed fields on a message during streaming. - - - `id: string` - - The identifier of the message, which can be referenced in API endpoints. - - - `delta: MessageDelta` - - The delta containing the fields that have changed on the Message. - - - `content: optional array of ImageFileDeltaBlock or TextDeltaBlock or RefusalDeltaBlock or ImageURLDeltaBlock` - - The content of the message in array of text and/or images. - - - `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - - - `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - - - `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `role: optional "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `object: "thread.message.delta"` - - The object type, which is always `thread.message.delta`. - - - `"thread.message.delta"` - -### Refusal Content Block - -- `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - -### Refusal Delta Block - -- `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - -### Text - -- `Text object { annotations, value }` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - -### Text Content Block - -- `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - -### Text Content Block Param - -- `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - -### Text Delta - -- `TextDelta object { annotations, value }` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - -### Text Delta Block - -- `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - -# Runs - -## Cancel a run - -**post** `/threads/{thread_id}/runs/{run_id}/cancel` - -Cancels a run that is `in_progress`. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/cancel \ - -X POST \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X POST -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699076126, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "cancelling", - "started_at": 1699076126, - "expires_at": 1699076726, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "last_error": null, - "model": "gpt-4o", - "instructions": "You summarize books.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": ["vs_123"] - } - }, - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -## Create run - -**post** `/threads/{thread_id}/runs` - -Create a run. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Body Parameters - -- `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. - -- `additional_instructions: optional string or null` - - Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - -- `additional_messages: optional array of object { content, role, attachments, metadata } or null` - - Adds additional messages to the thread before creating the run. - - - `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - - - `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `instructions: optional string or null` - - Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - -- `max_completion_tokens: optional number or null` - - The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `max_prompt_tokens: optional number or null` - - The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `model: optional string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more or null` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `parallel_tool_calls: optional boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_choice: optional AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool or null` - - Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - - - `CodeInterpreterTool object { type }` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -- `truncation_strategy: optional object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "assistant_id": "assistant_id", - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123" - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699063290, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "queued", - "started_at": 1699063290, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699063291, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/thread_123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_123", - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710330641,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710330642,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710330642,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710330641,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710330642,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -### Streaming with Functions - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123", - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710348075,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710348075,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710348077,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -## List runs - -**get** `/threads/{thread_id}/runs` - -Returns a list of runs belonging to a thread. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of Run` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 - } - ], - "first_id": "run_abc123", - "has_more": false, - "last_id": "run_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - }, - { - "id": "run_abc456", - "object": "thread.run", - "created_at": 1699063290, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699063290, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699063291, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - } - ], - "first_id": "run_abc123", - "last_id": "run_abc456", - "has_more": false -} -``` - -## Retrieve run - -**get** `/threads/{thread_id}/runs/{run_id}` - -Retrieves a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -## Submit tool outputs to run - -**post** `/threads/{thread_id}/runs/{run_id}/submit_tool_outputs` - -When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Body Parameters - -- `tool_outputs: array of object { output, tool_call_id }` - - A list of tools for which the outputs are being submitted. - - - `output: optional string` - - The output of the tool call to be submitted to continue the run. - - - `tool_call_id: optional string` - - The ID of the tool call in the `required_action` object within the run object the output is being submitted for. - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/submit_tool_outputs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "tool_outputs": [ - {} - ] - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "tool_outputs": [ - { - "tool_call_id": "call_001", - "output": "70 degrees and sunny." - } - ] - }' -``` - -#### Response - -```json -{ - "id": "run_123", - "object": "thread.run", - "created_at": 1699075592, - "assistant_id": "asst_123", - "thread_id": "thread_123", - "status": "queued", - "started_at": 1699075592, - "expires_at": 1699076192, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "tool_outputs": [ - { - "tool_call_id": "call_001", - "output": "70 degrees and sunny." - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710352449,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1710352475,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_iWr0kQ2EaYMaxNdl0v3KYkx7","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}","output":"70 degrees and sunny."}}]},"usage":{"prompt_tokens":291,"completion_tokens":24,"total_tokens":315}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":1710352448,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710352475,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"The","annotations":[]}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" current"}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" weather"}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" sunny"}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"."}}]}} - -event: thread.message.completed -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710352477,"role":"assistant","content":[{"type":"text","text":{"value":"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710352477,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":{"prompt_tokens":329,"completion_tokens":18,"total_tokens":347}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710352475,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710352477,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -## Modify run - -**post** `/threads/{thread_id}/runs/{run_id}` - -Modifies a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "user_id": "user_abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": { - "user_id": "user_abc123" - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -## Domain Types - -### Required Action Function Tool Call - -- `RequiredActionFunctionToolCall object { id, function, type }` - - Tool call objects - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - -### Run - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -# Steps - -## List run steps - -**get** `/threads/{thread_id}/runs/{run_id}/steps` - -Returns a list of run steps belonging to a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of RunStep` - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } - } - ], - "first_id": "step_abc123", - "has_more": false, - "last_id": "step_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } - } - ], - "first_id": "step_abc123", - "last_id": "step_abc456", - "has_more": false -} -``` - -## Retrieve run step - -**get** `/threads/{thread_id}/runs/{run_id}/steps/{step_id}` - -Retrieves a run step. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -- `step_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Returns - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps/$STEP_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } -} -``` - -## Domain Types - -### Code Interpreter Logs - -- `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - -### Code Interpreter Output Image - -- `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - -### Code Interpreter Tool Call - -- `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - -### Code Interpreter Tool Call Delta - -- `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - -### File Search Tool Call - -- `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - -### File Search Tool Call Delta - -- `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - -### Function Tool Call - -- `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - -### Function Tool Call Delta - -- `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - -### Message Creation Step Details - -- `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - -### Run Step - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Run Step Delta Event - -- `RunStepDeltaEvent object { id, delta, object }` - - Represents a run step delta i.e. any changed fields on a run step during streaming. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `delta: object { step_details }` - - The delta containing the fields that have changed on the run step. - - - `step_details: optional RunStepDeltaMessageDelta or ToolCallDeltaObject` - - The details of the run step. - - - `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - - - `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `object: "thread.run.step.delta"` - - The object type, which is always `thread.run.step.delta`. - - - `"thread.run.step.delta"` - -### Run Step Delta Message Delta - -- `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - -### Run Step Include - -- `RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Tool Call Delta Object - -- `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - -### Tool Calls Step Details - -- `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/methods/create.md b/docs/en/api/reference/resources/beta/subresources/threads/methods/create.md deleted file mode 100644 index c0afd70..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/methods/create.md +++ /dev/null @@ -1,346 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create thread - -**post** `/threads` - -Create a thread. - -### Body Parameters - -- `messages: optional array of object { content, role, attachments, metadata }` - - A list of [messages](/docs/api-reference/messages) to start the thread with. - - - `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - - - `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids, vector_stores }` - - - `vector_store_ids: optional array of string` - - 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_stores: optional array of object { chunking_strategy, file_ids, metadata }` - - 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. - - - `chunking_strategy: optional object { type } or object { static, type }` - - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - - - `Auto object { type }` - - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - - `type: "auto"` - - Always `auto`. - - - `"auto"` - - - `Static object { static, type }` - - - `static: object { chunk_overlap_tokens, max_chunk_size_tokens }` - - - `chunk_overlap_tokens: number` - - 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`. - - - `max_chunk_size_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`. - - - `type: "static"` - - Always `static`. - - - `"static"` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Example - -```http -curl https://api.openai.com/v1/threads \ - -X POST \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` - -### Empty - -```http -curl https://api.openai.com/v1/threads \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '' -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699012949, - "metadata": {}, - "tool_resources": {} -} -``` - -### Messages - -```http -curl https://api.openai.com/v1/threads \ --H "Content-Type: application/json" \ --H "Authorization: Bearer $OPENAI_API_KEY" \ --H "OpenAI-Beta: assistants=v2" \ --d '{ - "messages": [{ - "role": "user", - "content": "Hello, what is AI?" - }, { - "role": "user", - "content": "How does AI work? Explain it in simple terms." - }] - }' -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699014083, - "metadata": {}, - "tool_resources": {} -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/methods/delete.md b/docs/en/api/reference/resources/beta/subresources/threads/methods/delete.md deleted file mode 100644 index d006ff1..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/methods/delete.md +++ /dev/null @@ -1,62 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Delete thread - -**delete** `/threads/{thread_id}` - -Delete a thread. - -### Path Parameters - -- `thread_id: string` - -### Returns - -- `ThreadDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.deleted"` - - - `"thread.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "thread.deleted" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X DELETE -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread.deleted", - "deleted": true -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/methods/retrieve.md b/docs/en/api/reference/resources/beta/subresources/threads/methods/retrieve.md deleted file mode 100644 index 288c7e9..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/methods/retrieve.md +++ /dev/null @@ -1,114 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Retrieve thread - -**get** `/threads/{thread_id}` - -Retrieves a thread. - -### Path Parameters - -- `thread_id: string` - -### Returns - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699014083, - "metadata": {}, - "tool_resources": { - "code_interpreter": { - "file_ids": [] - } - } -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/methods/update.md b/docs/en/api/reference/resources/beta/subresources/threads/methods/update.md deleted file mode 100644 index be2d5db..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/methods/update.md +++ /dev/null @@ -1,148 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Modify thread - -**post** `/threads/{thread_id}` - -Modifies a thread. - -### Path Parameters - -- `thread_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `tool_resources: optional object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Returns - -- `Thread object { id, created_at, metadata, 2 more }` - - Represents a thread that contains [messages](/docs/api-reference/messages). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the thread was created. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread"` - - The object type, which is always `thread`. - - - `"thread"` - - - `tool_resources: object { code_interpreter, file_search } or null` - - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - - `code_interpreter: optional object { file_ids }` - - - `file_ids: optional array of string` - - A list of [file](/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - - `file_search: optional object { vector_store_ids }` - - - `vector_store_ids: optional array of string` - - 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. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "modified": "true", - "user": "abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "thread_abc123", - "object": "thread", - "created_at": 1699014083, - "metadata": { - "modified": "true", - "user": "abc123" - }, - "tool_resources": {} -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages.md deleted file mode 100644 index fe0d651..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages.md +++ /dev/null @@ -1,2923 +0,0 @@ -# Messages - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create message - -**post** `/threads/{thread_id}/messages` - -Create a message. - -### Path Parameters - -- `thread_id: string` - -### Body Parameters - -- `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - -- `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - -- `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "content": "string", - "role": "user" - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "role": "user", - "content": "How does AI work? Explain it in simple terms." - }' -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1713226573, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} -} -``` - -## Delete message - -**delete** `/threads/{thread_id}/messages/{message_id}` - -Deletes a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Returns - -- `MessageDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.message.deleted"` - - - `"thread.message.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "thread.message.deleted" -} -``` - -### Example - -```http -curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message.deleted", - "deleted": true -} -``` - -## List messages - -**get** `/threads/{thread_id}/messages` - -Returns a list of messages for a given thread. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -- `run_id: optional string` - - Filter messages by the run ID that generated them. - -### Returns - -- `data: array of Message` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" - } - ], - "first_id": "msg_abc123", - "has_more": false, - "last_id": "msg_abc123", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699016383, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} - }, - { - "id": "msg_abc456", - "object": "thread.message", - "created_at": 1699016383, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "Hello, what is AI?", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} - } - ], - "first_id": "msg_abc123", - "last_id": "msg_abc456", - "has_more": false -} -``` - -## Retrieve message - -**get** `/threads/{thread_id}/messages/{message_id}` - -Retrieve a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699017614, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} -} -``` - -## Modify message - -**post** `/threads/{thread_id}/messages/{message_id}` - -Modifies a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "modified": "true", - "user": "abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699017614, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "file_ids": [], - "metadata": { - "modified": "true", - "user": "abc123" - } -} -``` - -## Domain Types - -### File Citation Annotation - -- `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - -### File Citation Delta Annotation - -- `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - -### File Path Annotation - -- `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - -### File Path Delta Annotation - -- `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - -### Image File - -- `ImageFile object { file_id, detail }` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - -### Image File Content Block - -- `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - -### Image File Delta - -- `ImageFileDelta object { detail, file_id }` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - -### Image File Delta Block - -- `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - -### Image URL - -- `ImageURL object { url, detail }` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - -### Image URL Content Block - -- `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - -### Image URL Delta - -- `ImageURLDelta object { detail, url }` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - -### Image URL Delta Block - -- `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - -### Message - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Message Deleted - -- `MessageDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.message.deleted"` - - - `"thread.message.deleted"` - -### Message Delta - -- `MessageDelta object { content, role }` - - The delta containing the fields that have changed on the Message. - - - `content: optional array of ImageFileDeltaBlock or TextDeltaBlock or RefusalDeltaBlock or ImageURLDeltaBlock` - - The content of the message in array of text and/or images. - - - `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - - - `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - - - `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `role: optional "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - -### Message Delta Event - -- `MessageDeltaEvent object { id, delta, object }` - - Represents a message delta i.e. any changed fields on a message during streaming. - - - `id: string` - - The identifier of the message, which can be referenced in API endpoints. - - - `delta: MessageDelta` - - The delta containing the fields that have changed on the Message. - - - `content: optional array of ImageFileDeltaBlock or TextDeltaBlock or RefusalDeltaBlock or ImageURLDeltaBlock` - - The content of the message in array of text and/or images. - - - `ImageFileDeltaBlock object { index, type, image_file }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `image_file: optional ImageFileDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_id: optional string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - - - `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - - - `ImageURLDeltaBlock object { index, type, image_url }` - - References an image URL in the content of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "image_url"` - - Always `image_url`. - - - `"image_url"` - - - `image_url: optional ImageURLDelta` - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `url: optional string` - - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `role: optional "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `object: "thread.message.delta"` - - The object type, which is always `thread.message.delta`. - - - `"thread.message.delta"` - -### Refusal Content Block - -- `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - -### Refusal Delta Block - -- `RefusalDeltaBlock object { index, type, refusal }` - - The refusal content that is part of a message. - - - `index: number` - - The index of the refusal part in the message. - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `refusal: optional string` - -### Text - -- `Text object { annotations, value }` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - -### Text Content Block - -- `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - -### Text Content Block Param - -- `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - -### Text Delta - -- `TextDelta object { annotations, value }` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. - -### Text Delta Block - -- `TextDeltaBlock object { index, type, text }` - - The text content that is part of a message. - - - `index: number` - - The index of the content part in the message. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `text: optional TextDelta` - - - `annotations: optional array of FileCitationDeltaAnnotation or FilePathDeltaAnnotation` - - - `FileCitationDeltaAnnotation object { index, type, end_index, 3 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `end_index: optional number` - - - `file_citation: optional object { file_id, quote }` - - - `file_id: optional string` - - The ID of the specific File the citation is from. - - - `quote: optional string` - - The specific quote in the file. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `FilePathDeltaAnnotation object { index, type, end_index, 3 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `index: number` - - The index of the annotation in the text content part. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `end_index: optional number` - - - `file_path: optional object { file_id }` - - - `file_id: optional string` - - The ID of the file that was generated. - - - `start_index: optional number` - - - `text: optional string` - - The text in the message content that needs to be replaced. - - - `value: optional string` - - The data that makes up the text. diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md deleted file mode 100644 index 42aab71..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md +++ /dev/null @@ -1,479 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create message - -**post** `/threads/{thread_id}/messages` - -Create a message. - -### Path Parameters - -- `thread_id: string` - -### Body Parameters - -- `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - -- `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - -- `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "content": "string", - "role": "user" - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "role": "user", - "content": "How does AI work? Explain it in simple terms." - }' -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1713226573, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md deleted file mode 100644 index 197aeb3..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md +++ /dev/null @@ -1,63 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Delete message - -**delete** `/threads/{thread_id}/messages/{message_id}` - -Deletes a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Returns - -- `MessageDeleted object { id, deleted, object }` - - - `id: string` - - - `deleted: boolean` - - - `object: "thread.message.deleted"` - - - `"thread.message.deleted"` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -X DELETE \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "deleted": true, - "object": "thread.message.deleted" -} -``` - -### Example - -```http -curl -X DELETE https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message.deleted", - "deleted": true -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md deleted file mode 100644 index ee2d08c..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md +++ /dev/null @@ -1,410 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## List messages - -**get** `/threads/{thread_id}/messages` - -Returns a list of messages for a given thread. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -- `run_id: optional string` - - Filter messages by the run ID that generated them. - -### Returns - -- `data: array of Message` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" - } - ], - "first_id": "msg_abc123", - "has_more": false, - "last_id": "msg_abc123", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699016383, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} - }, - { - "id": "msg_abc456", - "object": "thread.message", - "created_at": 1699016383, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "Hello, what is AI?", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} - } - ], - "first_id": "msg_abc123", - "last_id": "msg_abc456", - "has_more": false -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md deleted file mode 100644 index ee48130..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md +++ /dev/null @@ -1,344 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Retrieve message - -**get** `/threads/{thread_id}/messages/{message_id}` - -Retrieve a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699017614, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "attachments": [], - "metadata": {} -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md deleted file mode 100644 index b330cc6..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md +++ /dev/null @@ -1,366 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Modify message - -**post** `/threads/{thread_id}/messages/{message_id}` - -Modifies a message. - -### Path Parameters - -- `thread_id: string` - -- `message_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Message object { id, assistant_id, attachments, 11 more }` - - Represents a message within a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string or null` - - If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message. - - - `attachments: array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they were added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the message was completed. - - - `content: array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlock or RefusalContentBlock` - - The content of the message in array of text and/or images. - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlock object { text, type }` - - The text content that is part of a message. - - - `text: Text` - - - `annotations: array of FileCitationAnnotation or FilePathAnnotation` - - - `FileCitationAnnotation object { end_index, file_citation, start_index, 2 more }` - - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - - `end_index: number` - - - `file_citation: object { file_id }` - - - `file_id: string` - - The ID of the specific File the citation is from. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_citation"` - - Always `file_citation`. - - - `"file_citation"` - - - `FilePathAnnotation object { end_index, file_path, start_index, 2 more }` - - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - - `end_index: number` - - - `file_path: object { file_id }` - - - `file_id: string` - - The ID of the file that was generated. - - - `start_index: number` - - - `text: string` - - The text in the message content that needs to be replaced. - - - `type: "file_path"` - - Always `file_path`. - - - `"file_path"` - - - `value: string` - - The data that makes up the text. - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `RefusalContentBlock object { refusal, type }` - - The refusal content generated by the assistant. - - - `refusal: string` - - - `type: "refusal"` - - Always `refusal`. - - - `"refusal"` - - - `created_at: number` - - The Unix timestamp (in seconds) for when the message was created. - - - `incomplete_at: number or null` - - The Unix timestamp (in seconds) for when the message was marked as incomplete. - - - `incomplete_details: object { reason } or null` - - On an incomplete message, details about why the message is incomplete. - - - `reason: "content_filter" or "max_tokens" or "run_cancelled" or 2 more` - - The reason the message is incomplete. - - - `"content_filter"` - - - `"max_tokens"` - - - `"run_cancelled"` - - - `"run_expired"` - - - `"run_failed"` - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.message"` - - The object type, which is always `thread.message`. - - - `"thread.message"` - - - `role: "user" or "assistant"` - - The entity that produced the message. One of `user` or `assistant`. - - - `"user"` - - - `"assistant"` - - - `run_id: string or null` - - The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - - `status: "in_progress" or "incomplete" or "completed"` - - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - - `"in_progress"` - - - `"incomplete"` - - - `"completed"` - - - `thread_id: string` - - The [thread](/docs/api-reference/threads) ID that this message belongs to. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/messages/$MESSAGE_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - { - "image_file": { - "file_id": "file_id", - "detail": "auto" - }, - "type": "image_file" - } - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/messages/msg_abc123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "modified": "true", - "user": "abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1699017614, - "assistant_id": null, - "thread_id": "thread_abc123", - "run_id": null, - "role": "user", - "content": [ - { - "type": "text", - "text": { - "value": "How does AI work? Explain it in simple terms.", - "annotations": [] - } - } - ], - "file_ids": [], - "metadata": { - "modified": "true", - "user": "abc123" - } -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs.md deleted file mode 100644 index 3d1e940..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs.md +++ /dev/null @@ -1,6510 +0,0 @@ -# Runs - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Cancel a run - -**post** `/threads/{thread_id}/runs/{run_id}/cancel` - -Cancels a run that is `in_progress`. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/cancel \ - -X POST \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X POST -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699076126, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "cancelling", - "started_at": 1699076126, - "expires_at": 1699076726, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "last_error": null, - "model": "gpt-4o", - "instructions": "You summarize books.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": ["vs_123"] - } - }, - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -## Create run - -**post** `/threads/{thread_id}/runs` - -Create a run. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Body Parameters - -- `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. - -- `additional_instructions: optional string or null` - - Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - -- `additional_messages: optional array of object { content, role, attachments, metadata } or null` - - Adds additional messages to the thread before creating the run. - - - `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - - - `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `instructions: optional string or null` - - Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - -- `max_completion_tokens: optional number or null` - - The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `max_prompt_tokens: optional number or null` - - The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `model: optional string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more or null` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `parallel_tool_calls: optional boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_choice: optional AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool or null` - - Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - - - `CodeInterpreterTool object { type }` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -- `truncation_strategy: optional object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "assistant_id": "assistant_id", - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123" - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699063290, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "queued", - "started_at": 1699063290, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699063291, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/thread_123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_123", - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710330641,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710330642,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710330642,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710330641,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710330642,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -### Streaming with Functions - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123", - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710348075,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710348075,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710348077,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -## List runs - -**get** `/threads/{thread_id}/runs` - -Returns a list of runs belonging to a thread. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of Run` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 - } - ], - "first_id": "run_abc123", - "has_more": false, - "last_id": "run_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - }, - { - "id": "run_abc456", - "object": "thread.run", - "created_at": 1699063290, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699063290, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699063291, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - } - ], - "first_id": "run_abc123", - "last_id": "run_abc456", - "has_more": false -} -``` - -## Retrieve run - -**get** `/threads/{thread_id}/runs/{run_id}` - -Retrieves a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -## Submit tool outputs to run - -**post** `/threads/{thread_id}/runs/{run_id}/submit_tool_outputs` - -When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Body Parameters - -- `tool_outputs: array of object { output, tool_call_id }` - - A list of tools for which the outputs are being submitted. - - - `output: optional string` - - The output of the tool call to be submitted to continue the run. - - - `tool_call_id: optional string` - - The ID of the tool call in the `required_action` object within the run object the output is being submitted for. - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/submit_tool_outputs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "tool_outputs": [ - {} - ] - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "tool_outputs": [ - { - "tool_call_id": "call_001", - "output": "70 degrees and sunny." - } - ] - }' -``` - -#### Response - -```json -{ - "id": "run_123", - "object": "thread.run", - "created_at": 1699075592, - "assistant_id": "asst_123", - "thread_id": "thread_123", - "status": "queued", - "started_at": 1699075592, - "expires_at": 1699076192, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "tool_outputs": [ - { - "tool_call_id": "call_001", - "output": "70 degrees and sunny." - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710352449,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1710352475,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_iWr0kQ2EaYMaxNdl0v3KYkx7","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}","output":"70 degrees and sunny."}}]},"usage":{"prompt_tokens":291,"completion_tokens":24,"total_tokens":315}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":1710352448,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710352475,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"The","annotations":[]}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" current"}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" weather"}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" sunny"}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"."}}]}} - -event: thread.message.completed -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710352477,"role":"assistant","content":[{"type":"text","text":{"value":"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710352477,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":{"prompt_tokens":329,"completion_tokens":18,"total_tokens":347}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710352475,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710352477,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -## Modify run - -**post** `/threads/{thread_id}/runs/{run_id}` - -Modifies a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "user_id": "user_abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": { - "user_id": "user_abc123" - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -## Domain Types - -### Required Action Function Tool Call - -- `RequiredActionFunctionToolCall object { id, function, type }` - - Tool call objects - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - -### Run - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -# Steps - -## List run steps - -**get** `/threads/{thread_id}/runs/{run_id}/steps` - -Returns a list of run steps belonging to a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of RunStep` - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } - } - ], - "first_id": "step_abc123", - "has_more": false, - "last_id": "step_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } - } - ], - "first_id": "step_abc123", - "last_id": "step_abc456", - "has_more": false -} -``` - -## Retrieve run step - -**get** `/threads/{thread_id}/runs/{run_id}/steps/{step_id}` - -Retrieves a run step. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -- `step_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Returns - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps/$STEP_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } -} -``` - -## Domain Types - -### Code Interpreter Logs - -- `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - -### Code Interpreter Output Image - -- `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - -### Code Interpreter Tool Call - -- `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - -### Code Interpreter Tool Call Delta - -- `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - -### File Search Tool Call - -- `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - -### File Search Tool Call Delta - -- `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - -### Function Tool Call - -- `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - -### Function Tool Call Delta - -- `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - -### Message Creation Step Details - -- `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - -### Run Step - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Run Step Delta Event - -- `RunStepDeltaEvent object { id, delta, object }` - - Represents a run step delta i.e. any changed fields on a run step during streaming. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `delta: object { step_details }` - - The delta containing the fields that have changed on the run step. - - - `step_details: optional RunStepDeltaMessageDelta or ToolCallDeltaObject` - - The details of the run step. - - - `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - - - `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `object: "thread.run.step.delta"` - - The object type, which is always `thread.run.step.delta`. - - - `"thread.run.step.delta"` - -### Run Step Delta Message Delta - -- `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - -### Run Step Include - -- `RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Tool Call Delta Object - -- `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - -### Tool Calls Step Details - -- `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md deleted file mode 100644 index b408ef1..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md +++ /dev/null @@ -1,535 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Cancel a run - -**post** `/threads/{thread_id}/runs/{run_id}/cancel` - -Cancels a run that is `in_progress`. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/cancel \ - -X POST \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/cancel \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" \ - -X POST -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699076126, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "cancelling", - "started_at": 1699076126, - "expires_at": 1699076726, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "last_error": null, - "model": "gpt-4o", - "instructions": "You summarize books.", - "tools": [ - { - "type": "file_search" - } - ], - "tool_resources": { - "file_search": { - "vector_store_ids": ["vs_123"] - } - }, - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md deleted file mode 100644 index 89f0bd1..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md +++ /dev/null @@ -1,1196 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Create run - -**post** `/threads/{thread_id}/runs` - -Create a run. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Body Parameters - -- `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) to use to execute this run. - -- `additional_instructions: optional string or null` - - Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - -- `additional_messages: optional array of object { content, role, attachments, metadata } or null` - - Adds additional messages to the thread before creating the run. - - - `content: string or array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - The text contents of the message. - - - `TextContent = string` - - The text contents of the message. - - - `ArrayOfContentParts = array of ImageFileContentBlock or ImageURLContentBlock or TextContentBlockParam` - - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](/docs/models). - - - `ImageFileContentBlock object { image_file, type }` - - References an image [File](/docs/api-reference/files) in the content of a message. - - - `image_file: ImageFile` - - - `file_id: string` - - The [File](/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_file"` - - Always `image_file`. - - - `"image_file"` - - - `ImageURLContentBlock object { image_url, type }` - - References an image URL in the content of a message. - - - `image_url: ImageURL` - - - `url: string` - - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - - `detail: optional "auto" or "low" or "high"` - - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - - `"auto"` - - - `"low"` - - - `"high"` - - - `type: "image_url"` - - The type of the content part. - - - `"image_url"` - - - `TextContentBlockParam object { text, type }` - - The text content that is part of a message. - - - `text: string` - - Text content to be sent to the model - - - `type: "text"` - - Always `text`. - - - `"text"` - - - `role: "user" or "assistant"` - - The role of the entity that is creating the message. Allowed values include: - - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - - `"user"` - - - `"assistant"` - - - `attachments: optional array of object { file_id, tools } or null` - - A list of files attached to the message, and the tools they should be added to. - - - `file_id: optional string` - - The ID of the file to attach to the message. - - - `tools: optional array of CodeInterpreterTool or object { type }` - - The tools to add this file to. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `instructions: optional string or null` - - Overrides the [instructions](/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - -- `max_completion_tokens: optional number or null` - - The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `max_prompt_tokens: optional number or null` - - The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -- `model: optional string or "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more or null` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `string` - - - `AssistantSupportedModels = "gpt-5" or "gpt-5-mini" or "gpt-5-nano" or 39 more` - - The ID of the [Model](/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - - `"gpt-5"` - - - `"gpt-5-mini"` - - - `"gpt-5-nano"` - - - `"gpt-5-2025-08-07"` - - - `"gpt-5-mini-2025-08-07"` - - - `"gpt-5-nano-2025-08-07"` - - - `"gpt-4.1"` - - - `"gpt-4.1-mini"` - - - `"gpt-4.1-nano"` - - - `"gpt-4.1-2025-04-14"` - - - `"gpt-4.1-mini-2025-04-14"` - - - `"gpt-4.1-nano-2025-04-14"` - - - `"o3-mini"` - - - `"o3-mini-2025-01-31"` - - - `"o1"` - - - `"o1-2024-12-17"` - - - `"gpt-4o"` - - - `"gpt-4o-2024-11-20"` - - - `"gpt-4o-2024-08-06"` - - - `"gpt-4o-2024-05-13"` - - - `"gpt-4o-mini"` - - - `"gpt-4o-mini-2024-07-18"` - - - `"gpt-4.5-preview"` - - - `"gpt-4.5-preview-2025-02-27"` - - - `"gpt-4-turbo"` - - - `"gpt-4-turbo-2024-04-09"` - - - `"gpt-4-0125-preview"` - - - `"gpt-4-turbo-preview"` - - - `"gpt-4-1106-preview"` - - - `"gpt-4-vision-preview"` - - - `"gpt-4"` - - - `"gpt-4-0314"` - - - `"gpt-4-0613"` - - - `"gpt-4-32k"` - - - `"gpt-4-32k-0314"` - - - `"gpt-4-32k-0613"` - - - `"gpt-3.5-turbo"` - - - `"gpt-3.5-turbo-16k"` - - - `"gpt-3.5-turbo-0613"` - - - `"gpt-3.5-turbo-1106"` - - - `"gpt-3.5-turbo-0125"` - - - `"gpt-3.5-turbo-16k-0613"` - -- `parallel_tool_calls: optional boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - -- `reasoning_effort: optional ReasoningEffort or null` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - -- `response_format: optional AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -- `temperature: optional number or null` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - -- `tool_choice: optional AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - -- `tools: optional array of CodeInterpreterTool or FileSearchTool or FunctionTool or null` - - Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - - - `CodeInterpreterTool object { type }` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - -- `top_p: optional number or null` - - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - We generally recommend altering this or temperature but not both. - -- `truncation_strategy: optional object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "assistant_id": "assistant_id", - "temperature": 1, - "top_p": 1 - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123" - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699063290, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "queued", - "started_at": 1699063290, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699063291, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/thread_123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_123", - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710330641,"expires_at":1710331240,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710330641,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710330642,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710330641,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710330642,"expires_at":1710331240,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710330640,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710330641,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710330642,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` - -### Streaming with Functions - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "assistant_id": "asst_abc123", - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.created -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":null,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710348075,"expires_at":1710348675,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} - -event: thread.message.delta -data: {"id":"msg_001","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} - -event: thread.message.completed -data: {"id":"msg_001","object":"thread.message","created_at":1710348076,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710348077,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710348076,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710348077,"expires_at":1710348675,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_001"}},"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710348075,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710348075,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710348077,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md deleted file mode 100644 index 03ad807..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md +++ /dev/null @@ -1,637 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## List runs - -**get** `/threads/{thread_id}/runs` - -Returns a list of runs belonging to a thread. - -### Path Parameters - -- `thread_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of Run` - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 - } - ], - "first_id": "run_abc123", - "has_more": false, - "last_id": "run_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - }, - { - "id": "run_abc456", - "object": "thread.run", - "created_at": 1699063290, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699063290, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699063291, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - } - ], - "first_id": "run_abc123", - "last_id": "run_abc456", - "has_more": false -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md deleted file mode 100644 index 277bdc9..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md +++ /dev/null @@ -1,539 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Retrieve run - -**get** `/threads/{thread_id}/runs/{run_id}` - -Retrieves a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "metadata": {}, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md deleted file mode 100644 index 91166e7..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md +++ /dev/null @@ -1,657 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Submit tool outputs to run - -**post** `/threads/{thread_id}/runs/{run_id}/submit_tool_outputs` - -When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Body Parameters - -- `tool_outputs: array of object { output, tool_call_id }` - - A list of tools for which the outputs are being submitted. - - - `output: optional string` - - The output of the tool call to be submitted to continue the run. - - - `tool_call_id: optional string` - - The ID of the tool call in the `required_action` object within the run object the output is being submitted for. - -- `stream: optional boolean or null` - - If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/submit_tool_outputs \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "tool_outputs": [ - {} - ] - }' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "tool_outputs": [ - { - "tool_call_id": "call_001", - "output": "70 degrees and sunny." - } - ] - }' -``` - -#### Response - -```json -{ - "id": "run_123", - "object": "thread.run", - "created_at": 1699075592, - "assistant_id": "asst_123", - "thread_id": "thread_123", - "status": "queued", - "started_at": 1699075592, - "expires_at": 1699076192, - "cancelled_at": null, - "failed_at": null, - "completed_at": null, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "tools": [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location"] - } - } - } - ], - "metadata": {}, - "usage": null, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/threads/thread_123/runs/run_123/submit_tool_outputs \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "tool_outputs": [ - { - "tool_call_id": "call_001", - "output": "70 degrees and sunny." - } - ], - "stream": true - }' -``` - -#### Response - -```json -event: thread.run.step.completed -data: {"id":"step_001","object":"thread.run.step","created_at":1710352449,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"tool_calls","status":"completed","cancelled_at":null,"completed_at":1710352475,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"tool_calls","tool_calls":[{"id":"call_iWr0kQ2EaYMaxNdl0v3KYkx7","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\":\"San Francisco, CA\",\"unit\":\"fahrenheit\"}","output":"70 degrees and sunny."}}]},"usage":{"prompt_tokens":291,"completion_tokens":24,"total_tokens":315}} - -event: thread.run.queued -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"queued","started_at":1710352448,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.in_progress -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"in_progress","started_at":1710352475,"expires_at":1710353047,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: thread.run.step.created -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null} - -event: thread.run.step.in_progress -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":null} - -event: thread.message.created -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.in_progress -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"metadata":{}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"The","annotations":[]}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" current"}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" weather"}}]}} - -... - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" sunny"}}]}} - -event: thread.message.delta -data: {"id":"msg_002","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"."}}]}} - -event: thread.message.completed -data: {"id":"msg_002","object":"thread.message","created_at":1710352476,"assistant_id":"asst_123","thread_id":"thread_123","run_id":"run_123","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1710352477,"role":"assistant","content":[{"type":"text","text":{"value":"The current weather in San Francisco, CA is 70 degrees Fahrenheit and sunny.","annotations":[]}}],"metadata":{}} - -event: thread.run.step.completed -data: {"id":"step_002","object":"thread.run.step","created_at":1710352476,"run_id":"run_123","assistant_id":"asst_123","thread_id":"thread_123","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1710352477,"expires_at":1710353047,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_002"}},"usage":{"prompt_tokens":329,"completion_tokens":18,"total_tokens":347}} - -event: thread.run.completed -data: {"id":"run_123","object":"thread.run","created_at":1710352447,"assistant_id":"asst_123","thread_id":"thread_123","status":"completed","started_at":1710352475,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1710352477,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":null,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"unit":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location"]}}}],"metadata":{},"temperature":1.0,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":20,"completion_tokens":11,"total_tokens":31},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true}} - -event: done -data: [DONE] -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md deleted file mode 100644 index 0251ec8..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md +++ /dev/null @@ -1,568 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Modify run - -**post** `/threads/{thread_id}/runs/{run_id}` - -Modifies a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Body Parameters - -- `metadata: optional Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - -### Returns - -- `Run object { id, assistant_id, cancelled_at, 24 more }` - - Represents an execution run on a [thread](/docs/api-reference/threads). - - - `id: string` - - The identifier, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) used for execution of this run. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run was completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run was created. - - - `expires_at: number or null` - - The Unix timestamp (in seconds) for when the run will expire. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run failed. - - - `incomplete_details: object { reason } or null` - - Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - - `reason: optional "max_completion_tokens" or "max_prompt_tokens"` - - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - - `"max_completion_tokens"` - - - `"max_prompt_tokens"` - - - `instructions: string` - - The instructions that the [assistant](/docs/api-reference/assistants) used for this run. - - - `last_error: object { code, message } or null` - - The last error associated with this run. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt"` - - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `message: string` - - A human-readable description of the error. - - - `max_completion_tokens: number or null` - - The maximum number of completion tokens specified to have been used over the course of the run. - - - `max_prompt_tokens: number or null` - - The maximum number of prompt tokens specified to have been used over the course of the run. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `model: string` - - The model that the [assistant](/docs/api-reference/assistants) used for this run. - - - `object: "thread.run"` - - The object type, which is always `thread.run`. - - - `"thread.run"` - - - `parallel_tool_calls: boolean` - - Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - - `required_action: object { submit_tool_outputs, type } or null` - - Details on the action required to continue the run. Will be `null` if no action is required. - - - `submit_tool_outputs: object { tool_calls }` - - Details on the tool outputs needed for this run to continue. - - - `tool_calls: array of RequiredActionFunctionToolCall` - - A list of the relevant tool calls. - - - `id: string` - - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](/docs/api-reference/runs/submitToolOutputs) endpoint. - - - `function: object { arguments, name }` - - The function definition. - - - `arguments: string` - - The arguments that the model expects you to pass to the function. - - - `name: string` - - The name of the function. - - - `type: "function"` - - The type of tool call the output is required for. For now, this is always `function`. - - - `"function"` - - - `type: "submit_tool_outputs"` - - For now, this is always `submit_tool_outputs`. - - - `"submit_tool_outputs"` - - - `response_format: AssistantResponseFormatOption or null` - - Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models#gpt-4o), [GPT-4 Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - - `"auto"` - - `auto` is the default value - - - `"auto"` - - - `ResponseFormatText object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `ResponseFormatJSONObject object { type }` - - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - - - `type: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `ResponseFormatJSONSchema object { json_schema, type }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `json_schema: object { name, description, schema, strict }` - - Structured Outputs configuration options, including a JSON Schema. - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `schema: optional map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `started_at: number or null` - - The Unix timestamp (in seconds) for when the run was started. - - - `status: "queued" or "in_progress" or "requires_action" or 6 more` - - The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - - `"queued"` - - - `"in_progress"` - - - `"requires_action"` - - - `"cancelling"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"incomplete"` - - - `"expired"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was executed on as a part of this run. - - - `tool_choice: AssistantToolChoiceOption or null` - - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - - `"none" or "auto" or "required"` - - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `AssistantToolChoice object { type, function }` - - Specifies a tool the model should use. Use to force the model to call a specific tool. - - - `type: "function" or "code_interpreter" or "file_search"` - - The type of the tool. If type is `function`, the function name must be set - - - `"function"` - - - `"code_interpreter"` - - - `"file_search"` - - - `function: optional AssistantToolChoiceFunction` - - - `name: string` - - The name of the function to call. - - - `tools: array of CodeInterpreterTool or FileSearchTool or FunctionTool` - - The list of tools that the [assistant](/docs/api-reference/assistants) used for this run. - - - `CodeInterpreterTool object { type }` - - - `type: "code_interpreter"` - - The type of tool being defined: `code_interpreter` - - - `"code_interpreter"` - - - `FileSearchTool object { type, file_search }` - - - `type: "file_search"` - - The type of tool being defined: `file_search` - - - `"file_search"` - - - `file_search: optional object { max_num_results, ranking_options }` - - Overrides for the file search tool. - - - `max_num_results: optional number` - - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `ranking_options: optional object { score_threshold, ranker }` - - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `ranker: optional "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `FunctionTool object { function, type }` - - - `function: FunctionDefinition` - - - `name: string` - - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - - `description: optional string` - - A description of what the function does, used by the model to choose when and how to call the function. - - - `parameters: optional FunctionParameters` - - The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - - - `strict: optional boolean or null` - - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling). - - - `type: "function"` - - The type of tool being defined: `function` - - - `"function"` - - - `truncation_strategy: object { type, last_messages } or null` - - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - - `type: "auto" or "last_messages"` - - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - - `"auto"` - - - `"last_messages"` - - - `last_messages: optional number or null` - - The number of most recent messages from the thread when constructing the context for the run. - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - - - `temperature: optional number or null` - - The sampling temperature used for this run. If not set, defaults to 1. - - - `top_p: optional number or null` - - The nucleus sampling value used for this run. If not set, defaults to 1. - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID \ - -H 'Content-Type: application/json' \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{}' -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": "queued", - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - { - "type": "code_interpreter" - } - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" \ - -d '{ - "metadata": { - "user_id": "user_abc123" - } - }' -``` - -#### Response - -```json -{ - "id": "run_abc123", - "object": "thread.run", - "created_at": 1699075072, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699075072, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699075073, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "incomplete_details": null, - "tools": [ - { - "type": "code_interpreter" - } - ], - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "file-abc123", - "file-abc456" - ] - } - }, - "metadata": { - "user_id": "user_abc123" - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md deleted file mode 100644 index a5945ac..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md +++ /dev/null @@ -1,1952 +0,0 @@ -# Steps - -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## List run steps - -**get** `/threads/{thread_id}/runs/{run_id}/steps` - -Returns a list of run steps belonging to a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of RunStep` - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } - } - ], - "first_id": "step_abc123", - "has_more": false, - "last_id": "step_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } - } - ], - "first_id": "step_abc123", - "last_id": "step_abc456", - "has_more": false -} -``` - -## Retrieve run step - -**get** `/threads/{thread_id}/runs/{run_id}/steps/{step_id}` - -Retrieves a run step. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -- `step_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Returns - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps/$STEP_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } -} -``` - -## Domain Types - -### Code Interpreter Logs - -- `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - -### Code Interpreter Output Image - -- `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - -### Code Interpreter Tool Call - -- `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - -### Code Interpreter Tool Call Delta - -- `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - -### File Search Tool Call - -- `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - -### File Search Tool Call Delta - -- `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - -### Function Tool Call - -- `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - -### Function Tool Call Delta - -- `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - -### Message Creation Step Details - -- `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - -### Run Step - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Run Step Delta Event - -- `RunStepDeltaEvent object { id, delta, object }` - - Represents a run step delta i.e. any changed fields on a run step during streaming. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `delta: object { step_details }` - - The delta containing the fields that have changed on the run step. - - - `step_details: optional RunStepDeltaMessageDelta or ToolCallDeltaObject` - - The details of the run step. - - - `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - - - `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `object: "thread.run.step.delta"` - - The object type, which is always `thread.run.step.delta`. - - - `"thread.run.step.delta"` - -### Run Step Delta Message Delta - -- `RunStepDeltaMessageDelta object { type, message_creation }` - - Details of the message creation by the run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `message_creation: optional object { message_id }` - - - `message_id: optional string` - - The ID of the message that was created by this run step. - -### Run Step Include - -- `RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Tool Call Delta Object - -- `ToolCallDeltaObject object { type, tool_calls }` - - Details of the tool call. - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `tool_calls: optional array of CodeInterpreterToolCallDelta or FileSearchToolCallDelta or FunctionToolCallDelta` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCallDelta object { index, type, id, code_interpreter }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `id: optional string` - - The ID of the tool call. - - - `code_interpreter: optional object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: optional string` - - The input to the Code Interpreter tool call. - - - `outputs: optional array of CodeInterpreterLogs or CodeInterpreterOutputImage` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogs object { index, type, logs }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `index: number` - - The index of the output in the outputs array. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `logs: optional string` - - The text output from the Code Interpreter tool call. - - - `CodeInterpreterOutputImage object { index, type, image }` - - - `index: number` - - The index of the output in the outputs array. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `image: optional object { file_id }` - - - `file_id: optional string` - - The [file](/docs/api-reference/files) ID of the image. - - - `FileSearchToolCallDelta object { file_search, index, type, id }` - - - `file_search: unknown` - - For now, this is always going to be an empty object. - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `id: optional string` - - The ID of the tool call object. - - - `FunctionToolCallDelta object { index, type, id, function }` - - - `index: number` - - The index of the tool call in the tool calls array. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `id: optional string` - - The ID of the tool call object. - - - `function: optional object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: optional string` - - The arguments passed to the function. - - - `name: optional string` - - The name of the function. - - - `output: optional string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - -### Tool Calls Step Details - -- `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md deleted file mode 100644 index eb15353..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md +++ /dev/null @@ -1,439 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## List run steps - -**get** `/threads/{thread_id}/runs/{run_id}/steps` - -Returns a list of run steps belonging to a run. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -### Query Parameters - -- `after: optional string` - - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - -- `before: optional string` - - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -- `limit: optional number` - - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - -- `order: optional "asc" or "desc"` - - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - - `"asc"` - - - `"desc"` - -### Returns - -- `data: array of RunStep` - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -- `first_id: string` - -- `has_more: boolean` - -- `last_id: string` - -- `object: string` - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } - } - ], - "first_id": "step_abc123", - "has_more": false, - "last_id": "step_abc456", - "object": "list" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "object": "list", - "data": [ - { - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } - } - ], - "first_id": "step_abc123", - "last_id": "step_abc456", - "has_more": false -} -``` diff --git a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md b/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md deleted file mode 100644 index e3efdfc..0000000 --- a/docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md +++ /dev/null @@ -1,399 +0,0 @@ -> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. - -## Retrieve run step - -**get** `/threads/{thread_id}/runs/{run_id}/steps/{step_id}` - -Retrieves a run step. - -### Path Parameters - -- `thread_id: string` - -- `run_id: string` - -- `step_id: string` - -### Query Parameters - -- `include: optional array of RunStepInclude` - - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - - `"step_details.tool_calls[*].file_search.results[*].content"` - -### Returns - -- `RunStep object { id, assistant_id, cancelled_at, 13 more }` - - Represents a step in execution of a run. - - - `id: string` - - The identifier of the run step, which can be referenced in API endpoints. - - - `assistant_id: string` - - The ID of the [assistant](/docs/api-reference/assistants) associated with the run step. - - - `cancelled_at: number or null` - - The Unix timestamp (in seconds) for when the run step was cancelled. - - - `completed_at: number or null` - - The Unix timestamp (in seconds) for when the run step completed. - - - `created_at: number` - - The Unix timestamp (in seconds) for when the run step was created. - - - `expired_at: number or null` - - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - - `failed_at: number or null` - - The Unix timestamp (in seconds) for when the run step failed. - - - `last_error: object { code, message } or null` - - The last error associated with this run step. Will be `null` if there are no errors. - - - `code: "server_error" or "rate_limit_exceeded"` - - One of `server_error` or `rate_limit_exceeded`. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `message: string` - - A human-readable description of the error. - - - `metadata: Metadata or null` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `object: "thread.run.step"` - - The object type, which is always `thread.run.step`. - - - `"thread.run.step"` - - - `run_id: string` - - The ID of the [run](/docs/api-reference/runs) that this run step is a part of. - - - `status: "in_progress" or "cancelled" or "failed" or 2 more` - - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - - `"in_progress"` - - - `"cancelled"` - - - `"failed"` - - - `"completed"` - - - `"expired"` - - - `step_details: MessageCreationStepDetails or ToolCallsStepDetails` - - The details of the run step. - - - `MessageCreationStepDetails object { message_creation, type }` - - Details of the message creation by the run step. - - - `message_creation: object { message_id }` - - - `message_id: string` - - The ID of the message that was created by this run step. - - - `type: "message_creation"` - - Always `message_creation`. - - - `"message_creation"` - - - `ToolCallsStepDetails object { tool_calls, type }` - - Details of the tool call. - - - `tool_calls: array of CodeInterpreterToolCall or FileSearchToolCall or FunctionToolCall` - - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - - `CodeInterpreterToolCall object { id, code_interpreter, type }` - - Details of the Code Interpreter tool call the run step was involved in. - - - `id: string` - - The ID of the tool call. - - - `code_interpreter: object { input, outputs }` - - The Code Interpreter tool call definition. - - - `input: string` - - The input to the Code Interpreter tool call. - - - `outputs: array of object { logs, type } or object { image, type }` - - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - - `CodeInterpreterLogOutput object { logs, type }` - - Text output from the Code Interpreter tool call as part of a run step. - - - `logs: string` - - The text output from the Code Interpreter tool call. - - - `type: "logs"` - - Always `logs`. - - - `"logs"` - - - `CodeInterpreterImageOutput object { image, type }` - - - `image: object { file_id }` - - - `file_id: string` - - The [file](/docs/api-reference/files) ID of the image. - - - `type: "image"` - - Always `image`. - - - `"image"` - - - `type: "code_interpreter"` - - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - - `"code_interpreter"` - - - `FileSearchToolCall object { id, file_search, type }` - - - `id: string` - - The ID of the tool call object. - - - `file_search: object { ranking_options, results }` - - For now, this is always going to be an empty object. - - - `ranking_options: optional object { ranker, score_threshold }` - - The ranking options for the file search. - - - `ranker: "auto" or "default_2024_08_21"` - - The ranker to use for the file search. If not specified will use the `auto` ranker. - - - `"auto"` - - - `"default_2024_08_21"` - - - `score_threshold: number` - - The score threshold for the file search. All values must be a floating point number between 0 and 1. - - - `results: optional array of object { file_id, file_name, score, content }` - - The results of the file search. - - - `file_id: string` - - The ID of the file that result was found in. - - - `file_name: string` - - The name of the file that result was found in. - - - `score: number` - - The score of the result. All values must be a floating point number between 0 and 1. - - - `content: optional array of object { text, type }` - - The content of the result that was found. The content is only included if requested via the include query parameter. - - - `text: optional string` - - The text content of the file. - - - `type: optional "text"` - - The type of the content. - - - `"text"` - - - `type: "file_search"` - - The type of tool call. This is always going to be `file_search` for this type of tool call. - - - `"file_search"` - - - `FunctionToolCall object { id, function, type }` - - - `id: string` - - The ID of the tool call object. - - - `function: object { arguments, name, output }` - - The definition of the function that was called. - - - `arguments: string` - - The arguments passed to the function. - - - `name: string` - - The name of the function. - - - `output: string or null` - - The output of the function. This will be `null` if the outputs have not been [submitted](/docs/api-reference/runs/submitToolOutputs) yet. - - - `type: "function"` - - The type of tool call. This is always going to be `function` for this type of tool call. - - - `"function"` - - - `type: "tool_calls"` - - Always `tool_calls`. - - - `"tool_calls"` - - - `thread_id: string` - - The ID of the [thread](/docs/api-reference/threads) that was run. - - - `type: "message_creation" or "tool_calls"` - - The type of run step, which can be either `message_creation` or `tool_calls`. - - - `"message_creation"` - - - `"tool_calls"` - - - `usage: object { completion_tokens, prompt_tokens, total_tokens } or null` - - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - - `completion_tokens: number` - - Number of completion tokens used over the course of the run step. - - - `prompt_tokens: number` - - Number of prompt tokens used over the course of the run step. - - - `total_tokens: number` - - Total number of tokens used (prompt + completion). - -### Example - -```http -curl https://api.openai.com/v1/threads/$THREAD_ID/runs/$RUN_ID/steps/$STEP_ID \ - -H 'OpenAI-Beta: assistants=v2' \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } -} -``` - -### Example - -```http -curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123 \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "OpenAI-Beta: assistants=v2" -``` - -#### Response - -```json -{ - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } -} -``` diff --git a/docs/en/api/reference/resources/chat.md b/docs/en/api/reference/resources/chat.md index f4459b8..058d2bc 100644 --- a/docs/en/api/reference/resources/chat.md +++ b/docs/en/api/reference/resources/chat.md @@ -1874,6 +1874,10 @@ chunk objects if the request is streamed. Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -2071,6 +2075,7 @@ curl https://api.openai.com/v1/chat/completions \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, @@ -3118,6 +3123,10 @@ with the `store` parameter set to `true` will be returned. Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -3319,6 +3328,7 @@ curl https://api.openai.com/v1/chat/completions \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, @@ -3881,6 +3891,10 @@ with the `store` parameter set to `true` will be returned. Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -4062,6 +4076,7 @@ curl https://api.openai.com/v1/chat/completions/$COMPLETION_ID \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, @@ -4622,6 +4637,10 @@ the only supported modification is to update the `metadata` field. Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -4809,6 +4828,7 @@ curl https://api.openai.com/v1/chat/completions/$COMPLETION_ID \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, @@ -5383,6 +5403,10 @@ curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \ Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -6085,6 +6109,10 @@ curl -X POST https://api.openai.com/v1/chat/completions/chat_abc123 \ Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. diff --git a/docs/en/api/reference/resources/chat/subresources/completions/methods/retrieve.md b/docs/en/api/reference/resources/chat/subresources/completions/methods/retrieve.md index 916aa99..93156ad 100644 --- a/docs/en/api/reference/resources/chat/subresources/completions/methods/retrieve.md +++ b/docs/en/api/reference/resources/chat/subresources/completions/methods/retrieve.md @@ -487,6 +487,10 @@ with the `store` parameter set to `true` will be returned. Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -668,6 +672,7 @@ curl https://api.openai.com/v1/chat/completions/$COMPLETION_ID \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, diff --git a/docs/en/api/reference/resources/chat/subresources/completions/streaming-events.md b/docs/en/api/reference/resources/chat/subresources/completions/streaming-events.md index 103ab12..6d3c76a 100644 --- a/docs/en/api/reference/resources/chat/subresources/completions/streaming-events.md +++ b/docs/en/api/reference/resources/chat/subresources/completions/streaming-events.md @@ -305,6 +305,7 @@ Schema name: `CreateChatCompletionStreamResponse` "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens", "(resource) completions > (model) completion_usage > (schema) > (property) total_tokens", "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details", + "(resource) completions > (model) completion_usage > (schema) > (property) compute_units", "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details" ] }, @@ -660,6 +661,23 @@ Schema name: `CreateChatCompletionStreamResponse` "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details > (property) text_tokens" ] }, + "(resource) completions > (model) completion_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/CompletionUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details": { "kind": "HttpDeclProperty", "oasRef": "#/components/schemas/CompletionUsage/properties/prompt_tokens_details", @@ -718,6 +736,9 @@ Schema name: `CreateChatCompletionStreamResponse` { "ident": "completion_tokens_details" }, + { + "ident": "compute_units" + }, { "ident": "prompt_tokens_details" } @@ -729,6 +750,7 @@ Schema name: `CreateChatCompletionStreamResponse` "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens", "(resource) completions > (model) completion_usage > (schema) > (property) total_tokens", "(resource) completions > (model) completion_usage > (schema) > (property) completion_tokens_details", + "(resource) completions > (model) completion_usage > (schema) > (property) compute_units", "(resource) completions > (model) completion_usage > (schema) > (property) prompt_tokens_details" ] }, diff --git a/docs/en/api/reference/resources/completions.md b/docs/en/api/reference/resources/completions.md index d897bbd..f5aaddb 100644 --- a/docs/en/api/reference/resources/completions.md +++ b/docs/en/api/reference/resources/completions.md @@ -265,6 +265,10 @@ Returns a completion object, or a sequence of completion objects if the request Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -350,6 +354,7 @@ curl https://api.openai.com/v1/completions \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, @@ -542,6 +547,10 @@ curl https://api.openai.com/v1/completions \ Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -598,7 +607,7 @@ curl https://api.openai.com/v1/completions \ ### Completion Usage -- `CompletionUsage object { completion_tokens, prompt_tokens, total_tokens, 2 more }` +- `CompletionUsage object { completion_tokens, prompt_tokens, total_tokens, 3 more }` Usage statistics for the completion request. @@ -643,6 +652,10 @@ curl https://api.openai.com/v1/completions \ Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. diff --git a/docs/en/api/reference/resources/completions/methods/create.md b/docs/en/api/reference/resources/completions/methods/create.md index 8e9a785..eab2182 100644 --- a/docs/en/api/reference/resources/completions/methods/create.md +++ b/docs/en/api/reference/resources/completions/methods/create.md @@ -263,6 +263,10 @@ Returns a completion object, or a sequence of completion objects if the request Text output tokens generated by the model. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `prompt_tokens_details: optional object { audio_tokens, cache_write_tokens, cached_tokens, 2 more }` Breakdown of tokens used in the prompt. @@ -348,6 +352,7 @@ curl https://api.openai.com/v1/completions \ "rejected_prediction_tokens": 0, "text_tokens": 0 }, + "compute_units": 0, "prompt_tokens_details": { "audio_tokens": 0, "cache_write_tokens": 0, diff --git a/docs/en/api/reference/resources/responses.md b/docs/en/api/reference/resources/responses.md index 828231d..823edf0 100644 --- a/docs/en/api/reference/resources/responses.md +++ b/docs/en/api/reference/resources/responses.md @@ -9164,6 +9164,10 @@ the `background` parameter set to `true` can be cancelled. The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -9344,7 +9348,8 @@ curl https://api.openai.com/v1/responses/$RESPONSE_ID/cancel \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 }, "user": "user-1234" } @@ -17897,6 +17902,10 @@ Learn when and how to compact long-running conversations in the [conversation st The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + ### Example ```http @@ -17944,7 +17953,8 @@ curl https://api.openai.com/v1/responses/compact \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 } } ``` @@ -33034,6 +33044,10 @@ as input for the model's response. The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -33222,7 +33236,8 @@ curl https://api.openai.com/v1/responses \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 }, "user": "user-1234" } @@ -43230,6 +43245,10 @@ Retrieves a model response with the given ID. The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -43409,7 +43428,8 @@ curl https://api.openai.com/v1/responses/$RESPONSE_ID \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 }, "user": "user-1234" } @@ -47579,6 +47599,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + ### Computer Action - `ComputerAction = object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 more` @@ -57625,6 +57649,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -66987,6 +67015,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -76858,6 +76890,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -86168,6 +86204,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -95743,6 +95783,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -104946,6 +104990,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -127518,6 +127566,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -137378,6 +137430,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -139203,7 +139259,7 @@ curl https://api.openai.com/v1/responses/resp_123 \ ### Response Usage -- `ResponseUsage object { input_tokens, input_tokens_details, output_tokens, 2 more }` +- `ResponseUsage object { input_tokens, input_tokens_details, output_tokens, 3 more }` Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. @@ -139241,6 +139297,10 @@ curl https://api.openai.com/v1/responses/resp_123 \ The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + ### Response Web Search Call Completed Event - `ResponseWebSearchCallCompletedEvent object { item_id, output_index, sequence_number, type }` diff --git a/docs/en/api/reference/resources/responses/methods/cancel.md b/docs/en/api/reference/resources/responses/methods/cancel.md index f7d1d65..ef59db4 100644 --- a/docs/en/api/reference/resources/responses/methods/cancel.md +++ b/docs/en/api/reference/resources/responses/methods/cancel.md @@ -9162,6 +9162,10 @@ the `background` parameter set to `true` can be cancelled. The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -9342,7 +9346,8 @@ curl https://api.openai.com/v1/responses/$RESPONSE_ID/cancel \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 }, "user": "user-1234" } diff --git a/docs/en/api/reference/resources/responses/methods/compact.md b/docs/en/api/reference/resources/responses/methods/compact.md index f02e46f..4fb7be2 100644 --- a/docs/en/api/reference/resources/responses/methods/compact.md +++ b/docs/en/api/reference/resources/responses/methods/compact.md @@ -8486,6 +8486,10 @@ Learn when and how to compact long-running conversations in the [conversation st The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + ### Example ```http @@ -8533,7 +8537,8 @@ curl https://api.openai.com/v1/responses/compact \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 } } ``` diff --git a/docs/en/api/reference/resources/responses/methods/create.md b/docs/en/api/reference/resources/responses/methods/create.md index 83b4924..7741f80 100644 --- a/docs/en/api/reference/resources/responses/methods/create.md +++ b/docs/en/api/reference/resources/responses/methods/create.md @@ -15013,6 +15013,10 @@ as input for the model's response. The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -15201,7 +15205,8 @@ curl https://api.openai.com/v1/responses \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 }, "user": "user-1234" } diff --git a/docs/en/api/reference/resources/responses/methods/retrieve.md b/docs/en/api/reference/resources/responses/methods/retrieve.md index b39c260..8e662a3 100644 --- a/docs/en/api/reference/resources/responses/methods/retrieve.md +++ b/docs/en/api/reference/resources/responses/methods/retrieve.md @@ -9206,6 +9206,10 @@ Retrieves a model response with the given ID. The total number of tokens used. + - `compute_units: optional number or null` + + Compute units for the request. Currently null when available. + - `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. @@ -9385,7 +9389,8 @@ curl https://api.openai.com/v1/responses/$RESPONSE_ID \ "output_tokens_details": { "reasoning_tokens": 0 }, - "total_tokens": 0 + "total_tokens": 0, + "compute_units": 0 }, "user": "user-1234" } diff --git a/docs/en/api/reference/resources/responses/streaming-events.md b/docs/en/api/reference/resources/responses/streaming-events.md index 7ed1b9d..1a16cad 100644 --- a/docs/en/api/reference/resources/responses/streaming-events.md +++ b/docs/en/api/reference/resources/responses/streaming-events.md @@ -1917,7 +1917,8 @@ Schema name: `ResponseCreatedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -7494,6 +7495,23 @@ Schema name: `ResponseCreatedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -7516,6 +7534,9 @@ Schema name: `ResponseCreatedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -7525,7 +7546,8 @@ Schema name: `ResponseCreatedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -56220,7 +56242,8 @@ Schema name: `ResponseInProgressEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -61797,6 +61820,23 @@ Schema name: `ResponseInProgressEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -61819,6 +61859,9 @@ Schema name: `ResponseInProgressEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -61828,7 +61871,8 @@ Schema name: `ResponseInProgressEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -110523,7 +110567,8 @@ Schema name: `ResponseCompletedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -116100,6 +116145,23 @@ Schema name: `ResponseCompletedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -116122,6 +116184,9 @@ Schema name: `ResponseCompletedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -116131,7 +116196,8 @@ Schema name: `ResponseCompletedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -164843,7 +164909,8 @@ Schema name: `ResponseFailedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -170420,6 +170487,23 @@ Schema name: `ResponseFailedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -170442,6 +170526,9 @@ Schema name: `ResponseFailedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -170451,7 +170538,8 @@ Schema name: `ResponseFailedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -219144,7 +219232,8 @@ Schema name: `ResponseIncompleteEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -224721,6 +224810,23 @@ Schema name: `ResponseIncompleteEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -224743,6 +224849,9 @@ Schema name: `ResponseIncompleteEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -224752,7 +224861,8 @@ Schema name: `ResponseIncompleteEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -328947,7 +329057,8 @@ Schema name: `ResponseQueuedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -334524,6 +334635,23 @@ Schema name: `ResponseQueuedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -334546,6 +334674,9 @@ Schema name: `ResponseQueuedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -334555,7 +334686,8 @@ Schema name: `ResponseQueuedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -382287,7 +382419,13 @@ Schema name: `ResponseShellCallCommandAddedStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_command.added", + "sequence_number": 0, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ## response.shell_call_command.delta @@ -382446,7 +382584,14 @@ Schema name: `ResponseShellCallCommandDeltaStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_command.delta", + "sequence_number": 0, + "output_index": 0, + "command_index": 0, + "delta": "delta", + "obfuscation": "obfuscation" +} ``` ## response.shell_call_command.done @@ -382587,7 +382732,13 @@ Schema name: `ResponseShellCallCommandDoneStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_command.done", + "sequence_number": 0, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ## response.shell_call_output_content.delta @@ -382787,7 +382938,17 @@ Schema name: `ResponseShellCallOutputContentDeltaStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_output_content.delta", + "sequence_number": 0, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "delta": { + "stdout": "stdout", + "stderr": "stderr" + } +} ``` ## response.shell_call_output_content.done @@ -383171,5 +383332,21 @@ Schema name: `ResponseShellCallOutputContentDoneStreamingEvent` ### Example ```json -{} +{ + "type": "response.shell_call_output_content.done", + "sequence_number": 0, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "output": [ + { + "stdout": "stdout", + "stderr": "stderr", + "outcome": { + "type": "timeout" + }, + "created_by": "created_by" + } + ] +} ``` diff --git a/docs/en/api/reference/resources/responses/websocket-events.md b/docs/en/api/reference/resources/responses/websocket-events.md index 735430e..4c682d6 100644 --- a/docs/en/api/reference/resources/responses/websocket-events.md +++ b/docs/en/api/reference/resources/responses/websocket-events.md @@ -36958,7 +36958,8 @@ Schema name: `ResponseCreatedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -42535,6 +42536,23 @@ Schema name: `ResponseCreatedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -42557,6 +42575,9 @@ Schema name: `ResponseCreatedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -42566,7 +42587,8 @@ Schema name: `ResponseCreatedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -91296,7 +91318,8 @@ Schema name: `ResponseInProgressEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -96873,6 +96896,23 @@ Schema name: `ResponseInProgressEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -96895,6 +96935,9 @@ Schema name: `ResponseInProgressEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -96904,7 +96947,8 @@ Schema name: `ResponseInProgressEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -145634,7 +145678,8 @@ Schema name: `ResponseCompletedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -151211,6 +151256,23 @@ Schema name: `ResponseCompletedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -151233,6 +151295,9 @@ Schema name: `ResponseCompletedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -151242,7 +151307,8 @@ Schema name: `ResponseCompletedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -199989,7 +200055,8 @@ Schema name: `ResponseFailedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -205566,6 +205633,23 @@ Schema name: `ResponseFailedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -205588,6 +205672,9 @@ Schema name: `ResponseFailedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -205597,7 +205684,8 @@ Schema name: `ResponseFailedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -254325,7 +254413,8 @@ Schema name: `ResponseIncompleteEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -259902,6 +259991,23 @@ Schema name: `ResponseIncompleteEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -259924,6 +260030,9 @@ Schema name: `ResponseIncompleteEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -259933,7 +260042,8 @@ Schema name: `ResponseIncompleteEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -365563,7 +365673,8 @@ Schema name: `ResponseQueuedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response > (schema) > (property) user": { @@ -371140,6 +371251,23 @@ Schema name: `ResponseQueuedEvent` "schemaType": "integer", "children": [] }, + "(resource) responses > (model) response_usage > (schema) > (property) compute_units": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/ResponseUsage/properties/compute_units", + "deprecated": false, + "key": "compute_units", + "docstring": "Compute units for the request. Currently null when available.\n", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "minimum": 0 + }, + "optional": true, + "nullable": true, + "schemaType": "integer", + "children": [] + }, "(resource) responses > (model) response_usage > (schema)": { "kind": "HttpDeclTypeAlias", "oasRef": "#/components/schemas/ResponseUsage", @@ -371162,6 +371290,9 @@ Schema name: `ResponseQueuedEvent` }, { "ident": "total_tokens" + }, + { + "ident": "compute_units" } ] }, @@ -371171,7 +371302,8 @@ Schema name: `ResponseQueuedEvent` "(resource) responses > (model) response_usage > (schema) > (property) input_tokens_details", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens", "(resource) responses > (model) response_usage > (schema) > (property) output_tokens_details", - "(resource) responses > (model) response_usage > (schema) > (property) total_tokens" + "(resource) responses > (model) response_usage > (schema) > (property) total_tokens", + "(resource) responses > (model) response_usage > (schema) > (property) compute_units" ] }, "(resource) responses > (model) response_error > (schema) > (property) code > (member) 0": { @@ -419002,7 +419134,13 @@ Schema name: `ResponseShellCallCommandAddedStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_command.added", + "sequence_number": 0, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ### response.shell_call_command.delta @@ -419196,7 +419334,14 @@ Schema name: `ResponseShellCallCommandDeltaStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_command.delta", + "sequence_number": 0, + "output_index": 0, + "command_index": 0, + "delta": "delta", + "obfuscation": "obfuscation" +} ``` ### response.shell_call_command.done @@ -419372,7 +419517,13 @@ Schema name: `ResponseShellCallCommandDoneStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_command.done", + "sequence_number": 0, + "output_index": 0, + "command_index": 0, + "command": "command" +} ``` ### response.shell_call_output_content.delta @@ -419607,7 +419758,17 @@ Schema name: `ResponseShellCallOutputContentDeltaStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_output_content.delta", + "sequence_number": 0, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "delta": { + "stdout": "stdout", + "stderr": "stderr" + } +} ``` ### response.shell_call_output_content.done @@ -420026,5 +420187,21 @@ Schema name: `ResponseShellCallOutputContentDoneStreamingEvent` #### Example ```json -{} +{ + "type": "response.shell_call_output_content.done", + "sequence_number": 0, + "item_id": "item_id", + "output_index": 0, + "command_index": 0, + "output": [ + { + "stdout": "stdout", + "stderr": "stderr", + "outcome": { + "type": "timeout" + }, + "created_by": "created_by" + } + ] +} ``` diff --git a/docs/en/api/reference/resources/webhooks.md b/docs/en/api/reference/resources/webhooks.md index 0e8bd48..0a299bd 100644 --- a/docs/en/api/reference/resources/webhooks.md +++ b/docs/en/api/reference/resources/webhooks.md @@ -3168,3 +3168,377 @@ Schema name: `WebhookLiveCallIncoming` } } ``` + +## safety.alert.created + +Sent when an approved safety alert is available for an API project. + +### Schema + +Schema name: `WebhookSafetyAlertCreated` + +```json +{ + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema)": { + "kind": "HttpDeclTypeAlias", + "oasRef": "#/webhooks/safety_alert_created/post/requestBody/content/application%2Fjson/schema", + "docstring": "Sent when an approved safety alert is available for an API project.", + "ident": "SafetyAlertCreatedWebhookEvent", + "type": { + "kind": "HttpTypeObject", + "members": [ + { + "ident": "id" + }, + { + "ident": "created_at" + }, + { + "ident": "data" + }, + { + "ident": "object" + }, + { + "ident": "type" + } + ] + }, + "childrenParentSchema": "object", + "children": [ + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) id", + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) created_at", + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) data", + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) object", + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) type" + ] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) id": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/id", + "deprecated": false, + "key": "id", + "docstring": "The unique ID of the webhook event.", + "type": { + "kind": "HttpTypeString" + }, + "optional": false, + "nullable": false, + "schemaType": "string", + "children": [] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) created_at": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/created_at", + "deprecated": false, + "key": "created_at", + "docstring": "The Unix timestamp in seconds when the event was created.", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "format": "unixtime" + }, + "optional": false, + "nullable": false, + "schemaType": "integer", + "children": [] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) data": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/data", + "deprecated": false, + "key": "data", + "type": { + "kind": "HttpTypeObject", + "members": [ + { + "ident": "id" + } + ] + }, + "optional": false, + "nullable": false, + "schemaType": "object", + "childrenParentSchema": "object", + "children": [ + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) data > (property) id" + ] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) object": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/object", + "deprecated": false, + "key": "object", + "docstring": "Always `event`.", + "type": { + "kind": "HttpTypeUnion", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/object", + "types": [ + { + "kind": "HttpTypeLiteral", + "literal": "event" + } + ] + }, + "optional": false, + "nullable": false, + "schemaType": "enum", + "childrenParentSchema": "enum", + "children": [ + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) object > (member) 0" + ] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) type": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/type", + "deprecated": false, + "key": "type", + "docstring": "Always `safety.alert.created`.", + "type": { + "kind": "HttpTypeUnion", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/type", + "types": [ + { + "kind": "HttpTypeLiteral", + "literal": "safety.alert.created" + } + ] + }, + "optional": false, + "nullable": false, + "schemaType": "enum", + "childrenParentSchema": "enum", + "children": [ + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) type > (member) 0" + ] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) data > (property) id": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyAlertCreated/properties/data/properties/id", + "deprecated": false, + "key": "id", + "docstring": "The safety alert ID to pass to `GET /v1/safety/alerts/{id}`.", + "type": { + "kind": "HttpTypeString" + }, + "optional": false, + "nullable": false, + "schemaType": "string", + "children": [] + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) object > (member) 0": { + "kind": "HttpDeclReference", + "type": { + "kind": "HttpTypeLiteral", + "literal": "event" + } + }, + "(resource) webhooks > (model) safety_alert_created_webhook_event > (schema) > (property) type > (member) 0": { + "kind": "HttpDeclReference", + "type": { + "kind": "HttpTypeLiteral", + "literal": "safety.alert.created" + } + } +} +``` + +### Example + +```json +{ + "id": "evt_123", + "object": "event", + "created_at": 1787659200, + "type": "safety.alert.created", + "data": {"id": "alert_0123456789abcdef0123456789abcdef"} +} +``` + +## safety.org_alert.created + +Sent when an approved safety alert is available for an enterprise workspace. + +### Schema + +Schema name: `WebhookSafetyOrgAlertCreated` + +```json +{ + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema)": { + "kind": "HttpDeclTypeAlias", + "oasRef": "#/webhooks/safety_org_alert_created/post/requestBody/content/application%2Fjson/schema", + "docstring": "Sent when an approved safety alert is available for an enterprise workspace.", + "ident": "SafetyOrgAlertCreatedWebhookEvent", + "type": { + "kind": "HttpTypeObject", + "members": [ + { + "ident": "id" + }, + { + "ident": "created_at" + }, + { + "ident": "data" + }, + { + "ident": "object" + }, + { + "ident": "type" + } + ] + }, + "childrenParentSchema": "object", + "children": [ + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) id", + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) created_at", + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) data", + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) object", + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) type" + ] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) id": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/id", + "deprecated": false, + "key": "id", + "docstring": "The unique ID of the webhook event.", + "type": { + "kind": "HttpTypeString" + }, + "optional": false, + "nullable": false, + "schemaType": "string", + "children": [] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) created_at": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/created_at", + "deprecated": false, + "key": "created_at", + "docstring": "The Unix timestamp in seconds when the event was created.", + "type": { + "kind": "HttpTypeNumber" + }, + "constraints": { + "format": "unixtime" + }, + "optional": false, + "nullable": false, + "schemaType": "integer", + "children": [] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) data": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/data", + "deprecated": false, + "key": "data", + "type": { + "kind": "HttpTypeObject", + "members": [ + { + "ident": "id" + } + ] + }, + "optional": false, + "nullable": false, + "schemaType": "object", + "childrenParentSchema": "object", + "children": [ + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) data > (property) id" + ] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) object": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/object", + "deprecated": false, + "key": "object", + "docstring": "Always `event`.", + "type": { + "kind": "HttpTypeUnion", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/object", + "types": [ + { + "kind": "HttpTypeLiteral", + "literal": "event" + } + ] + }, + "optional": false, + "nullable": false, + "schemaType": "enum", + "childrenParentSchema": "enum", + "children": [ + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) object > (member) 0" + ] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) type": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/type", + "deprecated": false, + "key": "type", + "docstring": "Always `safety.org_alert.created`.", + "type": { + "kind": "HttpTypeUnion", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/type", + "types": [ + { + "kind": "HttpTypeLiteral", + "literal": "safety.org_alert.created" + } + ] + }, + "optional": false, + "nullable": false, + "schemaType": "enum", + "childrenParentSchema": "enum", + "children": [ + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) type > (member) 0" + ] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) data > (property) id": { + "kind": "HttpDeclProperty", + "oasRef": "#/components/schemas/WebhookSafetyOrgAlertCreated/properties/data/properties/id", + "deprecated": false, + "key": "id", + "docstring": "The safety alert ID to pass to `GET /v1/safety/alerts/{id}`.", + "type": { + "kind": "HttpTypeString" + }, + "optional": false, + "nullable": false, + "schemaType": "string", + "children": [] + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) object > (member) 0": { + "kind": "HttpDeclReference", + "type": { + "kind": "HttpTypeLiteral", + "literal": "event" + } + }, + "(resource) webhooks > (model) safety_org_alert_created_webhook_event > (schema) > (property) type > (member) 0": { + "kind": "HttpDeclReference", + "type": { + "kind": "HttpTypeLiteral", + "literal": "safety.org_alert.created" + } + } +} +``` + +### Example + +```json +{ + "id": "evt_123", + "object": "event", + "created_at": 1787659200, + "type": "safety.org_alert.created", + "data": {"id": "alert_0123456789abcdef0123456789abcdef"} +} +``` diff --git a/docs/updates/2026-08-31T04-05-07-000Z.json b/docs/updates/2026-08-31T04-05-07-000Z.json new file mode 100644 index 0000000..8747395 --- /dev/null +++ b/docs/updates/2026-08-31T04-05-07-000Z.json @@ -0,0 +1,586 @@ +{ + "id": "2026-08-31T04-05-07-000Z", + "generatedAt": "2026-08-31T04:05:07Z", + "added": [ + { + "path": "docs/en/api/docs/guides/image-cost-calculator.md", + "route": "/api/docs/guides/image-cost-calculator", + "sourceUrl": "https://developers.openai.com/api/docs/guides/image-cost-calculator.md", + "title": "Image input token and cost calculator" + } + ], + "modified": [ + { + "path": "docs/en/api/docs/assistants/migration.md", + "route": "/api/docs/assistants/migration", + "sourceUrl": "https://developers.openai.com/api/docs/assistants/migration.md", + "title": "Assistants migration guide" + }, + { + "path": "docs/en/api/docs/changelog.md", + "route": "/api/docs/changelog", + "sourceUrl": "https://developers.openai.com/api/docs/changelog.md", + "title": "API changelog" + }, + { + "path": "docs/en/api/docs/deprecations.md", + "route": "/api/docs/deprecations", + "sourceUrl": "https://developers.openai.com/api/docs/deprecations.md", + "title": "Deprecations" + }, + { + "path": "docs/en/api/docs/guides/advanced-usage.md", + "route": "/api/docs/guides/advanced-usage", + "sourceUrl": "https://developers.openai.com/api/docs/guides/advanced-usage.md", + "title": "Advanced usage" + }, + { + "path": "docs/en/api/docs/guides/background.md", + "route": "/api/docs/guides/background", + "sourceUrl": "https://developers.openai.com/api/docs/guides/background.md", + "title": "Background mode" + }, + { + "path": "docs/en/api/docs/guides/code-generation.md", + "route": "/api/docs/guides/code-generation", + "sourceUrl": "https://developers.openai.com/api/docs/guides/code-generation.md", + "title": "Code generation" + }, + { + "path": "docs/en/api/docs/guides/compaction.md", + "route": "/api/docs/guides/compaction", + "sourceUrl": "https://developers.openai.com/api/docs/guides/compaction.md", + "title": "Compaction" + }, + { + "path": "docs/en/api/docs/guides/content-provenance.md", + "route": "/api/docs/guides/content-provenance", + "sourceUrl": "https://developers.openai.com/api/docs/guides/content-provenance.md", + "title": "Content provenance" + }, + { + "path": "docs/en/api/docs/guides/conversation-state.md", + "route": "/api/docs/guides/conversation-state", + "sourceUrl": "https://developers.openai.com/api/docs/guides/conversation-state.md", + "title": "Conversation state" + }, + { + "path": "docs/en/api/docs/guides/deep-research.md", + "route": "/api/docs/guides/deep-research", + "sourceUrl": "https://developers.openai.com/api/docs/guides/deep-research.md", + "title": "Deep research" + }, + { + "path": "docs/en/api/docs/guides/deployment-checklist.md", + "route": "/api/docs/guides/deployment-checklist", + "sourceUrl": "https://developers.openai.com/api/docs/guides/deployment-checklist.md", + "title": "API deployment checklist" + }, + { + "path": "docs/en/api/docs/guides/embeddings.md", + "route": "/api/docs/guides/embeddings", + "sourceUrl": "https://developers.openai.com/api/docs/guides/embeddings.md", + "title": "Vector embeddings" + }, + { + "path": "docs/en/api/docs/guides/error-codes.md", + "route": "/api/docs/guides/error-codes", + "sourceUrl": "https://developers.openai.com/api/docs/guides/error-codes.md", + "title": "Error codes" + }, + { + "path": "docs/en/api/docs/guides/evals.md", + "route": "/api/docs/guides/evals", + "sourceUrl": "https://developers.openai.com/api/docs/guides/evals.md", + "title": "Working with evals" + }, + { + "path": "docs/en/api/docs/guides/file-inputs.md", + "route": "/api/docs/guides/file-inputs", + "sourceUrl": "https://developers.openai.com/api/docs/guides/file-inputs.md", + "title": "File inputs" + }, + { + "path": "docs/en/api/docs/guides/flex-processing.md", + "route": "/api/docs/guides/flex-processing", + "sourceUrl": "https://developers.openai.com/api/docs/guides/flex-processing.md", + "title": "Flex processing" + }, + { + "path": "docs/en/api/docs/guides/image-generation.md", + "route": "/api/docs/guides/image-generation", + "sourceUrl": "https://developers.openai.com/api/docs/guides/image-generation.md", + "title": "Image generation" + }, + { + "path": "docs/en/api/docs/guides/images-vision.md", + "route": "/api/docs/guides/images-vision", + "sourceUrl": "https://developers.openai.com/api/docs/guides/images-vision.md", + "title": "Images and vision" + }, + { + "path": "docs/en/api/docs/guides/latest-model/gpt-5.2.md", + "route": "/api/docs/guides/latest-model/gpt-5.2", + "sourceUrl": "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.2.md", + "title": "Using GPT-5.2" + }, + { + "path": "docs/en/api/docs/guides/latest-model/gpt-5.4.md", + "route": "/api/docs/guides/latest-model/gpt-5.4", + "sourceUrl": "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.4.md", + "title": "Using GPT-5.4" + }, + { + "path": "docs/en/api/docs/guides/latest-model/gpt-5.6.md", + "route": "/api/docs/guides/latest-model/gpt-5.6", + "sourceUrl": "https://developers.openai.com/api/docs/guides/latest-model/gpt-5.6.md", + "title": "Using GPT-5.6" + }, + { + "path": "docs/en/api/docs/guides/migrate-to-responses.md", + "route": "/api/docs/guides/migrate-to-responses", + "sourceUrl": "https://developers.openai.com/api/docs/guides/migrate-to-responses.md", + "title": "Migrate to the Responses API" + }, + { + "path": "docs/en/api/docs/guides/predicted-outputs.md", + "route": "/api/docs/guides/predicted-outputs", + "sourceUrl": "https://developers.openai.com/api/docs/guides/predicted-outputs.md", + "title": "Predicted Outputs" + }, + { + "path": "docs/en/api/docs/guides/prompt-engineering.md", + "route": "/api/docs/guides/prompt-engineering", + "sourceUrl": "https://developers.openai.com/api/docs/guides/prompt-engineering.md", + "title": "Prompt engineering" + }, + { + "path": "docs/en/api/docs/guides/prompt-generation.md", + "route": "/api/docs/guides/prompt-generation", + "sourceUrl": "https://developers.openai.com/api/docs/guides/prompt-generation.md", + "title": "Prompt generation" + }, + { + "path": "docs/en/api/docs/guides/prompting/migrate-from-prompt-object.md", + "route": "/api/docs/guides/prompting/migrate-from-prompt-object", + "sourceUrl": "https://developers.openai.com/api/docs/guides/prompting/migrate-from-prompt-object.md", + "title": "Migrate from prompt objects" + }, + { + "path": "docs/en/api/docs/guides/realtime-conversations.md", + "route": "/api/docs/guides/realtime-conversations", + "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-conversations.md", + "title": "Realtime conversations" + }, + { + "path": "docs/en/api/docs/guides/realtime-mcp.md", + "route": "/api/docs/guides/realtime-mcp", + "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-mcp.md", + "title": "Realtime with tools" + }, + { + "path": "docs/en/api/docs/guides/realtime-sip.md", + "route": "/api/docs/guides/realtime-sip", + "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-sip.md", + "title": "Realtime API with SIP" + }, + { + "path": "docs/en/api/docs/guides/realtime-websocket.md", + "route": "/api/docs/guides/realtime-websocket", + "sourceUrl": "https://developers.openai.com/api/docs/guides/realtime-websocket.md", + "title": "Realtime API with WebSocket" + }, + { + "path": "docs/en/api/docs/guides/reasoning.md", + "route": "/api/docs/guides/reasoning", + "sourceUrl": "https://developers.openai.com/api/docs/guides/reasoning.md", + "title": "Reasoning models" + }, + { + "path": "docs/en/api/docs/guides/safety-best-practices.md", + "route": "/api/docs/guides/safety-best-practices", + "sourceUrl": "https://developers.openai.com/api/docs/guides/safety-best-practices.md", + "title": "Safety best practices" + }, + { + "path": "docs/en/api/docs/guides/safety-checks.md", + "route": "/api/docs/guides/safety-checks", + "sourceUrl": "https://developers.openai.com/api/docs/guides/safety-checks.md", + "title": "Safety checks" + }, + { + "path": "docs/en/api/docs/guides/speech-to-text.md", + "route": "/api/docs/guides/speech-to-text", + "sourceUrl": "https://developers.openai.com/api/docs/guides/speech-to-text.md", + "title": "File transcription" + }, + { + "path": "docs/en/api/docs/guides/streaming-responses.md", + "route": "/api/docs/guides/streaming-responses", + "sourceUrl": "https://developers.openai.com/api/docs/guides/streaming-responses.md", + "title": "Streaming API responses" + }, + { + "path": "docs/en/api/docs/guides/structured-outputs.md", + "route": "/api/docs/guides/structured-outputs", + "sourceUrl": "https://developers.openai.com/api/docs/guides/structured-outputs.md", + "title": "Structured model outputs" + }, + { + "path": "docs/en/api/docs/guides/tools-apply-patch.md", + "route": "/api/docs/guides/tools-apply-patch", + "sourceUrl": "https://developers.openai.com/api/docs/guides/tools-apply-patch.md", + "title": "Apply Patch" + }, + { + "path": "docs/en/api/docs/guides/tools-file-search.md", + "route": "/api/docs/guides/tools-file-search", + "sourceUrl": "https://developers.openai.com/api/docs/guides/tools-file-search.md", + "title": "File search" + }, + { + "path": "docs/en/api/docs/guides/tools-image-generation.md", + "route": "/api/docs/guides/tools-image-generation", + "sourceUrl": "https://developers.openai.com/api/docs/guides/tools-image-generation.md", + "title": "Image generation" + }, + { + "path": "docs/en/api/docs/guides/webhooks.md", + "route": "/api/docs/guides/webhooks", + "sourceUrl": "https://developers.openai.com/api/docs/guides/webhooks.md", + "title": "Webhooks" + }, + { + "path": "docs/en/api/docs/guides/workload-identity-federation/oracle-cloud.md", + "route": "/api/docs/guides/workload-identity-federation/oracle-cloud", + "sourceUrl": "https://developers.openai.com/api/docs/guides/workload-identity-federation/oracle-cloud.md", + "title": "Configuring workload identity federation for Oracle Cloud Infrastructure" + }, + { + "path": "docs/en/api/docs/guides/your-data.md", + "route": "/api/docs/guides/your-data", + "sourceUrl": "https://developers.openai.com/api/docs/guides/your-data.md", + "title": "Data controls in the OpenAI platform" + }, + { + "path": "docs/en/api/docs/libraries.md", + "route": "/api/docs/libraries", + "sourceUrl": "https://developers.openai.com/api/docs/libraries.md", + "title": "SDKs and CLI" + }, + { + "path": "docs/en/api/docs/models.md", + "route": "/api/docs/models", + "sourceUrl": "https://developers.openai.com/api/docs/models.md", + "title": "Models" + }, + { + "path": "docs/en/api/docs/models/all.md", + "route": "/api/docs/models/all", + "sourceUrl": "https://developers.openai.com/api/docs/models/all.md", + "title": "All models" + }, + { + "path": "docs/en/api/docs/pricing.md", + "route": "/api/docs/pricing", + "sourceUrl": "https://developers.openai.com/api/docs/pricing.md", + "title": "Pricing" + }, + { + "path": "docs/en/api/docs/quickstart.md", + "route": "/api/docs/quickstart", + "sourceUrl": "https://developers.openai.com/api/docs/quickstart.md", + "title": "Developer quickstart" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/responses/streaming-events.md", + "route": "/api/reference/resources/beta/subresources/responses/streaming-events", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/responses/streaming-events.md", + "title": "Beta Responses streaming events" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/responses/websocket-events.md", + "route": "/api/reference/resources/beta/subresources/responses/websocket-events", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/responses/websocket-events.md", + "title": "Beta Responses WebSocket events" + }, + { + "path": "docs/en/api/reference/resources/chat.md", + "route": "/api/reference/resources/chat", + "sourceUrl": "https://developers.openai.com/api/reference/resources/chat.md", + "title": "Chat" + }, + { + "path": "docs/en/api/reference/resources/chat/subresources/completions/methods/retrieve.md", + "route": "/api/reference/resources/chat/subresources/completions/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/retrieve.md", + "title": "Chat Completions — Retrieve" + }, + { + "path": "docs/en/api/reference/resources/chat/subresources/completions/streaming-events.md", + "route": "/api/reference/resources/chat/subresources/completions/streaming-events", + "sourceUrl": "https://developers.openai.com/api/reference/resources/chat/subresources/completions/streaming-events.md", + "title": "Chat Completions streaming events" + }, + { + "path": "docs/en/api/reference/resources/completions.md", + "route": "/api/reference/resources/completions", + "sourceUrl": "https://developers.openai.com/api/reference/resources/completions.md", + "title": "Completions" + }, + { + "path": "docs/en/api/reference/resources/completions/methods/create.md", + "route": "/api/reference/resources/completions/methods/create", + "sourceUrl": "https://developers.openai.com/api/reference/resources/completions/methods/create.md", + "title": "Completions — Create" + }, + { + "path": "docs/en/api/reference/resources/responses.md", + "route": "/api/reference/resources/responses", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses.md", + "title": "Responses" + }, + { + "path": "docs/en/api/reference/resources/responses/methods/cancel.md", + "route": "/api/reference/resources/responses/methods/cancel", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/cancel.md", + "title": "Responses — Cancel" + }, + { + "path": "docs/en/api/reference/resources/responses/methods/compact.md", + "route": "/api/reference/resources/responses/methods/compact", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/compact.md", + "title": "Responses — Compact" + }, + { + "path": "docs/en/api/reference/resources/responses/methods/create.md", + "route": "/api/reference/resources/responses/methods/create", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/create.md", + "title": "Responses — Create" + }, + { + "path": "docs/en/api/reference/resources/responses/methods/retrieve.md", + "route": "/api/reference/resources/responses/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/methods/retrieve.md", + "title": "Responses — Retrieve" + }, + { + "path": "docs/en/api/reference/resources/responses/streaming-events.md", + "route": "/api/reference/resources/responses/streaming-events", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/streaming-events.md", + "title": "Responses streaming events" + }, + { + "path": "docs/en/api/reference/resources/responses/websocket-events.md", + "route": "/api/reference/resources/responses/websocket-events", + "sourceUrl": "https://developers.openai.com/api/reference/resources/responses/websocket-events.md", + "title": "Responses WebSocket events" + }, + { + "path": "docs/en/api/reference/resources/webhooks.md", + "route": "/api/reference/resources/webhooks", + "sourceUrl": "https://developers.openai.com/api/reference/resources/webhooks.md", + "title": "Webhooks events" + } + ], + "removed": [ + { + "path": "docs/en/api/docs/assistants/deep-dive.md", + "route": "/api/docs/assistants/deep-dive", + "sourceUrl": "https://developers.openai.com/api/docs/assistants/deep-dive.md", + "title": "Assistants API deep dive" + }, + { + "path": "docs/en/api/docs/assistants/tools.md", + "route": "/api/docs/assistants/tools", + "sourceUrl": "https://developers.openai.com/api/docs/assistants/tools.md", + "title": "Assistants API tools" + }, + { + "path": "docs/en/api/docs/assistants/tools/code-interpreter.md", + "route": "/api/docs/assistants/tools/code-interpreter", + "sourceUrl": "https://developers.openai.com/api/docs/assistants/tools/code-interpreter.md", + "title": "Assistants Code Interpreter" + }, + { + "path": "docs/en/api/docs/assistants/tools/file-search.md", + "route": "/api/docs/assistants/tools/file-search", + "sourceUrl": "https://developers.openai.com/api/docs/assistants/tools/file-search.md", + "title": "Assistants File Search" + }, + { + "path": "docs/en/api/docs/assistants/tools/function-calling.md", + "route": "/api/docs/assistants/tools/function-calling", + "sourceUrl": "https://developers.openai.com/api/docs/assistants/tools/function-calling.md", + "title": "Assistants Function Calling" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants.md", + "route": "/api/reference/resources/beta/subresources/assistants", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants.md", + "title": "Beta Assistants" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants/methods/create.md", + "route": "/api/reference/resources/beta/subresources/assistants/methods/create", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/create.md", + "title": "Beta Assistants — Create" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants/methods/delete.md", + "route": "/api/reference/resources/beta/subresources/assistants/methods/delete", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/delete.md", + "title": "Beta Assistants — Delete" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants/methods/list.md", + "route": "/api/reference/resources/beta/subresources/assistants/methods/list", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/list.md", + "title": "Beta Assistants — List" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants/methods/retrieve.md", + "route": "/api/reference/resources/beta/subresources/assistants/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/retrieve.md", + "title": "Beta Assistants — Retrieve" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants/methods/update.md", + "route": "/api/reference/resources/beta/subresources/assistants/methods/update", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/methods/update.md", + "title": "Beta Assistants — Update" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/assistants/streaming-events.md", + "route": "/api/reference/resources/beta/subresources/assistants/streaming-events", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/assistants/streaming-events.md", + "title": "Assistants streaming events" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads.md", + "route": "/api/reference/resources/beta/subresources/threads", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads.md", + "title": "Beta Threads" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/methods/create.md", + "route": "/api/reference/resources/beta/subresources/threads/methods/create", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/create.md", + "title": "Beta Threads — Create" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/methods/delete.md", + "route": "/api/reference/resources/beta/subresources/threads/methods/delete", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/delete.md", + "title": "Beta Threads — Delete" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/methods/retrieve.md", + "route": "/api/reference/resources/beta/subresources/threads/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/retrieve.md", + "title": "Beta Threads — Retrieve" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/methods/update.md", + "route": "/api/reference/resources/beta/subresources/threads/methods/update", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/methods/update.md", + "title": "Beta Threads — Update" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/messages.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/messages", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages.md", + "title": "Beta Threads Messages" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/create.md", + "title": "Beta Threads Messages — Create" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/delete.md", + "title": "Beta Threads Messages — Delete" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/list.md", + "title": "Beta Threads Messages — List" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/retrieve.md", + "title": "Beta Threads Messages — Retrieve" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/messages/methods/update.md", + "title": "Beta Threads Messages — Update" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs.md", + "title": "Beta Threads Runs" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/cancel.md", + "title": "Beta Threads Runs — Cancel" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/create.md", + "title": "Beta Threads Runs — Create" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/list.md", + "title": "Beta Threads Runs — List" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/retrieve.md", + "title": "Beta Threads Runs — Retrieve" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/submit_tool_outputs.md", + "title": "Beta Threads Runs — Submit Tool Outputs" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/methods/update.md", + "title": "Beta Threads Runs — Update" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps.md", + "title": "Beta Threads Runs Steps" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/list.md", + "title": "Beta Threads Runs Steps — List" + }, + { + "path": "docs/en/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md", + "route": "/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve", + "sourceUrl": "https://developers.openai.com/api/reference/resources/beta/subresources/threads/subresources/runs/subresources/steps/methods/retrieve.md", + "title": "Beta Threads Runs Steps — Retrieve" + } + ] +}