@mistralai/mistralai 2.0.0-alpha.1 → 2.0.0
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/README.md +8 -6
- package/esm/extra/structChat.d.ts.map +1 -1
- package/esm/extra/structChat.js +71 -4
- package/esm/extra/structChat.js.map +1 -1
- package/esm/funcs/betaConnectorsGetAuthUrl.d.ts +19 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.d.ts.map +1 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.js +90 -0
- package/esm/funcs/betaConnectorsGetAuthUrl.js.map +1 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.d.ts +16 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.d.ts.map +1 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.js +91 -0
- package/esm/funcs/betaObservabilityJudgesJudgeConversation.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/models/components/agentscompletionrequest.d.ts +6 -0
- package/esm/models/components/agentscompletionrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionrequest.js +5 -0
- package/esm/models/components/agentscompletionrequest.js.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.d.ts +6 -0
- package/esm/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.js +5 -0
- package/esm/models/components/agentscompletionstreamrequest.js.map +1 -1
- package/esm/models/components/authurlresponse.d.ts +11 -0
- package/esm/models/components/authurlresponse.d.ts.map +1 -0
- package/esm/models/components/authurlresponse.js +20 -0
- package/esm/models/components/authurlresponse.js.map +1 -0
- package/esm/models/components/basemodelcard.d.ts +6 -0
- package/esm/models/components/basemodelcard.d.ts.map +1 -1
- package/esm/models/components/basemodelcard.js.map +1 -1
- package/esm/models/components/chatcompletionrequest.d.ts +6 -0
- package/esm/models/components/chatcompletionrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionrequest.js +5 -0
- package/esm/models/components/chatcompletionrequest.js.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.d.ts +6 -0
- package/esm/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.js +5 -0
- package/esm/models/components/chatcompletionstreamrequest.js.map +1 -1
- package/esm/models/components/conversationresponse.d.ts +3 -5
- package/esm/models/components/conversationresponse.d.ts.map +1 -1
- package/esm/models/components/conversationresponse.js +1 -7
- package/esm/models/components/conversationresponse.js.map +1 -1
- package/esm/models/components/ftmodelcard.d.ts +6 -0
- package/esm/models/components/ftmodelcard.d.ts.map +1 -1
- package/esm/models/components/ftmodelcard.js.map +1 -1
- package/esm/models/components/imageurlchunk.d.ts +1 -1
- package/esm/models/components/index.d.ts +3 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +3 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/instructrequest.d.ts +3 -0
- package/esm/models/components/instructrequest.d.ts.map +1 -1
- package/esm/models/components/instructrequest.js.map +1 -1
- package/esm/models/components/judgeconversationrequest.d.ts +22 -0
- package/esm/models/components/judgeconversationrequest.d.ts.map +1 -0
- package/esm/models/components/judgeconversationrequest.js +14 -0
- package/esm/models/components/judgeconversationrequest.js.map +1 -0
- package/esm/models/components/modelcapabilities.d.ts +8 -0
- package/esm/models/components/modelcapabilities.d.ts.map +1 -1
- package/esm/models/components/modelcapabilities.js +4 -0
- package/esm/models/components/modelcapabilities.js.map +1 -1
- package/esm/models/components/reasoningeffort.d.ts +10 -0
- package/esm/models/components/reasoningeffort.d.ts.map +1 -0
- package/esm/models/components/reasoningeffort.js +12 -0
- package/esm/models/components/reasoningeffort.js.map +1 -0
- package/esm/models/components/referencechunk.d.ts +11 -2
- package/esm/models/components/referencechunk.d.ts.map +1 -1
- package/esm/models/components/referencechunk.js +13 -2
- package/esm/models/components/referencechunk.js.map +1 -1
- package/esm/models/operations/connectorgetauthurlv1.d.ts +14 -0
- package/esm/models/operations/connectorgetauthurlv1.d.ts.map +1 -0
- package/esm/models/operations/connectorgetauthurlv1.js +20 -0
- package/esm/models/operations/connectorgetauthurlv1.js.map +1 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.d.ts +15 -0
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.d.ts.map +1 -0
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.js +22 -0
- package/esm/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.js.map +1 -0
- package/esm/sdk/connectors.d.ts +7 -0
- package/esm/sdk/connectors.d.ts.map +1 -1
- package/esm/sdk/connectors.js +10 -0
- package/esm/sdk/connectors.js.map +1 -1
- package/esm/sdk/judges.d.ts +4 -0
- package/esm/sdk/judges.d.ts.map +1 -1
- package/esm/sdk/judges.js +7 -0
- package/esm/sdk/judges.js.map +1 -1
- package/examples/src/gcp/async_chat_no_streaming.ts +2 -2
- package/jsr.json +1 -1
- package/package.json +8 -3
- package/packages/mistralai-gcp/examples/chatComplete.example.ts +3 -3
- package/packages/mistralai-gcp/src/core.ts +1 -1
- package/packages/mistralai-gcp/src/funcs/chatComplete.ts +7 -7
- package/packages/mistralai-gcp/src/funcs/chatStream.ts +7 -7
- package/packages/mistralai-gcp/src/funcs/fimComplete.ts +7 -7
- package/packages/mistralai-gcp/src/funcs/fimStream.ts +7 -7
- package/packages/mistralai-gcp/src/models/errors/httpvalidationerror.ts +2 -2
- package/packages/mistralai-gcp/src/models/errors/mistralgoogleclouderror.ts +2 -2
- package/packages/mistralai-gcp/src/models/errors/responsevalidationerror.ts +2 -2
- package/packages/mistralai-gcp/src/models/errors/sdkerror.ts +2 -2
- package/packages/mistralai-gcp/src/sdk/sdk.ts +6 -5
- package/src/extra/structChat.ts +69 -3
- package/src/funcs/betaConnectorsGetAuthUrl.ts +186 -0
- package/src/funcs/betaObservabilityJudgesJudgeConversation.ts +188 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentscompletionrequest.ts +16 -0
- package/src/models/components/agentscompletionstreamrequest.ts +16 -0
- package/src/models/components/authurlresponse.ts +38 -0
- package/src/models/components/basemodelcard.ts +6 -0
- package/src/models/components/chatcompletionrequest.ts +16 -0
- package/src/models/components/chatcompletionstreamrequest.ts +16 -0
- package/src/models/components/conversationresponse.ts +2 -20
- package/src/models/components/ftmodelcard.ts +6 -0
- package/src/models/components/imageurlchunk.ts +1 -1
- package/src/models/components/index.ts +3 -0
- package/src/models/components/instructrequest.ts +3 -0
- package/src/models/components/judgeconversationrequest.ts +34 -0
- package/src/models/components/modelcapabilities.ts +12 -0
- package/src/models/components/reasoningeffort.ts +17 -0
- package/src/models/components/referencechunk.ts +32 -4
- package/src/models/operations/connectorgetauthurlv1.ts +42 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/judgeconversationv1observabilityjudgesjudgeidlivejudgingpost.ts +49 -0
- package/src/sdk/connectors.ts +18 -0
- package/src/sdk/judges.ts +16 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1d61ecf8de14
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MistralCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Run a saved judge on a conversation
|
|
32
|
+
*/
|
|
33
|
+
export function betaObservabilityJudgesJudgeConversation(
|
|
34
|
+
client: MistralCore,
|
|
35
|
+
request:
|
|
36
|
+
operations.JudgeConversationV1ObservabilityJudgesJudgeIdLiveJudgingPostRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
components.JudgeOutput,
|
|
41
|
+
| errors.ObservabilityError
|
|
42
|
+
| MistralError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: MistralCore,
|
|
61
|
+
request:
|
|
62
|
+
operations.JudgeConversationV1ObservabilityJudgesJudgeIdLiveJudgingPostRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
components.JudgeOutput,
|
|
68
|
+
| errors.ObservabilityError
|
|
69
|
+
| MistralError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
operations
|
|
85
|
+
.JudgeConversationV1ObservabilityJudgesJudgeIdLiveJudgingPostRequest$outboundSchema
|
|
86
|
+
.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.JudgeConversationRequest, {
|
|
94
|
+
explode: true,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const pathParams = {
|
|
98
|
+
judge_id: encodeSimple("judge_id", payload.judge_id, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc("/v1/observability/judges/{judge_id}/live-judging")(
|
|
105
|
+
pathParams,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const headers = new Headers(compactMap({
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
114
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
115
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID:
|
|
121
|
+
"judge_conversation_v1_observability_judges__judge_id__live_judging_post",
|
|
122
|
+
oAuth2Scopes: null,
|
|
123
|
+
|
|
124
|
+
resolvedSecurity: requestSecurity,
|
|
125
|
+
|
|
126
|
+
securitySource: client._options.apiKey,
|
|
127
|
+
retryConfig: options?.retries
|
|
128
|
+
|| client._options.retryConfig
|
|
129
|
+
|| { strategy: "none" },
|
|
130
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const requestRes = client._createRequest(context, {
|
|
134
|
+
security: requestSecurity,
|
|
135
|
+
method: "POST",
|
|
136
|
+
baseURL: options?.serverURL,
|
|
137
|
+
path: path,
|
|
138
|
+
headers: headers,
|
|
139
|
+
body: body,
|
|
140
|
+
userAgent: client._options.userAgent,
|
|
141
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
142
|
+
}, options);
|
|
143
|
+
if (!requestRes.ok) {
|
|
144
|
+
return [requestRes, { status: "invalid" }];
|
|
145
|
+
}
|
|
146
|
+
const req = requestRes.value;
|
|
147
|
+
|
|
148
|
+
const doResult = await client._do(req, {
|
|
149
|
+
context,
|
|
150
|
+
errorCodes: ["400", "404", "408", "409", "422", "4XX", "5XX"],
|
|
151
|
+
retryConfig: context.retryConfig,
|
|
152
|
+
retryCodes: context.retryCodes,
|
|
153
|
+
});
|
|
154
|
+
if (!doResult.ok) {
|
|
155
|
+
return [doResult, { status: "request-error", request: req }];
|
|
156
|
+
}
|
|
157
|
+
const response = doResult.value;
|
|
158
|
+
|
|
159
|
+
const responseFields = {
|
|
160
|
+
HttpMeta: { Response: response, Request: req },
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const [result] = await M.match<
|
|
164
|
+
components.JudgeOutput,
|
|
165
|
+
| errors.ObservabilityError
|
|
166
|
+
| MistralError
|
|
167
|
+
| ResponseValidationError
|
|
168
|
+
| ConnectionError
|
|
169
|
+
| RequestAbortedError
|
|
170
|
+
| RequestTimeoutError
|
|
171
|
+
| InvalidRequestError
|
|
172
|
+
| UnexpectedClientError
|
|
173
|
+
| SDKValidationError
|
|
174
|
+
>(
|
|
175
|
+
M.json(200, components.JudgeOutput$inboundSchema),
|
|
176
|
+
M.jsonErr(
|
|
177
|
+
[400, 404, 408, 409, 422],
|
|
178
|
+
errors.ObservabilityError$inboundSchema,
|
|
179
|
+
),
|
|
180
|
+
M.fail("4XX"),
|
|
181
|
+
M.fail("5XX"),
|
|
182
|
+
)(response, req, { extraFields: responseFields });
|
|
183
|
+
if (!result.ok) {
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -60,8 +60,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
60
60
|
export const SDK_METADATA = {
|
|
61
61
|
language: "typescript",
|
|
62
62
|
openapiDocVersion: "1.0.0",
|
|
63
|
-
sdkVersion: "2.0.0
|
|
63
|
+
sdkVersion: "2.0.0",
|
|
64
64
|
genVersion: "2.859.0",
|
|
65
65
|
userAgent:
|
|
66
|
-
"speakeasy-sdk/typescript 2.0.0
|
|
66
|
+
"speakeasy-sdk/typescript 2.0.0 2.859.0 1.0.0 @mistralai/mistralai",
|
|
67
67
|
} as const;
|
|
@@ -11,6 +11,11 @@ import {
|
|
|
11
11
|
AssistantMessage$Outbound,
|
|
12
12
|
AssistantMessage$outboundSchema,
|
|
13
13
|
} from "./assistantmessage.js";
|
|
14
|
+
import {
|
|
15
|
+
GuardrailConfig,
|
|
16
|
+
GuardrailConfig$Outbound,
|
|
17
|
+
GuardrailConfig$outboundSchema,
|
|
18
|
+
} from "./guardrailconfig.js";
|
|
14
19
|
import {
|
|
15
20
|
MistralPromptMode,
|
|
16
21
|
MistralPromptMode$outboundSchema,
|
|
@@ -20,6 +25,10 @@ import {
|
|
|
20
25
|
Prediction$Outbound,
|
|
21
26
|
Prediction$outboundSchema,
|
|
22
27
|
} from "./prediction.js";
|
|
28
|
+
import {
|
|
29
|
+
ReasoningEffort,
|
|
30
|
+
ReasoningEffort$outboundSchema,
|
|
31
|
+
} from "./reasoningeffort.js";
|
|
23
32
|
import {
|
|
24
33
|
ResponseFormat,
|
|
25
34
|
ResponseFormat$Outbound,
|
|
@@ -114,10 +123,12 @@ export type AgentsCompletionRequest = {
|
|
|
114
123
|
*/
|
|
115
124
|
prediction?: Prediction | undefined;
|
|
116
125
|
parallelToolCalls?: boolean | undefined;
|
|
126
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
117
127
|
/**
|
|
118
128
|
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
119
129
|
*/
|
|
120
130
|
promptMode?: MistralPromptMode | null | undefined;
|
|
131
|
+
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
121
132
|
/**
|
|
122
133
|
* The ID of the agent to use for this completion.
|
|
123
134
|
*/
|
|
@@ -215,7 +226,9 @@ export type AgentsCompletionRequest$Outbound = {
|
|
|
215
226
|
n?: number | null | undefined;
|
|
216
227
|
prediction?: Prediction$Outbound | undefined;
|
|
217
228
|
parallel_tool_calls?: boolean | undefined;
|
|
229
|
+
reasoning_effort?: string | null | undefined;
|
|
218
230
|
prompt_mode?: string | null | undefined;
|
|
231
|
+
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
219
232
|
agent_id: string;
|
|
220
233
|
};
|
|
221
234
|
|
|
@@ -250,7 +263,9 @@ export const AgentsCompletionRequest$outboundSchema: z.ZodType<
|
|
|
250
263
|
n: z.nullable(z.int()).optional(),
|
|
251
264
|
prediction: Prediction$outboundSchema.optional(),
|
|
252
265
|
parallelToolCalls: z.boolean().optional(),
|
|
266
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
253
267
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
268
|
+
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
254
269
|
agentId: z.string(),
|
|
255
270
|
}).transform((v) => {
|
|
256
271
|
return remap$(v, {
|
|
@@ -261,6 +276,7 @@ export const AgentsCompletionRequest$outboundSchema: z.ZodType<
|
|
|
261
276
|
presencePenalty: "presence_penalty",
|
|
262
277
|
frequencyPenalty: "frequency_penalty",
|
|
263
278
|
parallelToolCalls: "parallel_tool_calls",
|
|
279
|
+
reasoningEffort: "reasoning_effort",
|
|
264
280
|
promptMode: "prompt_mode",
|
|
265
281
|
agentId: "agent_id",
|
|
266
282
|
});
|
|
@@ -11,6 +11,11 @@ import {
|
|
|
11
11
|
AssistantMessage$Outbound,
|
|
12
12
|
AssistantMessage$outboundSchema,
|
|
13
13
|
} from "./assistantmessage.js";
|
|
14
|
+
import {
|
|
15
|
+
GuardrailConfig,
|
|
16
|
+
GuardrailConfig$Outbound,
|
|
17
|
+
GuardrailConfig$outboundSchema,
|
|
18
|
+
} from "./guardrailconfig.js";
|
|
14
19
|
import {
|
|
15
20
|
MistralPromptMode,
|
|
16
21
|
MistralPromptMode$outboundSchema,
|
|
@@ -20,6 +25,10 @@ import {
|
|
|
20
25
|
Prediction$Outbound,
|
|
21
26
|
Prediction$outboundSchema,
|
|
22
27
|
} from "./prediction.js";
|
|
28
|
+
import {
|
|
29
|
+
ReasoningEffort,
|
|
30
|
+
ReasoningEffort$outboundSchema,
|
|
31
|
+
} from "./reasoningeffort.js";
|
|
23
32
|
import {
|
|
24
33
|
ResponseFormat,
|
|
25
34
|
ResponseFormat$Outbound,
|
|
@@ -113,10 +122,12 @@ export type AgentsCompletionStreamRequest = {
|
|
|
113
122
|
*/
|
|
114
123
|
prediction?: Prediction | undefined;
|
|
115
124
|
parallelToolCalls?: boolean | undefined;
|
|
125
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
116
126
|
/**
|
|
117
127
|
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
118
128
|
*/
|
|
119
129
|
promptMode?: MistralPromptMode | null | undefined;
|
|
130
|
+
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
120
131
|
/**
|
|
121
132
|
* The ID of the agent to use for this completion.
|
|
122
133
|
*/
|
|
@@ -215,7 +226,9 @@ export type AgentsCompletionStreamRequest$Outbound = {
|
|
|
215
226
|
n?: number | null | undefined;
|
|
216
227
|
prediction?: Prediction$Outbound | undefined;
|
|
217
228
|
parallel_tool_calls?: boolean | undefined;
|
|
229
|
+
reasoning_effort?: string | null | undefined;
|
|
218
230
|
prompt_mode?: string | null | undefined;
|
|
231
|
+
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
219
232
|
agent_id: string;
|
|
220
233
|
};
|
|
221
234
|
|
|
@@ -250,7 +263,9 @@ export const AgentsCompletionStreamRequest$outboundSchema: z.ZodType<
|
|
|
250
263
|
n: z.nullable(z.int()).optional(),
|
|
251
264
|
prediction: Prediction$outboundSchema.optional(),
|
|
252
265
|
parallelToolCalls: z.boolean().optional(),
|
|
266
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
253
267
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
268
|
+
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
254
269
|
agentId: z.string(),
|
|
255
270
|
}).transform((v) => {
|
|
256
271
|
return remap$(v, {
|
|
@@ -261,6 +276,7 @@ export const AgentsCompletionStreamRequest$outboundSchema: z.ZodType<
|
|
|
261
276
|
presencePenalty: "presence_penalty",
|
|
262
277
|
frequencyPenalty: "frequency_penalty",
|
|
263
278
|
parallelToolCalls: "parallel_tool_calls",
|
|
279
|
+
reasoningEffort: "reasoning_effort",
|
|
264
280
|
promptMode: "prompt_mode",
|
|
265
281
|
agentId: "agent_id",
|
|
266
282
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2438b56452ed
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type AuthUrlResponse = {
|
|
13
|
+
authUrl: string;
|
|
14
|
+
ttl: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const AuthUrlResponse$inboundSchema: z.ZodType<
|
|
19
|
+
AuthUrlResponse,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
auth_url: z.string(),
|
|
23
|
+
ttl: z.int(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"auth_url": "authUrl",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function authUrlResponseFromJSON(
|
|
31
|
+
jsonString: string,
|
|
32
|
+
): SafeParseResult<AuthUrlResponse, SDKValidationError> {
|
|
33
|
+
return safeParse(
|
|
34
|
+
jsonString,
|
|
35
|
+
(x) => AuthUrlResponse$inboundSchema.parse(JSON.parse(x)),
|
|
36
|
+
`Failed to parse 'AuthUrlResponse' from JSON`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -18,6 +18,12 @@ export type BaseModelCard = {
|
|
|
18
18
|
object: string;
|
|
19
19
|
created?: number | undefined;
|
|
20
20
|
ownedBy: string;
|
|
21
|
+
/**
|
|
22
|
+
* This is populated by Harmattan, but some fields have a name
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* that we don't want to expose in the API.
|
|
26
|
+
*/
|
|
21
27
|
capabilities: ModelCapabilities;
|
|
22
28
|
name?: string | null | undefined;
|
|
23
29
|
description?: string | null | undefined;
|
|
@@ -11,6 +11,11 @@ import {
|
|
|
11
11
|
AssistantMessage$Outbound,
|
|
12
12
|
AssistantMessage$outboundSchema,
|
|
13
13
|
} from "./assistantmessage.js";
|
|
14
|
+
import {
|
|
15
|
+
GuardrailConfig,
|
|
16
|
+
GuardrailConfig$Outbound,
|
|
17
|
+
GuardrailConfig$outboundSchema,
|
|
18
|
+
} from "./guardrailconfig.js";
|
|
14
19
|
import {
|
|
15
20
|
MistralPromptMode,
|
|
16
21
|
MistralPromptMode$outboundSchema,
|
|
@@ -20,6 +25,10 @@ import {
|
|
|
20
25
|
Prediction$Outbound,
|
|
21
26
|
Prediction$outboundSchema,
|
|
22
27
|
} from "./prediction.js";
|
|
28
|
+
import {
|
|
29
|
+
ReasoningEffort,
|
|
30
|
+
ReasoningEffort$outboundSchema,
|
|
31
|
+
} from "./reasoningeffort.js";
|
|
23
32
|
import {
|
|
24
33
|
ResponseFormat,
|
|
25
34
|
ResponseFormat$Outbound,
|
|
@@ -138,10 +147,12 @@ export type ChatCompletionRequest = {
|
|
|
138
147
|
* Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.
|
|
139
148
|
*/
|
|
140
149
|
parallelToolCalls?: boolean | undefined;
|
|
150
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
141
151
|
/**
|
|
142
152
|
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
143
153
|
*/
|
|
144
154
|
promptMode?: MistralPromptMode | null | undefined;
|
|
155
|
+
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
145
156
|
/**
|
|
146
157
|
* Whether to inject a safety prompt before all conversations.
|
|
147
158
|
*/
|
|
@@ -240,7 +251,9 @@ export type ChatCompletionRequest$Outbound = {
|
|
|
240
251
|
n?: number | null | undefined;
|
|
241
252
|
prediction?: Prediction$Outbound | undefined;
|
|
242
253
|
parallel_tool_calls?: boolean | undefined;
|
|
254
|
+
reasoning_effort?: string | null | undefined;
|
|
243
255
|
prompt_mode?: string | null | undefined;
|
|
256
|
+
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
244
257
|
safe_prompt?: boolean | undefined;
|
|
245
258
|
};
|
|
246
259
|
|
|
@@ -278,7 +291,9 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
|
|
|
278
291
|
n: z.nullable(z.int()).optional(),
|
|
279
292
|
prediction: Prediction$outboundSchema.optional(),
|
|
280
293
|
parallelToolCalls: z.boolean().optional(),
|
|
294
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
281
295
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
296
|
+
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
282
297
|
safePrompt: z.boolean().optional(),
|
|
283
298
|
}).transform((v) => {
|
|
284
299
|
return remap$(v, {
|
|
@@ -290,6 +305,7 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
|
|
|
290
305
|
presencePenalty: "presence_penalty",
|
|
291
306
|
frequencyPenalty: "frequency_penalty",
|
|
292
307
|
parallelToolCalls: "parallel_tool_calls",
|
|
308
|
+
reasoningEffort: "reasoning_effort",
|
|
293
309
|
promptMode: "prompt_mode",
|
|
294
310
|
safePrompt: "safe_prompt",
|
|
295
311
|
});
|
|
@@ -11,6 +11,11 @@ import {
|
|
|
11
11
|
AssistantMessage$Outbound,
|
|
12
12
|
AssistantMessage$outboundSchema,
|
|
13
13
|
} from "./assistantmessage.js";
|
|
14
|
+
import {
|
|
15
|
+
GuardrailConfig,
|
|
16
|
+
GuardrailConfig$Outbound,
|
|
17
|
+
GuardrailConfig$outboundSchema,
|
|
18
|
+
} from "./guardrailconfig.js";
|
|
14
19
|
import {
|
|
15
20
|
MistralPromptMode,
|
|
16
21
|
MistralPromptMode$outboundSchema,
|
|
@@ -20,6 +25,10 @@ import {
|
|
|
20
25
|
Prediction$Outbound,
|
|
21
26
|
Prediction$outboundSchema,
|
|
22
27
|
} from "./prediction.js";
|
|
28
|
+
import {
|
|
29
|
+
ReasoningEffort,
|
|
30
|
+
ReasoningEffort$outboundSchema,
|
|
31
|
+
} from "./reasoningeffort.js";
|
|
23
32
|
import {
|
|
24
33
|
ResponseFormat,
|
|
25
34
|
ResponseFormat$Outbound,
|
|
@@ -135,10 +144,12 @@ export type ChatCompletionStreamRequest = {
|
|
|
135
144
|
* Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.
|
|
136
145
|
*/
|
|
137
146
|
parallelToolCalls?: boolean | undefined;
|
|
147
|
+
reasoningEffort?: ReasoningEffort | null | undefined;
|
|
138
148
|
/**
|
|
139
149
|
* Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.
|
|
140
150
|
*/
|
|
141
151
|
promptMode?: MistralPromptMode | null | undefined;
|
|
152
|
+
guardrails?: Array<GuardrailConfig> | null | undefined;
|
|
142
153
|
/**
|
|
143
154
|
* Whether to inject a safety prompt before all conversations.
|
|
144
155
|
*/
|
|
@@ -239,7 +250,9 @@ export type ChatCompletionStreamRequest$Outbound = {
|
|
|
239
250
|
n?: number | null | undefined;
|
|
240
251
|
prediction?: Prediction$Outbound | undefined;
|
|
241
252
|
parallel_tool_calls?: boolean | undefined;
|
|
253
|
+
reasoning_effort?: string | null | undefined;
|
|
242
254
|
prompt_mode?: string | null | undefined;
|
|
255
|
+
guardrails?: Array<GuardrailConfig$Outbound> | null | undefined;
|
|
243
256
|
safe_prompt?: boolean | undefined;
|
|
244
257
|
};
|
|
245
258
|
|
|
@@ -277,7 +290,9 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
|
|
|
277
290
|
n: z.nullable(z.int()).optional(),
|
|
278
291
|
prediction: Prediction$outboundSchema.optional(),
|
|
279
292
|
parallelToolCalls: z.boolean().optional(),
|
|
293
|
+
reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
280
294
|
promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
|
|
295
|
+
guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
|
|
281
296
|
safePrompt: z.boolean().optional(),
|
|
282
297
|
}).transform((v) => {
|
|
283
298
|
return remap$(v, {
|
|
@@ -289,6 +304,7 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
|
|
|
289
304
|
presencePenalty: "presence_penalty",
|
|
290
305
|
frequencyPenalty: "frequency_penalty",
|
|
291
306
|
parallelToolCalls: "parallel_tool_calls",
|
|
307
|
+
reasoningEffort: "reasoning_effort",
|
|
292
308
|
promptMode: "prompt_mode",
|
|
293
309
|
safePrompt: "safe_prompt",
|
|
294
310
|
});
|
|
@@ -36,8 +36,6 @@ export type ConversationResponseOutput =
|
|
|
36
36
|
| ToolExecutionEntry
|
|
37
37
|
| MessageOutputEntry;
|
|
38
38
|
|
|
39
|
-
export type Guardrail = {};
|
|
40
|
-
|
|
41
39
|
/**
|
|
42
40
|
* The response after appending new entries to the conversation.
|
|
43
41
|
*/
|
|
@@ -51,7 +49,7 @@ export type ConversationResponse = {
|
|
|
51
49
|
| MessageOutputEntry
|
|
52
50
|
>;
|
|
53
51
|
usage: ConversationUsageInfo;
|
|
54
|
-
guardrails?: Array<
|
|
52
|
+
guardrails?: Array<{ [k: string]: any }> | null | undefined;
|
|
55
53
|
};
|
|
56
54
|
|
|
57
55
|
/** @internal */
|
|
@@ -75,21 +73,6 @@ export function conversationResponseOutputFromJSON(
|
|
|
75
73
|
);
|
|
76
74
|
}
|
|
77
75
|
|
|
78
|
-
/** @internal */
|
|
79
|
-
export const Guardrail$inboundSchema: z.ZodType<Guardrail, unknown> = z.object(
|
|
80
|
-
{},
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
export function guardrailFromJSON(
|
|
84
|
-
jsonString: string,
|
|
85
|
-
): SafeParseResult<Guardrail, SDKValidationError> {
|
|
86
|
-
return safeParse(
|
|
87
|
-
jsonString,
|
|
88
|
-
(x) => Guardrail$inboundSchema.parse(JSON.parse(x)),
|
|
89
|
-
`Failed to parse 'Guardrail' from JSON`,
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
76
|
/** @internal */
|
|
94
77
|
export const ConversationResponse$inboundSchema: z.ZodType<
|
|
95
78
|
ConversationResponse,
|
|
@@ -106,8 +89,7 @@ export const ConversationResponse$inboundSchema: z.ZodType<
|
|
|
106
89
|
]),
|
|
107
90
|
),
|
|
108
91
|
usage: ConversationUsageInfo$inboundSchema,
|
|
109
|
-
guardrails: z.nullable(z.array(z.
|
|
110
|
-
.optional(),
|
|
92
|
+
guardrails: z.nullable(z.array(z.record(z.string(), z.any()))).optional(),
|
|
111
93
|
}).transform((v) => {
|
|
112
94
|
return remap$(v, {
|
|
113
95
|
"conversation_id": "conversationId",
|
|
@@ -21,6 +21,12 @@ export type FTModelCard = {
|
|
|
21
21
|
object: string;
|
|
22
22
|
created?: number | undefined;
|
|
23
23
|
ownedBy: string;
|
|
24
|
+
/**
|
|
25
|
+
* This is populated by Harmattan, but some fields have a name
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* that we don't want to expose in the API.
|
|
29
|
+
*/
|
|
24
30
|
capabilities: ModelCapabilities;
|
|
25
31
|
name?: string | null | undefined;
|
|
26
32
|
description?: string | null | undefined;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
export type ImageUrlUnion = ImageURL | string;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* {"type":"image_url","image_url":
|
|
22
|
+
* {"type":"image_url","image_url":"data:image/png;base64,iVBORw0"}
|
|
23
23
|
*/
|
|
24
24
|
export type ImageURLChunk = {
|
|
25
25
|
type?: "image_url" | undefined;
|
|
@@ -23,6 +23,7 @@ export * from "./audioformat.js";
|
|
|
23
23
|
export * from "./audiotranscriptionrequest.js";
|
|
24
24
|
export * from "./audiotranscriptionrequeststream.js";
|
|
25
25
|
export * from "./authdata.js";
|
|
26
|
+
export * from "./authurlresponse.js";
|
|
26
27
|
export * from "./basefielddefinition.js";
|
|
27
28
|
export * from "./basemodelcard.js";
|
|
28
29
|
export * from "./basetaskstatus.js";
|
|
@@ -172,6 +173,7 @@ export * from "./judge.js";
|
|
|
172
173
|
export * from "./judgechatcompletioneventrequest.js";
|
|
173
174
|
export * from "./judgeclassificationoutput.js";
|
|
174
175
|
export * from "./judgeclassificationoutputoption.js";
|
|
176
|
+
export * from "./judgeconversationrequest.js";
|
|
175
177
|
export * from "./judgedatasetrecordrequest.js";
|
|
176
178
|
export * from "./judgeoutput.js";
|
|
177
179
|
export * from "./judgeoutputtype.js";
|
|
@@ -244,6 +246,7 @@ export * from "./realtimetranscriptionsessioncreated.js";
|
|
|
244
246
|
export * from "./realtimetranscriptionsessionupdated.js";
|
|
245
247
|
export * from "./realtimetranscriptionsessionupdatemessage.js";
|
|
246
248
|
export * from "./realtimetranscriptionsessionupdatepayload.js";
|
|
249
|
+
export * from "./reasoningeffort.js";
|
|
247
250
|
export * from "./referencechunk.js";
|
|
248
251
|
export * from "./requestsource.js";
|
|
249
252
|
export * from "./resourcelink.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 659374f1ac11
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
|
|
8
|
+
export type JudgeConversationRequest = {
|
|
9
|
+
messages: Array<{ [k: string]: any }>;
|
|
10
|
+
properties?: { [k: string]: any } | null | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
export type JudgeConversationRequest$Outbound = {
|
|
15
|
+
messages: Array<{ [k: string]: any }>;
|
|
16
|
+
properties?: { [k: string]: any } | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const JudgeConversationRequest$outboundSchema: z.ZodType<
|
|
21
|
+
JudgeConversationRequest$Outbound,
|
|
22
|
+
JudgeConversationRequest
|
|
23
|
+
> = z.object({
|
|
24
|
+
messages: z.array(z.record(z.string(), z.any())),
|
|
25
|
+
properties: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function judgeConversationRequestToJSON(
|
|
29
|
+
judgeConversationRequest: JudgeConversationRequest,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
JudgeConversationRequest$outboundSchema.parse(judgeConversationRequest),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -9,6 +9,12 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* This is populated by Harmattan, but some fields have a name
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* that we don't want to expose in the API.
|
|
17
|
+
*/
|
|
12
18
|
export type ModelCapabilities = {
|
|
13
19
|
completionChat: boolean;
|
|
14
20
|
functionCalling: boolean;
|
|
@@ -20,6 +26,8 @@ export type ModelCapabilities = {
|
|
|
20
26
|
moderation: boolean;
|
|
21
27
|
audio: boolean;
|
|
22
28
|
audioTranscription: boolean;
|
|
29
|
+
audioTranscriptionRealtime: boolean;
|
|
30
|
+
audioSpeech: boolean;
|
|
23
31
|
};
|
|
24
32
|
|
|
25
33
|
/** @internal */
|
|
@@ -37,6 +45,8 @@ export const ModelCapabilities$inboundSchema: z.ZodType<
|
|
|
37
45
|
moderation: z.boolean().default(false),
|
|
38
46
|
audio: z.boolean().default(false),
|
|
39
47
|
audio_transcription: z.boolean().default(false),
|
|
48
|
+
audio_transcription_realtime: z.boolean().default(false),
|
|
49
|
+
audio_speech: z.boolean().default(false),
|
|
40
50
|
}).transform((v) => {
|
|
41
51
|
return remap$(v, {
|
|
42
52
|
"completion_chat": "completionChat",
|
|
@@ -44,6 +54,8 @@ export const ModelCapabilities$inboundSchema: z.ZodType<
|
|
|
44
54
|
"completion_fim": "completionFim",
|
|
45
55
|
"fine_tuning": "fineTuning",
|
|
46
56
|
"audio_transcription": "audioTranscription",
|
|
57
|
+
"audio_transcription_realtime": "audioTranscriptionRealtime",
|
|
58
|
+
"audio_speech": "audioSpeech",
|
|
47
59
|
});
|
|
48
60
|
});
|
|
49
61
|
|