@mistralai/mistralai 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/sdks/models/README.md +1 -1
- package/examples/src/async_ocr_process_from_file.ts +2 -4
- package/funcs/modelsRetrieve.d.ts +1 -1
- package/funcs/modelsRetrieve.js +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agentscompletionrequest.d.ts +3 -0
- package/models/components/agentscompletionrequest.d.ts.map +1 -1
- package/models/components/agentscompletionrequest.js.map +1 -1
- package/models/components/agentscompletionstreamrequest.d.ts +3 -0
- package/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
- package/models/components/agentscompletionstreamrequest.js.map +1 -1
- package/models/components/basemodelcard.d.ts +2 -23
- package/models/components/basemodelcard.d.ts.map +1 -1
- package/models/components/basemodelcard.js +5 -19
- package/models/components/basemodelcard.js.map +1 -1
- package/models/components/chatcompletionrequest.d.ts +3 -0
- package/models/components/chatcompletionrequest.d.ts.map +1 -1
- package/models/components/chatcompletionrequest.js.map +1 -1
- package/models/components/chatcompletionstreamrequest.d.ts +3 -0
- package/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
- package/models/components/chatcompletionstreamrequest.js.map +1 -1
- package/models/components/contentchunk.d.ts +5 -0
- package/models/components/contentchunk.d.ts.map +1 -1
- package/models/components/contentchunk.js +3 -0
- package/models/components/contentchunk.js.map +1 -1
- package/models/components/conversationrestartrequest.d.ts +2 -2
- package/models/components/conversationrestartrequest.d.ts.map +1 -1
- package/models/components/conversationrestartrequest.js +4 -4
- package/models/components/conversationrestartrequest.js.map +1 -1
- package/models/components/conversationrestartstreamrequest.d.ts +2 -2
- package/models/components/conversationrestartstreamrequest.d.ts.map +1 -1
- package/models/components/conversationrestartstreamrequest.js +4 -4
- package/models/components/conversationrestartstreamrequest.js.map +1 -1
- package/models/components/filechunk.d.ts +31 -0
- package/models/components/filechunk.d.ts.map +1 -0
- package/models/components/filechunk.js +70 -0
- package/models/components/filechunk.js.map +1 -0
- package/models/components/ftmodelcard.d.ts +2 -23
- package/models/components/ftmodelcard.d.ts.map +1 -1
- package/models/components/ftmodelcard.js +5 -19
- package/models/components/ftmodelcard.js.map +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/inputentries.d.ts +6 -2
- package/models/components/inputentries.d.ts.map +1 -1
- package/models/components/inputentries.js +12 -0
- package/models/components/inputentries.js.map +1 -1
- package/models/components/messageinputentry.d.ts +8 -8
- package/models/components/messageinputentry.d.ts.map +1 -1
- package/models/components/messageinputentry.js +13 -13
- package/models/components/messageinputentry.js.map +1 -1
- package/models/components/modelcapabilities.d.ts +2 -0
- package/models/components/modelcapabilities.d.ts.map +1 -1
- package/models/components/modelcapabilities.js +2 -0
- package/models/components/modelcapabilities.js.map +1 -1
- package/models/components/ocrrequest.d.ts +5 -4
- package/models/components/ocrrequest.d.ts.map +1 -1
- package/models/components/ocrrequest.js +13 -2
- package/models/components/ocrrequest.js.map +1 -1
- package/models/operations/agentsapiv1conversationsget.d.ts +3 -0
- package/models/operations/agentsapiv1conversationsget.d.ts.map +1 -1
- package/models/operations/agentsapiv1conversationsget.js.map +1 -1
- package/models/operations/agentsapiv1conversationshistory.d.ts +3 -0
- package/models/operations/agentsapiv1conversationshistory.d.ts.map +1 -1
- package/models/operations/agentsapiv1conversationshistory.js.map +1 -1
- package/models/operations/agentsapiv1conversationsmessages.d.ts +3 -0
- package/models/operations/agentsapiv1conversationsmessages.d.ts.map +1 -1
- package/models/operations/agentsapiv1conversationsmessages.js.map +1 -1
- package/models/operations/agentsapiv1conversationsrestart.d.ts +3 -0
- package/models/operations/agentsapiv1conversationsrestart.d.ts.map +1 -1
- package/models/operations/agentsapiv1conversationsrestart.js.map +1 -1
- package/models/operations/agentsapiv1conversationsrestartstream.d.ts +3 -0
- package/models/operations/agentsapiv1conversationsrestartstream.d.ts.map +1 -1
- package/models/operations/agentsapiv1conversationsrestartstream.js.map +1 -1
- package/package.json +1 -1
- package/sdk/models.d.ts +1 -1
- package/sdk/models.js +1 -1
- package/src/funcs/modelsRetrieve.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentscompletionrequest.ts +3 -0
- package/src/models/components/agentscompletionstreamrequest.ts +3 -0
- package/src/models/components/basemodelcard.ts +7 -27
- package/src/models/components/chatcompletionrequest.ts +3 -0
- package/src/models/components/chatcompletionstreamrequest.ts +3 -0
- package/src/models/components/contentchunk.ts +14 -0
- package/src/models/components/conversationrestartrequest.ts +6 -6
- package/src/models/components/conversationrestartstreamrequest.ts +6 -6
- package/src/models/components/filechunk.ts +75 -0
- package/src/models/components/ftmodelcard.ts +7 -28
- package/src/models/components/index.ts +1 -0
- package/src/models/components/inputentries.ts +44 -2
- package/src/models/components/messageinputentry.ts +15 -16
- package/src/models/components/modelcapabilities.ts +4 -0
- package/src/models/components/ocrrequest.ts +25 -5
- package/src/models/operations/agentsapiv1conversationsget.ts +3 -0
- package/src/models/operations/agentsapiv1conversationshistory.ts +3 -0
- package/src/models/operations/agentsapiv1conversationsmessages.ts +3 -0
- package/src/models/operations/agentsapiv1conversationsrestart.ts +3 -0
- package/src/models/operations/agentsapiv1conversationsrestartstream.ts +3 -0
- package/src/sdk/models.ts +1 -1
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
10
|
import {
|
|
@@ -15,11 +14,6 @@ import {
|
|
|
15
14
|
ModelCapabilities$outboundSchema,
|
|
16
15
|
} from "./modelcapabilities.js";
|
|
17
16
|
|
|
18
|
-
export const Type = {
|
|
19
|
-
Base: "base",
|
|
20
|
-
} as const;
|
|
21
|
-
export type Type = ClosedEnum<typeof Type>;
|
|
22
|
-
|
|
23
17
|
export type BaseModelCard = {
|
|
24
18
|
id: string;
|
|
25
19
|
object?: string | undefined;
|
|
@@ -31,30 +25,11 @@ export type BaseModelCard = {
|
|
|
31
25
|
maxContextLength?: number | undefined;
|
|
32
26
|
aliases?: Array<string> | undefined;
|
|
33
27
|
deprecation?: Date | null | undefined;
|
|
28
|
+
deprecationReplacementModel?: string | null | undefined;
|
|
34
29
|
defaultModelTemperature?: number | null | undefined;
|
|
35
30
|
type?: "base" | undefined;
|
|
36
31
|
};
|
|
37
32
|
|
|
38
|
-
/** @internal */
|
|
39
|
-
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
40
|
-
Type,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
/** @internal */
|
|
44
|
-
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
45
|
-
Type$inboundSchema;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @internal
|
|
49
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
50
|
-
*/
|
|
51
|
-
export namespace Type$ {
|
|
52
|
-
/** @deprecated use `Type$inboundSchema` instead. */
|
|
53
|
-
export const inboundSchema = Type$inboundSchema;
|
|
54
|
-
/** @deprecated use `Type$outboundSchema` instead. */
|
|
55
|
-
export const outboundSchema = Type$outboundSchema;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
33
|
/** @internal */
|
|
59
34
|
export const BaseModelCard$inboundSchema: z.ZodType<
|
|
60
35
|
BaseModelCard,
|
|
@@ -73,12 +48,14 @@ export const BaseModelCard$inboundSchema: z.ZodType<
|
|
|
73
48
|
deprecation: z.nullable(
|
|
74
49
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
75
50
|
).optional(),
|
|
51
|
+
deprecation_replacement_model: z.nullable(z.string()).optional(),
|
|
76
52
|
default_model_temperature: z.nullable(z.number()).optional(),
|
|
77
53
|
type: z.literal("base").default("base"),
|
|
78
54
|
}).transform((v) => {
|
|
79
55
|
return remap$(v, {
|
|
80
56
|
"owned_by": "ownedBy",
|
|
81
57
|
"max_context_length": "maxContextLength",
|
|
58
|
+
"deprecation_replacement_model": "deprecationReplacementModel",
|
|
82
59
|
"default_model_temperature": "defaultModelTemperature",
|
|
83
60
|
});
|
|
84
61
|
});
|
|
@@ -95,6 +72,7 @@ export type BaseModelCard$Outbound = {
|
|
|
95
72
|
max_context_length: number;
|
|
96
73
|
aliases?: Array<string> | undefined;
|
|
97
74
|
deprecation?: string | null | undefined;
|
|
75
|
+
deprecation_replacement_model?: string | null | undefined;
|
|
98
76
|
default_model_temperature?: number | null | undefined;
|
|
99
77
|
type: "base";
|
|
100
78
|
};
|
|
@@ -115,12 +93,14 @@ export const BaseModelCard$outboundSchema: z.ZodType<
|
|
|
115
93
|
maxContextLength: z.number().int().default(32768),
|
|
116
94
|
aliases: z.array(z.string()).optional(),
|
|
117
95
|
deprecation: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
96
|
+
deprecationReplacementModel: z.nullable(z.string()).optional(),
|
|
118
97
|
defaultModelTemperature: z.nullable(z.number()).optional(),
|
|
119
|
-
type: z.literal("base").default("base"),
|
|
98
|
+
type: z.literal("base").default("base" as const),
|
|
120
99
|
}).transform((v) => {
|
|
121
100
|
return remap$(v, {
|
|
122
101
|
ownedBy: "owned_by",
|
|
123
102
|
maxContextLength: "max_context_length",
|
|
103
|
+
deprecationReplacementModel: "deprecation_replacement_model",
|
|
124
104
|
defaultModelTemperature: "default_model_temperature",
|
|
125
105
|
});
|
|
126
106
|
});
|
|
@@ -134,6 +134,9 @@ export type ChatCompletionRequest = {
|
|
|
134
134
|
n?: number | null | undefined;
|
|
135
135
|
prediction?: Prediction | undefined;
|
|
136
136
|
parallelToolCalls?: boolean | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
139
|
+
*/
|
|
137
140
|
promptMode?: MistralPromptMode | null | undefined;
|
|
138
141
|
/**
|
|
139
142
|
* Whether to inject a safety prompt before all conversations.
|
|
@@ -131,6 +131,9 @@ export type ChatCompletionStreamRequest = {
|
|
|
131
131
|
n?: number | null | undefined;
|
|
132
132
|
prediction?: Prediction | undefined;
|
|
133
133
|
parallelToolCalls?: boolean | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
136
|
+
*/
|
|
134
137
|
promptMode?: MistralPromptMode | null | undefined;
|
|
135
138
|
/**
|
|
136
139
|
* Whether to inject a safety prompt before all conversations.
|
|
@@ -12,6 +12,12 @@ import {
|
|
|
12
12
|
DocumentURLChunk$Outbound,
|
|
13
13
|
DocumentURLChunk$outboundSchema,
|
|
14
14
|
} from "./documenturlchunk.js";
|
|
15
|
+
import {
|
|
16
|
+
FileChunk,
|
|
17
|
+
FileChunk$inboundSchema,
|
|
18
|
+
FileChunk$Outbound,
|
|
19
|
+
FileChunk$outboundSchema,
|
|
20
|
+
} from "./filechunk.js";
|
|
15
21
|
import {
|
|
16
22
|
ImageURLChunk,
|
|
17
23
|
ImageURLChunk$inboundSchema,
|
|
@@ -35,6 +41,7 @@ export type ContentChunk =
|
|
|
35
41
|
| (ImageURLChunk & { type: "image_url" })
|
|
36
42
|
| (TextChunk & { type: "text" })
|
|
37
43
|
| (ReferenceChunk & { type: "reference" })
|
|
44
|
+
| (FileChunk & { type: "file" })
|
|
38
45
|
| (DocumentURLChunk & { type: "document_url" });
|
|
39
46
|
|
|
40
47
|
/** @internal */
|
|
@@ -56,6 +63,9 @@ export const ContentChunk$inboundSchema: z.ZodType<
|
|
|
56
63
|
type: v.type,
|
|
57
64
|
})),
|
|
58
65
|
),
|
|
66
|
+
FileChunk$inboundSchema.and(
|
|
67
|
+
z.object({ type: z.literal("file") }).transform((v) => ({ type: v.type })),
|
|
68
|
+
),
|
|
59
69
|
DocumentURLChunk$inboundSchema.and(
|
|
60
70
|
z.object({ type: z.literal("document_url") }).transform((v) => ({
|
|
61
71
|
type: v.type,
|
|
@@ -68,6 +78,7 @@ export type ContentChunk$Outbound =
|
|
|
68
78
|
| (ImageURLChunk$Outbound & { type: "image_url" })
|
|
69
79
|
| (TextChunk$Outbound & { type: "text" })
|
|
70
80
|
| (ReferenceChunk$Outbound & { type: "reference" })
|
|
81
|
+
| (FileChunk$Outbound & { type: "file" })
|
|
71
82
|
| (DocumentURLChunk$Outbound & { type: "document_url" });
|
|
72
83
|
|
|
73
84
|
/** @internal */
|
|
@@ -89,6 +100,9 @@ export const ContentChunk$outboundSchema: z.ZodType<
|
|
|
89
100
|
type: v.type,
|
|
90
101
|
})),
|
|
91
102
|
),
|
|
103
|
+
FileChunk$outboundSchema.and(
|
|
104
|
+
z.object({ type: z.literal("file") }).transform((v) => ({ type: v.type })),
|
|
105
|
+
),
|
|
92
106
|
DocumentURLChunk$outboundSchema.and(
|
|
93
107
|
z.object({ type: z.literal("document_url") }).transform((v) => ({
|
|
94
108
|
type: v.type,
|
|
@@ -40,11 +40,11 @@ export type ConversationRestartRequest = {
|
|
|
40
40
|
*/
|
|
41
41
|
store?: boolean | undefined;
|
|
42
42
|
handoffExecution?: ConversationRestartRequestHandoffExecution | undefined;
|
|
43
|
-
fromEntryId: string;
|
|
44
43
|
/**
|
|
45
44
|
* White-listed arguments from the completion API
|
|
46
45
|
*/
|
|
47
46
|
completionArgs?: CompletionArgs | undefined;
|
|
47
|
+
fromEntryId: string;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
/** @internal */
|
|
@@ -81,13 +81,13 @@ export const ConversationRestartRequest$inboundSchema: z.ZodType<
|
|
|
81
81
|
store: z.boolean().default(true),
|
|
82
82
|
handoff_execution: ConversationRestartRequestHandoffExecution$inboundSchema
|
|
83
83
|
.default("server"),
|
|
84
|
-
from_entry_id: z.string(),
|
|
85
84
|
completion_args: CompletionArgs$inboundSchema.optional(),
|
|
85
|
+
from_entry_id: z.string(),
|
|
86
86
|
}).transform((v) => {
|
|
87
87
|
return remap$(v, {
|
|
88
88
|
"handoff_execution": "handoffExecution",
|
|
89
|
-
"from_entry_id": "fromEntryId",
|
|
90
89
|
"completion_args": "completionArgs",
|
|
90
|
+
"from_entry_id": "fromEntryId",
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -97,8 +97,8 @@ export type ConversationRestartRequest$Outbound = {
|
|
|
97
97
|
stream: boolean;
|
|
98
98
|
store: boolean;
|
|
99
99
|
handoff_execution: string;
|
|
100
|
-
from_entry_id: string;
|
|
101
100
|
completion_args?: CompletionArgs$Outbound | undefined;
|
|
101
|
+
from_entry_id: string;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
/** @internal */
|
|
@@ -112,13 +112,13 @@ export const ConversationRestartRequest$outboundSchema: z.ZodType<
|
|
|
112
112
|
store: z.boolean().default(true),
|
|
113
113
|
handoffExecution: ConversationRestartRequestHandoffExecution$outboundSchema
|
|
114
114
|
.default("server"),
|
|
115
|
-
fromEntryId: z.string(),
|
|
116
115
|
completionArgs: CompletionArgs$outboundSchema.optional(),
|
|
116
|
+
fromEntryId: z.string(),
|
|
117
117
|
}).transform((v) => {
|
|
118
118
|
return remap$(v, {
|
|
119
119
|
handoffExecution: "handoff_execution",
|
|
120
|
-
fromEntryId: "from_entry_id",
|
|
121
120
|
completionArgs: "completion_args",
|
|
121
|
+
fromEntryId: "from_entry_id",
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
|
|
@@ -42,11 +42,11 @@ export type ConversationRestartStreamRequest = {
|
|
|
42
42
|
handoffExecution?:
|
|
43
43
|
| ConversationRestartStreamRequestHandoffExecution
|
|
44
44
|
| undefined;
|
|
45
|
-
fromEntryId: string;
|
|
46
45
|
/**
|
|
47
46
|
* White-listed arguments from the completion API
|
|
48
47
|
*/
|
|
49
48
|
completionArgs?: CompletionArgs | undefined;
|
|
49
|
+
fromEntryId: string;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/** @internal */
|
|
@@ -85,13 +85,13 @@ export const ConversationRestartStreamRequest$inboundSchema: z.ZodType<
|
|
|
85
85
|
ConversationRestartStreamRequestHandoffExecution$inboundSchema.default(
|
|
86
86
|
"server",
|
|
87
87
|
),
|
|
88
|
-
from_entry_id: z.string(),
|
|
89
88
|
completion_args: CompletionArgs$inboundSchema.optional(),
|
|
89
|
+
from_entry_id: z.string(),
|
|
90
90
|
}).transform((v) => {
|
|
91
91
|
return remap$(v, {
|
|
92
92
|
"handoff_execution": "handoffExecution",
|
|
93
|
-
"from_entry_id": "fromEntryId",
|
|
94
93
|
"completion_args": "completionArgs",
|
|
94
|
+
"from_entry_id": "fromEntryId",
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
|
|
@@ -101,8 +101,8 @@ export type ConversationRestartStreamRequest$Outbound = {
|
|
|
101
101
|
stream: boolean;
|
|
102
102
|
store: boolean;
|
|
103
103
|
handoff_execution: string;
|
|
104
|
-
from_entry_id: string;
|
|
105
104
|
completion_args?: CompletionArgs$Outbound | undefined;
|
|
105
|
+
from_entry_id: string;
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
/** @internal */
|
|
@@ -118,13 +118,13 @@ export const ConversationRestartStreamRequest$outboundSchema: z.ZodType<
|
|
|
118
118
|
ConversationRestartStreamRequestHandoffExecution$outboundSchema.default(
|
|
119
119
|
"server",
|
|
120
120
|
),
|
|
121
|
-
fromEntryId: z.string(),
|
|
122
121
|
completionArgs: CompletionArgs$outboundSchema.optional(),
|
|
122
|
+
fromEntryId: z.string(),
|
|
123
123
|
}).transform((v) => {
|
|
124
124
|
return remap$(v, {
|
|
125
125
|
handoffExecution: "handoff_execution",
|
|
126
|
-
fromEntryId: "from_entry_id",
|
|
127
126
|
completionArgs: "completion_args",
|
|
127
|
+
fromEntryId: "from_entry_id",
|
|
128
128
|
});
|
|
129
129
|
});
|
|
130
130
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type FileChunk = {
|
|
12
|
+
type?: "file" | undefined;
|
|
13
|
+
fileId: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const FileChunk$inboundSchema: z.ZodType<
|
|
18
|
+
FileChunk,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
type: z.literal("file").default("file"),
|
|
23
|
+
file_id: z.string(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"file_id": "fileId",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type FileChunk$Outbound = {
|
|
32
|
+
type: "file";
|
|
33
|
+
file_id: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const FileChunk$outboundSchema: z.ZodType<
|
|
38
|
+
FileChunk$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
FileChunk
|
|
41
|
+
> = z.object({
|
|
42
|
+
type: z.literal("file").default("file" as const),
|
|
43
|
+
fileId: z.string(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
fileId: "file_id",
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
53
|
+
*/
|
|
54
|
+
export namespace FileChunk$ {
|
|
55
|
+
/** @deprecated use `FileChunk$inboundSchema` instead. */
|
|
56
|
+
export const inboundSchema = FileChunk$inboundSchema;
|
|
57
|
+
/** @deprecated use `FileChunk$outboundSchema` instead. */
|
|
58
|
+
export const outboundSchema = FileChunk$outboundSchema;
|
|
59
|
+
/** @deprecated use `FileChunk$Outbound` instead. */
|
|
60
|
+
export type Outbound = FileChunk$Outbound;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function fileChunkToJSON(fileChunk: FileChunk): string {
|
|
64
|
+
return JSON.stringify(FileChunk$outboundSchema.parse(fileChunk));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function fileChunkFromJSON(
|
|
68
|
+
jsonString: string,
|
|
69
|
+
): SafeParseResult<FileChunk, SDKValidationError> {
|
|
70
|
+
return safeParse(
|
|
71
|
+
jsonString,
|
|
72
|
+
(x) => FileChunk$inboundSchema.parse(JSON.parse(x)),
|
|
73
|
+
`Failed to parse 'FileChunk' from JSON`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
10
|
import {
|
|
@@ -15,11 +14,6 @@ import {
|
|
|
15
14
|
ModelCapabilities$outboundSchema,
|
|
16
15
|
} from "./modelcapabilities.js";
|
|
17
16
|
|
|
18
|
-
export const FTModelCardType = {
|
|
19
|
-
FineTuned: "fine-tuned",
|
|
20
|
-
} as const;
|
|
21
|
-
export type FTModelCardType = ClosedEnum<typeof FTModelCardType>;
|
|
22
|
-
|
|
23
17
|
/**
|
|
24
18
|
* Extra fields for fine-tuned models.
|
|
25
19
|
*/
|
|
@@ -34,6 +28,7 @@ export type FTModelCard = {
|
|
|
34
28
|
maxContextLength?: number | undefined;
|
|
35
29
|
aliases?: Array<string> | undefined;
|
|
36
30
|
deprecation?: Date | null | undefined;
|
|
31
|
+
deprecationReplacementModel?: string | null | undefined;
|
|
37
32
|
defaultModelTemperature?: number | null | undefined;
|
|
38
33
|
type?: "fine-tuned" | undefined;
|
|
39
34
|
job: string;
|
|
@@ -41,27 +36,6 @@ export type FTModelCard = {
|
|
|
41
36
|
archived?: boolean | undefined;
|
|
42
37
|
};
|
|
43
38
|
|
|
44
|
-
/** @internal */
|
|
45
|
-
export const FTModelCardType$inboundSchema: z.ZodNativeEnum<
|
|
46
|
-
typeof FTModelCardType
|
|
47
|
-
> = z.nativeEnum(FTModelCardType);
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const FTModelCardType$outboundSchema: z.ZodNativeEnum<
|
|
51
|
-
typeof FTModelCardType
|
|
52
|
-
> = FTModelCardType$inboundSchema;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
-
*/
|
|
58
|
-
export namespace FTModelCardType$ {
|
|
59
|
-
/** @deprecated use `FTModelCardType$inboundSchema` instead. */
|
|
60
|
-
export const inboundSchema = FTModelCardType$inboundSchema;
|
|
61
|
-
/** @deprecated use `FTModelCardType$outboundSchema` instead. */
|
|
62
|
-
export const outboundSchema = FTModelCardType$outboundSchema;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
39
|
/** @internal */
|
|
66
40
|
export const FTModelCard$inboundSchema: z.ZodType<
|
|
67
41
|
FTModelCard,
|
|
@@ -80,6 +54,7 @@ export const FTModelCard$inboundSchema: z.ZodType<
|
|
|
80
54
|
deprecation: z.nullable(
|
|
81
55
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
82
56
|
).optional(),
|
|
57
|
+
deprecation_replacement_model: z.nullable(z.string()).optional(),
|
|
83
58
|
default_model_temperature: z.nullable(z.number()).optional(),
|
|
84
59
|
type: z.literal("fine-tuned").default("fine-tuned"),
|
|
85
60
|
job: z.string(),
|
|
@@ -89,6 +64,7 @@ export const FTModelCard$inboundSchema: z.ZodType<
|
|
|
89
64
|
return remap$(v, {
|
|
90
65
|
"owned_by": "ownedBy",
|
|
91
66
|
"max_context_length": "maxContextLength",
|
|
67
|
+
"deprecation_replacement_model": "deprecationReplacementModel",
|
|
92
68
|
"default_model_temperature": "defaultModelTemperature",
|
|
93
69
|
});
|
|
94
70
|
});
|
|
@@ -105,6 +81,7 @@ export type FTModelCard$Outbound = {
|
|
|
105
81
|
max_context_length: number;
|
|
106
82
|
aliases?: Array<string> | undefined;
|
|
107
83
|
deprecation?: string | null | undefined;
|
|
84
|
+
deprecation_replacement_model?: string | null | undefined;
|
|
108
85
|
default_model_temperature?: number | null | undefined;
|
|
109
86
|
type: "fine-tuned";
|
|
110
87
|
job: string;
|
|
@@ -128,8 +105,9 @@ export const FTModelCard$outboundSchema: z.ZodType<
|
|
|
128
105
|
maxContextLength: z.number().int().default(32768),
|
|
129
106
|
aliases: z.array(z.string()).optional(),
|
|
130
107
|
deprecation: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
108
|
+
deprecationReplacementModel: z.nullable(z.string()).optional(),
|
|
131
109
|
defaultModelTemperature: z.nullable(z.number()).optional(),
|
|
132
|
-
type: z.literal("fine-tuned").default("fine-tuned"),
|
|
110
|
+
type: z.literal("fine-tuned").default("fine-tuned" as const),
|
|
133
111
|
job: z.string(),
|
|
134
112
|
root: z.string(),
|
|
135
113
|
archived: z.boolean().default(false),
|
|
@@ -137,6 +115,7 @@ export const FTModelCard$outboundSchema: z.ZodType<
|
|
|
137
115
|
return remap$(v, {
|
|
138
116
|
ownedBy: "owned_by",
|
|
139
117
|
maxContextLength: "max_context_length",
|
|
118
|
+
deprecationReplacementModel: "deprecation_replacement_model",
|
|
140
119
|
defaultModelTemperature: "default_model_temperature",
|
|
141
120
|
});
|
|
142
121
|
});
|
|
@@ -72,6 +72,7 @@ export * from "./embeddingrequest.js";
|
|
|
72
72
|
export * from "./embeddingresponse.js";
|
|
73
73
|
export * from "./embeddingresponsedata.js";
|
|
74
74
|
export * from "./eventout.js";
|
|
75
|
+
export * from "./filechunk.js";
|
|
75
76
|
export * from "./filepurpose.js";
|
|
76
77
|
export * from "./fileschema.js";
|
|
77
78
|
export * from "./filesignedurl.js";
|
|
@@ -6,6 +6,18 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
AgentHandoffEntry,
|
|
11
|
+
AgentHandoffEntry$inboundSchema,
|
|
12
|
+
AgentHandoffEntry$Outbound,
|
|
13
|
+
AgentHandoffEntry$outboundSchema,
|
|
14
|
+
} from "./agenthandoffentry.js";
|
|
15
|
+
import {
|
|
16
|
+
FunctionCallEntry,
|
|
17
|
+
FunctionCallEntry$inboundSchema,
|
|
18
|
+
FunctionCallEntry$Outbound,
|
|
19
|
+
FunctionCallEntry$outboundSchema,
|
|
20
|
+
} from "./functioncallentry.js";
|
|
9
21
|
import {
|
|
10
22
|
FunctionResultEntry,
|
|
11
23
|
FunctionResultEntry$inboundSchema,
|
|
@@ -18,8 +30,26 @@ import {
|
|
|
18
30
|
MessageInputEntry$Outbound,
|
|
19
31
|
MessageInputEntry$outboundSchema,
|
|
20
32
|
} from "./messageinputentry.js";
|
|
33
|
+
import {
|
|
34
|
+
MessageOutputEntry,
|
|
35
|
+
MessageOutputEntry$inboundSchema,
|
|
36
|
+
MessageOutputEntry$Outbound,
|
|
37
|
+
MessageOutputEntry$outboundSchema,
|
|
38
|
+
} from "./messageoutputentry.js";
|
|
39
|
+
import {
|
|
40
|
+
ToolExecutionEntry,
|
|
41
|
+
ToolExecutionEntry$inboundSchema,
|
|
42
|
+
ToolExecutionEntry$Outbound,
|
|
43
|
+
ToolExecutionEntry$outboundSchema,
|
|
44
|
+
} from "./toolexecutionentry.js";
|
|
21
45
|
|
|
22
|
-
export type InputEntries =
|
|
46
|
+
export type InputEntries =
|
|
47
|
+
| MessageInputEntry
|
|
48
|
+
| FunctionResultEntry
|
|
49
|
+
| ToolExecutionEntry
|
|
50
|
+
| FunctionCallEntry
|
|
51
|
+
| MessageOutputEntry
|
|
52
|
+
| AgentHandoffEntry;
|
|
23
53
|
|
|
24
54
|
/** @internal */
|
|
25
55
|
export const InputEntries$inboundSchema: z.ZodType<
|
|
@@ -29,12 +59,20 @@ export const InputEntries$inboundSchema: z.ZodType<
|
|
|
29
59
|
> = z.union([
|
|
30
60
|
MessageInputEntry$inboundSchema,
|
|
31
61
|
FunctionResultEntry$inboundSchema,
|
|
62
|
+
ToolExecutionEntry$inboundSchema,
|
|
63
|
+
FunctionCallEntry$inboundSchema,
|
|
64
|
+
MessageOutputEntry$inboundSchema,
|
|
65
|
+
AgentHandoffEntry$inboundSchema,
|
|
32
66
|
]);
|
|
33
67
|
|
|
34
68
|
/** @internal */
|
|
35
69
|
export type InputEntries$Outbound =
|
|
36
70
|
| MessageInputEntry$Outbound
|
|
37
|
-
| FunctionResultEntry$Outbound
|
|
71
|
+
| FunctionResultEntry$Outbound
|
|
72
|
+
| ToolExecutionEntry$Outbound
|
|
73
|
+
| FunctionCallEntry$Outbound
|
|
74
|
+
| MessageOutputEntry$Outbound
|
|
75
|
+
| AgentHandoffEntry$Outbound;
|
|
38
76
|
|
|
39
77
|
/** @internal */
|
|
40
78
|
export const InputEntries$outboundSchema: z.ZodType<
|
|
@@ -44,6 +82,10 @@ export const InputEntries$outboundSchema: z.ZodType<
|
|
|
44
82
|
> = z.union([
|
|
45
83
|
MessageInputEntry$outboundSchema,
|
|
46
84
|
FunctionResultEntry$outboundSchema,
|
|
85
|
+
ToolExecutionEntry$outboundSchema,
|
|
86
|
+
FunctionCallEntry$outboundSchema,
|
|
87
|
+
MessageOutputEntry$outboundSchema,
|
|
88
|
+
AgentHandoffEntry$outboundSchema,
|
|
47
89
|
]);
|
|
48
90
|
|
|
49
91
|
/**
|
|
@@ -20,10 +20,10 @@ export const ObjectT = {
|
|
|
20
20
|
} as const;
|
|
21
21
|
export type ObjectT = ClosedEnum<typeof ObjectT>;
|
|
22
22
|
|
|
23
|
-
export const
|
|
23
|
+
export const Type = {
|
|
24
24
|
MessageInput: "message.input",
|
|
25
25
|
} as const;
|
|
26
|
-
export type
|
|
26
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
27
27
|
|
|
28
28
|
export const MessageInputEntryRole = {
|
|
29
29
|
Assistant: "assistant",
|
|
@@ -40,7 +40,7 @@ export type MessageInputEntryContent =
|
|
|
40
40
|
*/
|
|
41
41
|
export type MessageInputEntry = {
|
|
42
42
|
object?: ObjectT | undefined;
|
|
43
|
-
type?:
|
|
43
|
+
type?: Type | undefined;
|
|
44
44
|
createdAt?: Date | undefined;
|
|
45
45
|
completedAt?: Date | null | undefined;
|
|
46
46
|
id?: string | undefined;
|
|
@@ -68,24 +68,23 @@ export namespace ObjectT$ {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/** @internal */
|
|
71
|
-
export const
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
72
|
+
Type,
|
|
73
|
+
);
|
|
74
74
|
|
|
75
75
|
/** @internal */
|
|
76
|
-
export const
|
|
77
|
-
|
|
78
|
-
> = MessageInputEntryType$inboundSchema;
|
|
76
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
77
|
+
Type$inboundSchema;
|
|
79
78
|
|
|
80
79
|
/**
|
|
81
80
|
* @internal
|
|
82
81
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
83
82
|
*/
|
|
84
|
-
export namespace
|
|
85
|
-
/** @deprecated use `
|
|
86
|
-
export const inboundSchema =
|
|
87
|
-
/** @deprecated use `
|
|
88
|
-
export const outboundSchema =
|
|
83
|
+
export namespace Type$ {
|
|
84
|
+
/** @deprecated use `Type$inboundSchema` instead. */
|
|
85
|
+
export const inboundSchema = Type$inboundSchema;
|
|
86
|
+
/** @deprecated use `Type$outboundSchema` instead. */
|
|
87
|
+
export const outboundSchema = Type$outboundSchema;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
/** @internal */
|
|
@@ -166,7 +165,7 @@ export const MessageInputEntry$inboundSchema: z.ZodType<
|
|
|
166
165
|
unknown
|
|
167
166
|
> = z.object({
|
|
168
167
|
object: ObjectT$inboundSchema.default("entry"),
|
|
169
|
-
type:
|
|
168
|
+
type: Type$inboundSchema.default("message.input"),
|
|
170
169
|
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
171
170
|
.optional(),
|
|
172
171
|
completed_at: z.nullable(
|
|
@@ -203,7 +202,7 @@ export const MessageInputEntry$outboundSchema: z.ZodType<
|
|
|
203
202
|
MessageInputEntry
|
|
204
203
|
> = z.object({
|
|
205
204
|
object: ObjectT$outboundSchema.default("entry"),
|
|
206
|
-
type:
|
|
205
|
+
type: Type$outboundSchema.default("message.input"),
|
|
207
206
|
createdAt: z.date().transform(v => v.toISOString()).optional(),
|
|
208
207
|
completedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
209
208
|
id: z.string().optional(),
|
|
@@ -14,6 +14,7 @@ export type ModelCapabilities = {
|
|
|
14
14
|
functionCalling?: boolean | undefined;
|
|
15
15
|
fineTuning?: boolean | undefined;
|
|
16
16
|
vision?: boolean | undefined;
|
|
17
|
+
classification?: boolean | undefined;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
/** @internal */
|
|
@@ -27,6 +28,7 @@ export const ModelCapabilities$inboundSchema: z.ZodType<
|
|
|
27
28
|
function_calling: z.boolean().default(true),
|
|
28
29
|
fine_tuning: z.boolean().default(false),
|
|
29
30
|
vision: z.boolean().default(false),
|
|
31
|
+
classification: z.boolean().default(false),
|
|
30
32
|
}).transform((v) => {
|
|
31
33
|
return remap$(v, {
|
|
32
34
|
"completion_chat": "completionChat",
|
|
@@ -43,6 +45,7 @@ export type ModelCapabilities$Outbound = {
|
|
|
43
45
|
function_calling: boolean;
|
|
44
46
|
fine_tuning: boolean;
|
|
45
47
|
vision: boolean;
|
|
48
|
+
classification: boolean;
|
|
46
49
|
};
|
|
47
50
|
|
|
48
51
|
/** @internal */
|
|
@@ -56,6 +59,7 @@ export const ModelCapabilities$outboundSchema: z.ZodType<
|
|
|
56
59
|
functionCalling: z.boolean().default(true),
|
|
57
60
|
fineTuning: z.boolean().default(false),
|
|
58
61
|
vision: z.boolean().default(false),
|
|
62
|
+
classification: z.boolean().default(false),
|
|
59
63
|
}).transform((v) => {
|
|
60
64
|
return remap$(v, {
|
|
61
65
|
completionChat: "completion_chat",
|