diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2846d79..c24bff7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.438.1 sources: mistral-azure-source: sourceNamespace: mistral-azure-source - sourceRevisionDigest: sha256:2e3e3792ec63f3d59dd2a4de2f97ea6a80bd46f8905576069c54810feb930c12 - sourceBlobDigest: sha256:da059f78d331ea36f2ec69dfc6c5aa65be0bf0eda011597281cea6499b7ebac8 + sourceRevisionDigest: sha256:c441f2d21e7879f5fb9d8d99e2ae242d1e5a84c0c06db971911eb578173e7f62 + sourceBlobDigest: sha256:de4af0f100f15fef89e093a6b5393302b2218fb154230594ec811aacdd4f2ec7 tags: - latest - main @@ -25,10 +25,10 @@ targets: mistralai-azure-sdk: source: mistral-azure-source sourceNamespace: mistral-azure-source - sourceRevisionDigest: sha256:2e3e3792ec63f3d59dd2a4de2f97ea6a80bd46f8905576069c54810feb930c12 - sourceBlobDigest: sha256:da059f78d331ea36f2ec69dfc6c5aa65be0bf0eda011597281cea6499b7ebac8 + sourceRevisionDigest: sha256:c441f2d21e7879f5fb9d8d99e2ae242d1e5a84c0c06db971911eb578173e7f62 + sourceBlobDigest: sha256:de4af0f100f15fef89e093a6b5393302b2218fb154230594ec811aacdd4f2ec7 codeSamplesNamespace: mistral-openapi-azure-code-samples - codeSamplesRevisionDigest: sha256:859080f8bc0f025db686fb068bea2903ab97b15e55d3c88ad484fe27671b7a1d + codeSamplesRevisionDigest: sha256:e986a6f674fde2807db8383cdfefc9229cc4df98276918d60a5f4189ce07fb98 mistralai-gcp-sdk: source: mistral-google-cloud-source sourceNamespace: mistral-google-cloud-source diff --git a/packages/mistralai-azure/.speakeasy/gen.lock b/packages/mistralai-azure/.speakeasy/gen.lock index eb4564e..48d8974 100644 --- a/packages/mistralai-azure/.speakeasy/gen.lock +++ b/packages/mistralai-azure/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 01e8a40b-3df3-4d9a-9501-2eb9e0d26c05 management: - docChecksum: 1eac78d7698423fcd3bc58124f860d30 + docChecksum: d0000cbe03848bfe843794965cba332f docVersion: 0.0.2 speakeasyVersion: 1.438.1 generationVersion: 2.457.2 - releaseVersion: 1.3.1 - configChecksum: 003b83d3c40dab3a6fbc894a958541d1 + releaseVersion: 1.3.4 + configChecksum: c701bbf71f3977510ce625c672b31284 repoURL: https://github.com/mistralai/client-ts.git repoSubDirectory: packages/mistralai-azure installationURL: https://gitpkg.now.sh/mistralai/client-ts/packages/mistralai-azure @@ -67,6 +67,8 @@ generatedFiles: - docs/models/components/functiont.md - docs/models/components/loc.md - docs/models/components/messages.md + - docs/models/components/referencechunk.md + - docs/models/components/referencechunktype.md - docs/models/components/responseformat.md - docs/models/components/responseformats.md - docs/models/components/role.md @@ -80,6 +82,7 @@ generatedFiles: - docs/models/components/toolchoice.md - docs/models/components/toolchoiceenum.md - docs/models/components/toolmessage.md + - docs/models/components/toolmessagecontent.md - docs/models/components/toolmessagerole.md - docs/models/components/tooltypes.md - docs/models/components/type.md @@ -129,6 +132,7 @@ generatedFiles: - src/models/components/functioncall.ts - src/models/components/functionname.ts - src/models/components/index.ts + - src/models/components/referencechunk.ts - src/models/components/responseformat.ts - src/models/components/responseformats.ts - src/models/components/security.ts diff --git a/packages/mistralai-azure/.speakeasy/gen.yaml b/packages/mistralai-azure/.speakeasy/gen.yaml index feea558..c5956b3 100644 --- a/packages/mistralai-azure/.speakeasy/gen.yaml +++ b/packages/mistralai-azure/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false typescript: - version: 1.3.1 + version: 1.3.4 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/packages/mistralai-azure/RELEASES.md b/packages/mistralai-azure/RELEASES.md index b57d24e..bf65bb5 100644 --- a/packages/mistralai-azure/RELEASES.md +++ b/packages/mistralai-azure/RELEASES.md @@ -68,4 +68,14 @@ Based on: ### Generated - [typescript v1.3.1] packages/mistralai-azure ### Releases -- [NPM v1.3.1] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.1 - packages/mistralai-azure \ No newline at end of file +- [NPM v1.3.1] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.1 - packages/mistralai-azure + +## 2024-11-15 18:36:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.3.4] packages/mistralai-azure +### Releases +- [NPM v1.3.4] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.4 - packages/mistralai-azure \ No newline at end of file diff --git a/packages/mistralai-azure/docs/models/components/chatcompletionrequestmessages.md b/packages/mistralai-azure/docs/models/components/chatcompletionrequestmessages.md index 63c51e9..2cf123d 100644 --- a/packages/mistralai-azure/docs/models/components/chatcompletionrequestmessages.md +++ b/packages/mistralai-azure/docs/models/components/chatcompletionrequestmessages.md @@ -25,7 +25,13 @@ const value: components.SystemMessage = { ```typescript const value: components.ToolMessage = { - content: "", + content: [ + { + referenceIds: [ + 943749, + ], + }, + ], }; ``` @@ -33,7 +39,11 @@ const value: components.ToolMessage = { ```typescript const value: components.UserMessage = { - content: "", + content: [ + { + text: "", + }, + ], }; ``` diff --git a/packages/mistralai-azure/docs/models/components/chatcompletionrequesttoolchoice.md b/packages/mistralai-azure/docs/models/components/chatcompletionrequesttoolchoice.md index 8750103..1196b75 100644 --- a/packages/mistralai-azure/docs/models/components/chatcompletionrequesttoolchoice.md +++ b/packages/mistralai-azure/docs/models/components/chatcompletionrequesttoolchoice.md @@ -16,6 +16,6 @@ const value: components.ToolChoice = { ### `components.ToolChoiceEnum` ```typescript -const value: components.ToolChoiceEnum = "required"; +const value: components.ToolChoiceEnum = "none"; ``` diff --git a/packages/mistralai-azure/docs/models/components/chatcompletionstreamrequesttoolchoice.md b/packages/mistralai-azure/docs/models/components/chatcompletionstreamrequesttoolchoice.md index d61fd6c..9f19e8c 100644 --- a/packages/mistralai-azure/docs/models/components/chatcompletionstreamrequesttoolchoice.md +++ b/packages/mistralai-azure/docs/models/components/chatcompletionstreamrequesttoolchoice.md @@ -16,6 +16,6 @@ const value: components.ToolChoice = { ### `components.ToolChoiceEnum` ```typescript -const value: components.ToolChoiceEnum = "auto"; +const value: components.ToolChoiceEnum = "required"; ``` diff --git a/packages/mistralai-azure/docs/models/components/contentchunk.md b/packages/mistralai-azure/docs/models/components/contentchunk.md index 0c7fa7d..2b797d0 100644 --- a/packages/mistralai-azure/docs/models/components/contentchunk.md +++ b/packages/mistralai-azure/docs/models/components/contentchunk.md @@ -11,3 +11,13 @@ const value: components.TextChunk = { }; ``` +### `components.ReferenceChunk` + +```typescript +const value: components.ReferenceChunk = { + referenceIds: [ + 568045, + ], +}; +``` + diff --git a/packages/mistralai-azure/docs/models/components/loc.md b/packages/mistralai-azure/docs/models/components/loc.md index 0d8fe4c..0e605c6 100644 --- a/packages/mistralai-azure/docs/models/components/loc.md +++ b/packages/mistralai-azure/docs/models/components/loc.md @@ -12,6 +12,6 @@ const value: string = ""; ### `number` ```typescript -const value: number = 528895; +const value: number = 71036; ``` diff --git a/packages/mistralai-azure/docs/models/components/messages.md b/packages/mistralai-azure/docs/models/components/messages.md index 020761e..e7a8229 100644 --- a/packages/mistralai-azure/docs/models/components/messages.md +++ b/packages/mistralai-azure/docs/models/components/messages.md @@ -21,7 +21,13 @@ const value: components.SystemMessage = { ```typescript const value: components.ToolMessage = { - content: "", + content: [ + { + referenceIds: [ + 870013, + ], + }, + ], }; ``` @@ -29,7 +35,13 @@ const value: components.ToolMessage = { ```typescript const value: components.UserMessage = { - content: "", + content: [ + { + referenceIds: [ + 461479, + ], + }, + ], }; ``` diff --git a/packages/mistralai-azure/docs/models/components/referencechunk.md b/packages/mistralai-azure/docs/models/components/referencechunk.md new file mode 100644 index 0000000..a0e9c95 --- /dev/null +++ b/packages/mistralai-azure/docs/models/components/referencechunk.md @@ -0,0 +1,20 @@ +# ReferenceChunk + +## Example Usage + +```typescript +import { ReferenceChunk } from "@mistralai/mistralai-azure/models/components"; + +let value: ReferenceChunk = { + referenceIds: [ + 925597, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `type` | [components.ReferenceChunkType](../../models/components/referencechunktype.md) | :heavy_minus_sign: | N/A | +| `referenceIds` | *number*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai-azure/docs/models/components/referencechunktype.md b/packages/mistralai-azure/docs/models/components/referencechunktype.md new file mode 100644 index 0000000..ffdeeb9 --- /dev/null +++ b/packages/mistralai-azure/docs/models/components/referencechunktype.md @@ -0,0 +1,15 @@ +# ReferenceChunkType + +## Example Usage + +```typescript +import { ReferenceChunkType } from "@mistralai/mistralai-azure/models/components"; + +let value: ReferenceChunkType = "reference"; +``` + +## Values + +```typescript +"reference" +``` \ No newline at end of file diff --git a/packages/mistralai-azure/docs/models/components/systemmessage.md b/packages/mistralai-azure/docs/models/components/systemmessage.md index 3e77bdf..a8f28d7 100644 --- a/packages/mistralai-azure/docs/models/components/systemmessage.md +++ b/packages/mistralai-azure/docs/models/components/systemmessage.md @@ -6,11 +6,7 @@ import { SystemMessage } from "@mistralai/mistralai-azure/models/components"; let value: SystemMessage = { - content: [ - { - text: "", - }, - ], + content: "", }; ``` diff --git a/packages/mistralai-azure/docs/models/components/toolcall.md b/packages/mistralai-azure/docs/models/components/toolcall.md index 227255f..bd7ba43 100644 --- a/packages/mistralai-azure/docs/models/components/toolcall.md +++ b/packages/mistralai-azure/docs/models/components/toolcall.md @@ -8,9 +8,7 @@ import { ToolCall } from "@mistralai/mistralai-azure/models/components"; let value: ToolCall = { function: { name: "", - arguments: { - "key": "", - }, + arguments: "", }, }; ``` diff --git a/packages/mistralai-azure/docs/models/components/toolchoiceenum.md b/packages/mistralai-azure/docs/models/components/toolchoiceenum.md index a9f24a4..dedc717 100644 --- a/packages/mistralai-azure/docs/models/components/toolchoiceenum.md +++ b/packages/mistralai-azure/docs/models/components/toolchoiceenum.md @@ -5,7 +5,7 @@ ```typescript import { ToolChoiceEnum } from "@mistralai/mistralai-azure/models/components"; -let value: ToolChoiceEnum = "required"; +let value: ToolChoiceEnum = "auto"; ``` ## Values diff --git a/packages/mistralai-azure/docs/models/components/toolmessage.md b/packages/mistralai-azure/docs/models/components/toolmessage.md index 1726428..20c350d 100644 --- a/packages/mistralai-azure/docs/models/components/toolmessage.md +++ b/packages/mistralai-azure/docs/models/components/toolmessage.md @@ -6,7 +6,11 @@ import { ToolMessage } from "@mistralai/mistralai-azure/models/components"; let value: ToolMessage = { - content: "", + content: [ + { + text: "", + }, + ], }; ``` @@ -14,7 +18,7 @@ let value: ToolMessage = { | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `content` | *string* | :heavy_check_mark: | N/A | +| `content` | *components.ToolMessageContent* | :heavy_check_mark: | N/A | | `toolCallId` | *string* | :heavy_minus_sign: | N/A | | `name` | *string* | :heavy_minus_sign: | N/A | | `role` | [components.ToolMessageRole](../../models/components/toolmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai-azure/docs/models/components/toolmessagecontent.md b/packages/mistralai-azure/docs/models/components/toolmessagecontent.md new file mode 100644 index 0000000..dad0dc9 --- /dev/null +++ b/packages/mistralai-azure/docs/models/components/toolmessagecontent.md @@ -0,0 +1,23 @@ +# ToolMessageContent + + +## Supported Types + +### `string` + +```typescript +const value: string = ""; +``` + +### `components.ContentChunk[]` + +```typescript +const value: components.ContentChunk[] = [ + { + referenceIds: [ + 456150, + ], + }, +]; +``` + diff --git a/packages/mistralai-azure/docs/models/components/usermessage.md b/packages/mistralai-azure/docs/models/components/usermessage.md index 2ea275f..491773a 100644 --- a/packages/mistralai-azure/docs/models/components/usermessage.md +++ b/packages/mistralai-azure/docs/models/components/usermessage.md @@ -6,11 +6,7 @@ import { UserMessage } from "@mistralai/mistralai-azure/models/components"; let value: UserMessage = { - content: [ - { - text: "", - }, - ], + content: "", }; ``` diff --git a/packages/mistralai-azure/docs/models/components/usermessagecontent.md b/packages/mistralai-azure/docs/models/components/usermessagecontent.md index f949165..7a02082 100644 --- a/packages/mistralai-azure/docs/models/components/usermessagecontent.md +++ b/packages/mistralai-azure/docs/models/components/usermessagecontent.md @@ -14,7 +14,9 @@ const value: string = ""; ```typescript const value: components.ContentChunk[] = [ { - text: "", + referenceIds: [ + 521848, + ], }, ]; ``` diff --git a/packages/mistralai-azure/docs/models/components/validationerror.md b/packages/mistralai-azure/docs/models/components/validationerror.md index a623216..155cdeb 100644 --- a/packages/mistralai-azure/docs/models/components/validationerror.md +++ b/packages/mistralai-azure/docs/models/components/validationerror.md @@ -7,7 +7,7 @@ import { ValidationError } from "@mistralai/mistralai-azure/models/components"; let value: ValidationError = { loc: [ - 925597, + "", ], msg: "", type: "", diff --git a/packages/mistralai-azure/jsr.json b/packages/mistralai-azure/jsr.json index 737c2a0..dd327c8 100644 --- a/packages/mistralai-azure/jsr.json +++ b/packages/mistralai-azure/jsr.json @@ -2,7 +2,7 @@ { "name": "@mistralai/mistralai-azure", - "version": "1.3.1", + "version": "1.3.4", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/packages/mistralai-azure/package-lock.json b/packages/mistralai-azure/package-lock.json index de08a45..4a53c75 100644 --- a/packages/mistralai-azure/package-lock.json +++ b/packages/mistralai-azure/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mistralai/mistralai-azure", - "version": "1.3.1", + "version": "1.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mistralai/mistralai-azure", - "version": "1.3.1", + "version": "1.3.4", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/packages/mistralai-azure/package.json b/packages/mistralai-azure/package.json index c726cec..47b434b 100644 --- a/packages/mistralai-azure/package.json +++ b/packages/mistralai-azure/package.json @@ -1,6 +1,6 @@ { "name": "@mistralai/mistralai-azure", - "version": "1.3.1", + "version": "1.3.4", "author": "Speakeasy", "main": "./index.js", "sideEffects": false, diff --git a/packages/mistralai-azure/src/lib/config.ts b/packages/mistralai-azure/src/lib/config.ts index ae57f62..ae356b9 100644 --- a/packages/mistralai-azure/src/lib/config.ts +++ b/packages/mistralai-azure/src/lib/config.ts @@ -55,8 +55,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.2", - sdkVersion: "1.3.1", + sdkVersion: "1.3.4", genVersion: "2.457.2", userAgent: - "speakeasy-sdk/typescript 1.3.1 2.457.2 0.0.2 @mistralai/mistralai-azure", + "speakeasy-sdk/typescript 1.3.4 2.457.2 0.0.2 @mistralai/mistralai-azure", } as const; diff --git a/packages/mistralai-azure/src/models/components/contentchunk.ts b/packages/mistralai-azure/src/models/components/contentchunk.ts index fdb2447..ba2c8ab 100644 --- a/packages/mistralai-azure/src/models/components/contentchunk.ts +++ b/packages/mistralai-azure/src/models/components/contentchunk.ts @@ -3,6 +3,12 @@ */ import * as z from "zod"; +import { + ReferenceChunk, + ReferenceChunk$inboundSchema, + ReferenceChunk$Outbound, + ReferenceChunk$outboundSchema, +} from "./referencechunk.js"; import { TextChunk, TextChunk$inboundSchema, @@ -10,24 +16,46 @@ import { TextChunk$outboundSchema, } from "./textchunk.js"; -export type ContentChunk = TextChunk; +export type ContentChunk = + | (TextChunk & { type: "text" }) + | (ReferenceChunk & { type: "reference" }); /** @internal */ export const ContentChunk$inboundSchema: z.ZodType< ContentChunk, z.ZodTypeDef, unknown -> = TextChunk$inboundSchema; +> = z.union([ + TextChunk$inboundSchema.and( + z.object({ type: z.literal("text") }).transform((v) => ({ type: v.type })), + ), + ReferenceChunk$inboundSchema.and( + z.object({ type: z.literal("reference") }).transform((v) => ({ + type: v.type, + })), + ), +]); /** @internal */ -export type ContentChunk$Outbound = TextChunk$Outbound; +export type ContentChunk$Outbound = + | (TextChunk$Outbound & { type: "text" }) + | (ReferenceChunk$Outbound & { type: "reference" }); /** @internal */ export const ContentChunk$outboundSchema: z.ZodType< ContentChunk$Outbound, z.ZodTypeDef, ContentChunk -> = TextChunk$outboundSchema; +> = z.union([ + TextChunk$outboundSchema.and( + z.object({ type: z.literal("text") }).transform((v) => ({ type: v.type })), + ), + ReferenceChunk$outboundSchema.and( + z.object({ type: z.literal("reference") }).transform((v) => ({ + type: v.type, + })), + ), +]); /** * @internal diff --git a/packages/mistralai-azure/src/models/components/index.ts b/packages/mistralai-azure/src/models/components/index.ts index 61ac48f..e29240a 100644 --- a/packages/mistralai-azure/src/models/components/index.ts +++ b/packages/mistralai-azure/src/models/components/index.ts @@ -15,6 +15,7 @@ export * from "./deltamessage.js"; export * from "./function.js"; export * from "./functioncall.js"; export * from "./functionname.js"; +export * from "./referencechunk.js"; export * from "./responseformat.js"; export * from "./responseformats.js"; export * from "./security.js"; diff --git a/packages/mistralai-azure/src/models/components/referencechunk.ts b/packages/mistralai-azure/src/models/components/referencechunk.ts new file mode 100644 index 0000000..d245ce3 --- /dev/null +++ b/packages/mistralai-azure/src/models/components/referencechunk.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; + +export const ReferenceChunkType = { + Reference: "reference", +} as const; +export type ReferenceChunkType = ClosedEnum; + +export type ReferenceChunk = { + type?: "reference" | undefined; + referenceIds: Array; +}; + +/** @internal */ +export const ReferenceChunkType$inboundSchema: z.ZodNativeEnum< + typeof ReferenceChunkType +> = z.nativeEnum(ReferenceChunkType); + +/** @internal */ +export const ReferenceChunkType$outboundSchema: z.ZodNativeEnum< + typeof ReferenceChunkType +> = ReferenceChunkType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ReferenceChunkType$ { + /** @deprecated use `ReferenceChunkType$inboundSchema` instead. */ + export const inboundSchema = ReferenceChunkType$inboundSchema; + /** @deprecated use `ReferenceChunkType$outboundSchema` instead. */ + export const outboundSchema = ReferenceChunkType$outboundSchema; +} + +/** @internal */ +export const ReferenceChunk$inboundSchema: z.ZodType< + ReferenceChunk, + z.ZodTypeDef, + unknown +> = z.object({ + type: z.literal("reference").default("reference"), + reference_ids: z.array(z.number().int()), +}).transform((v) => { + return remap$(v, { + "reference_ids": "referenceIds", + }); +}); + +/** @internal */ +export type ReferenceChunk$Outbound = { + type: "reference"; + reference_ids: Array; +}; + +/** @internal */ +export const ReferenceChunk$outboundSchema: z.ZodType< + ReferenceChunk$Outbound, + z.ZodTypeDef, + ReferenceChunk +> = z.object({ + type: z.literal("reference").default("reference"), + referenceIds: z.array(z.number().int()), +}).transform((v) => { + return remap$(v, { + referenceIds: "reference_ids", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ReferenceChunk$ { + /** @deprecated use `ReferenceChunk$inboundSchema` instead. */ + export const inboundSchema = ReferenceChunk$inboundSchema; + /** @deprecated use `ReferenceChunk$outboundSchema` instead. */ + export const outboundSchema = ReferenceChunk$outboundSchema; + /** @deprecated use `ReferenceChunk$Outbound` instead. */ + export type Outbound = ReferenceChunk$Outbound; +} diff --git a/packages/mistralai-azure/src/models/components/toolmessage.ts b/packages/mistralai-azure/src/models/components/toolmessage.ts index 566ea41..fd923fe 100644 --- a/packages/mistralai-azure/src/models/components/toolmessage.ts +++ b/packages/mistralai-azure/src/models/components/toolmessage.ts @@ -5,6 +5,14 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; +import { + ContentChunk, + ContentChunk$inboundSchema, + ContentChunk$Outbound, + ContentChunk$outboundSchema, +} from "./contentchunk.js"; + +export type ToolMessageContent = string | Array; export const ToolMessageRole = { Tool: "tool", @@ -12,12 +20,42 @@ export const ToolMessageRole = { export type ToolMessageRole = ClosedEnum; export type ToolMessage = { - content: string; + content: string | Array | null; toolCallId?: string | null | undefined; name?: string | null | undefined; role?: ToolMessageRole | undefined; }; +/** @internal */ +export const ToolMessageContent$inboundSchema: z.ZodType< + ToolMessageContent, + z.ZodTypeDef, + unknown +> = z.union([z.string(), z.array(ContentChunk$inboundSchema)]); + +/** @internal */ +export type ToolMessageContent$Outbound = string | Array; + +/** @internal */ +export const ToolMessageContent$outboundSchema: z.ZodType< + ToolMessageContent$Outbound, + z.ZodTypeDef, + ToolMessageContent +> = z.union([z.string(), z.array(ContentChunk$outboundSchema)]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ToolMessageContent$ { + /** @deprecated use `ToolMessageContent$inboundSchema` instead. */ + export const inboundSchema = ToolMessageContent$inboundSchema; + /** @deprecated use `ToolMessageContent$outboundSchema` instead. */ + export const outboundSchema = ToolMessageContent$outboundSchema; + /** @deprecated use `ToolMessageContent$Outbound` instead. */ + export type Outbound = ToolMessageContent$Outbound; +} + /** @internal */ export const ToolMessageRole$inboundSchema: z.ZodNativeEnum< typeof ToolMessageRole @@ -45,7 +83,9 @@ export const ToolMessage$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - content: z.string(), + content: z.nullable( + z.union([z.string(), z.array(ContentChunk$inboundSchema)]), + ), tool_call_id: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), role: ToolMessageRole$inboundSchema.default("tool"), @@ -57,7 +97,7 @@ export const ToolMessage$inboundSchema: z.ZodType< /** @internal */ export type ToolMessage$Outbound = { - content: string; + content: string | Array | null; tool_call_id?: string | null | undefined; name?: string | null | undefined; role: string; @@ -69,7 +109,9 @@ export const ToolMessage$outboundSchema: z.ZodType< z.ZodTypeDef, ToolMessage > = z.object({ - content: z.string(), + content: z.nullable( + z.union([z.string(), z.array(ContentChunk$outboundSchema)]), + ), toolCallId: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), role: ToolMessageRole$outboundSchema.default("tool"),