@mistralai/mistralai 1.7.0 → 1.7.2

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.
Files changed (57) hide show
  1. package/docs/sdks/conversations/README.md +2 -0
  2. package/docs/sdks/mistralagents/README.md +2 -0
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/models/components/agentscompletionrequest.d.ts +3 -0
  7. package/models/components/agentscompletionrequest.d.ts.map +1 -1
  8. package/models/components/agentscompletionrequest.js +5 -0
  9. package/models/components/agentscompletionrequest.js.map +1 -1
  10. package/models/components/agentscompletionstreamrequest.d.ts +3 -0
  11. package/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
  12. package/models/components/agentscompletionstreamrequest.js +5 -0
  13. package/models/components/agentscompletionstreamrequest.js.map +1 -1
  14. package/models/components/chatcompletionrequest.d.ts +3 -0
  15. package/models/components/chatcompletionrequest.d.ts.map +1 -1
  16. package/models/components/chatcompletionrequest.js +5 -0
  17. package/models/components/chatcompletionrequest.js.map +1 -1
  18. package/models/components/chatcompletionresponse.d.ts +4 -4
  19. package/models/components/chatcompletionresponse.d.ts.map +1 -1
  20. package/models/components/chatcompletionresponse.js +4 -4
  21. package/models/components/chatcompletionresponse.js.map +1 -1
  22. package/models/components/chatcompletionstreamrequest.d.ts +3 -0
  23. package/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
  24. package/models/components/chatcompletionstreamrequest.js +5 -0
  25. package/models/components/chatcompletionstreamrequest.js.map +1 -1
  26. package/models/components/embeddingdtype.d.ts +37 -0
  27. package/models/components/embeddingdtype.d.ts.map +1 -0
  28. package/models/components/embeddingdtype.js +53 -0
  29. package/models/components/embeddingdtype.js.map +1 -0
  30. package/models/components/embeddingrequest.d.ts +8 -0
  31. package/models/components/embeddingrequest.d.ts.map +1 -1
  32. package/models/components/embeddingrequest.js +9 -0
  33. package/models/components/embeddingrequest.js.map +1 -1
  34. package/models/components/fimcompletionresponse.d.ts +4 -4
  35. package/models/components/fimcompletionresponse.d.ts.map +1 -1
  36. package/models/components/fimcompletionresponse.js +4 -4
  37. package/models/components/fimcompletionresponse.js.map +1 -1
  38. package/models/components/index.d.ts +2 -0
  39. package/models/components/index.d.ts.map +1 -1
  40. package/models/components/index.js +2 -0
  41. package/models/components/index.js.map +1 -1
  42. package/models/components/mistralpromptmode.d.ts +21 -0
  43. package/models/components/mistralpromptmode.d.ts.map +1 -0
  44. package/models/components/mistralpromptmode.js +57 -0
  45. package/models/components/mistralpromptmode.js.map +1 -0
  46. package/package.json +1 -1
  47. package/src/lib/config.ts +2 -2
  48. package/src/models/components/agentscompletionrequest.ts +11 -0
  49. package/src/models/components/agentscompletionstreamrequest.ts +11 -0
  50. package/src/models/components/chatcompletionrequest.ts +11 -0
  51. package/src/models/components/chatcompletionresponse.ts +8 -8
  52. package/src/models/components/chatcompletionstreamrequest.ts +11 -0
  53. package/src/models/components/embeddingdtype.ts +36 -0
  54. package/src/models/components/embeddingrequest.ts +20 -0
  55. package/src/models/components/fimcompletionresponse.ts +8 -8
  56. package/src/models/components/index.ts +2 -0
  57. package/src/models/components/mistralpromptmode.ts +47 -0
@@ -13,6 +13,11 @@ import {
13
13
  AssistantMessage$Outbound,
14
14
  AssistantMessage$outboundSchema,
15
15
  } from "./assistantmessage.js";
16
+ import {
17
+ MistralPromptMode,
18
+ MistralPromptMode$inboundSchema,
19
+ MistralPromptMode$outboundSchema,
20
+ } from "./mistralpromptmode.js";
16
21
  import {
17
22
  Prediction,
18
23
  Prediction$inboundSchema,
@@ -116,6 +121,7 @@ export type AgentsCompletionStreamRequest = {
116
121
  n?: number | null | undefined;
117
122
  prediction?: Prediction | undefined;
118
123
  parallelToolCalls?: boolean | undefined;
124
+ promptMode?: MistralPromptMode | null | undefined;
119
125
  /**
120
126
  * The ID of the agent to use for this completion.
121
127
  */
@@ -368,6 +374,7 @@ export const AgentsCompletionStreamRequest$inboundSchema: z.ZodType<
368
374
  n: z.nullable(z.number().int()).optional(),
369
375
  prediction: Prediction$inboundSchema.optional(),
370
376
  parallel_tool_calls: z.boolean().optional(),
377
+ prompt_mode: z.nullable(MistralPromptMode$inboundSchema).optional(),
371
378
  agent_id: z.string(),
372
379
  }).transform((v) => {
373
380
  return remap$(v, {
@@ -378,6 +385,7 @@ export const AgentsCompletionStreamRequest$inboundSchema: z.ZodType<
378
385
  "presence_penalty": "presencePenalty",
379
386
  "frequency_penalty": "frequencyPenalty",
380
387
  "parallel_tool_calls": "parallelToolCalls",
388
+ "prompt_mode": "promptMode",
381
389
  "agent_id": "agentId",
382
390
  });
383
391
  });
@@ -402,6 +410,7 @@ export type AgentsCompletionStreamRequest$Outbound = {
402
410
  n?: number | null | undefined;
403
411
  prediction?: Prediction$Outbound | undefined;
404
412
  parallel_tool_calls?: boolean | undefined;
413
+ prompt_mode?: string | null | undefined;
405
414
  agent_id: string;
406
415
  };
407
416
 
@@ -450,6 +459,7 @@ export const AgentsCompletionStreamRequest$outboundSchema: z.ZodType<
450
459
  n: z.nullable(z.number().int()).optional(),
451
460
  prediction: Prediction$outboundSchema.optional(),
452
461
  parallelToolCalls: z.boolean().optional(),
462
+ promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
453
463
  agentId: z.string(),
454
464
  }).transform((v) => {
455
465
  return remap$(v, {
@@ -460,6 +470,7 @@ export const AgentsCompletionStreamRequest$outboundSchema: z.ZodType<
460
470
  presencePenalty: "presence_penalty",
461
471
  frequencyPenalty: "frequency_penalty",
462
472
  parallelToolCalls: "parallel_tool_calls",
473
+ promptMode: "prompt_mode",
463
474
  agentId: "agent_id",
464
475
  });
465
476
  });
@@ -13,6 +13,11 @@ import {
13
13
  AssistantMessage$Outbound,
14
14
  AssistantMessage$outboundSchema,
15
15
  } from "./assistantmessage.js";
16
+ import {
17
+ MistralPromptMode,
18
+ MistralPromptMode$inboundSchema,
19
+ MistralPromptMode$outboundSchema,
20
+ } from "./mistralpromptmode.js";
16
21
  import {
17
22
  Prediction,
18
23
  Prediction$inboundSchema,
@@ -129,6 +134,7 @@ export type ChatCompletionRequest = {
129
134
  n?: number | null | undefined;
130
135
  prediction?: Prediction | undefined;
131
136
  parallelToolCalls?: boolean | undefined;
137
+ promptMode?: MistralPromptMode | null | undefined;
132
138
  /**
133
139
  * Whether to inject a safety prompt before all conversations.
134
140
  */
@@ -353,6 +359,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType<
353
359
  n: z.nullable(z.number().int()).optional(),
354
360
  prediction: Prediction$inboundSchema.optional(),
355
361
  parallel_tool_calls: z.boolean().optional(),
362
+ prompt_mode: z.nullable(MistralPromptMode$inboundSchema).optional(),
356
363
  safe_prompt: z.boolean().optional(),
357
364
  }).transform((v) => {
358
365
  return remap$(v, {
@@ -364,6 +371,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType<
364
371
  "presence_penalty": "presencePenalty",
365
372
  "frequency_penalty": "frequencyPenalty",
366
373
  "parallel_tool_calls": "parallelToolCalls",
374
+ "prompt_mode": "promptMode",
367
375
  "safe_prompt": "safePrompt",
368
376
  });
369
377
  });
@@ -391,6 +399,7 @@ export type ChatCompletionRequest$Outbound = {
391
399
  n?: number | null | undefined;
392
400
  prediction?: Prediction$Outbound | undefined;
393
401
  parallel_tool_calls?: boolean | undefined;
402
+ prompt_mode?: string | null | undefined;
394
403
  safe_prompt?: boolean | undefined;
395
404
  };
396
405
 
@@ -442,6 +451,7 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
442
451
  n: z.nullable(z.number().int()).optional(),
443
452
  prediction: Prediction$outboundSchema.optional(),
444
453
  parallelToolCalls: z.boolean().optional(),
454
+ promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
445
455
  safePrompt: z.boolean().optional(),
446
456
  }).transform((v) => {
447
457
  return remap$(v, {
@@ -453,6 +463,7 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
453
463
  presencePenalty: "presence_penalty",
454
464
  frequencyPenalty: "frequency_penalty",
455
465
  parallelToolCalls: "parallel_tool_calls",
466
+ promptMode: "prompt_mode",
456
467
  safePrompt: "safe_prompt",
457
468
  });
458
469
  });
@@ -24,8 +24,8 @@ export type ChatCompletionResponse = {
24
24
  object: string;
25
25
  model: string;
26
26
  usage: UsageInfo;
27
- created?: number | undefined;
28
- choices?: Array<ChatCompletionChoice> | undefined;
27
+ created: number;
28
+ choices: Array<ChatCompletionChoice>;
29
29
  };
30
30
 
31
31
  /** @internal */
@@ -38,8 +38,8 @@ export const ChatCompletionResponse$inboundSchema: z.ZodType<
38
38
  object: z.string(),
39
39
  model: z.string(),
40
40
  usage: UsageInfo$inboundSchema,
41
- created: z.number().int().optional(),
42
- choices: z.array(ChatCompletionChoice$inboundSchema).optional(),
41
+ created: z.number().int(),
42
+ choices: z.array(ChatCompletionChoice$inboundSchema),
43
43
  });
44
44
 
45
45
  /** @internal */
@@ -48,8 +48,8 @@ export type ChatCompletionResponse$Outbound = {
48
48
  object: string;
49
49
  model: string;
50
50
  usage: UsageInfo$Outbound;
51
- created?: number | undefined;
52
- choices?: Array<ChatCompletionChoice$Outbound> | undefined;
51
+ created: number;
52
+ choices: Array<ChatCompletionChoice$Outbound>;
53
53
  };
54
54
 
55
55
  /** @internal */
@@ -62,8 +62,8 @@ export const ChatCompletionResponse$outboundSchema: z.ZodType<
62
62
  object: z.string(),
63
63
  model: z.string(),
64
64
  usage: UsageInfo$outboundSchema,
65
- created: z.number().int().optional(),
66
- choices: z.array(ChatCompletionChoice$outboundSchema).optional(),
65
+ created: z.number().int(),
66
+ choices: z.array(ChatCompletionChoice$outboundSchema),
67
67
  });
68
68
 
69
69
  /**
@@ -13,6 +13,11 @@ import {
13
13
  AssistantMessage$Outbound,
14
14
  AssistantMessage$outboundSchema,
15
15
  } from "./assistantmessage.js";
16
+ import {
17
+ MistralPromptMode,
18
+ MistralPromptMode$inboundSchema,
19
+ MistralPromptMode$outboundSchema,
20
+ } from "./mistralpromptmode.js";
16
21
  import {
17
22
  Prediction,
18
23
  Prediction$inboundSchema,
@@ -126,6 +131,7 @@ export type ChatCompletionStreamRequest = {
126
131
  n?: number | null | undefined;
127
132
  prediction?: Prediction | undefined;
128
133
  parallelToolCalls?: boolean | undefined;
134
+ promptMode?: MistralPromptMode | null | undefined;
129
135
  /**
130
136
  * Whether to inject a safety prompt before all conversations.
131
137
  */
@@ -374,6 +380,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType<
374
380
  n: z.nullable(z.number().int()).optional(),
375
381
  prediction: Prediction$inboundSchema.optional(),
376
382
  parallel_tool_calls: z.boolean().optional(),
383
+ prompt_mode: z.nullable(MistralPromptMode$inboundSchema).optional(),
377
384
  safe_prompt: z.boolean().optional(),
378
385
  }).transform((v) => {
379
386
  return remap$(v, {
@@ -385,6 +392,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType<
385
392
  "presence_penalty": "presencePenalty",
386
393
  "frequency_penalty": "frequencyPenalty",
387
394
  "parallel_tool_calls": "parallelToolCalls",
395
+ "prompt_mode": "promptMode",
388
396
  "safe_prompt": "safePrompt",
389
397
  });
390
398
  });
@@ -412,6 +420,7 @@ export type ChatCompletionStreamRequest$Outbound = {
412
420
  n?: number | null | undefined;
413
421
  prediction?: Prediction$Outbound | undefined;
414
422
  parallel_tool_calls?: boolean | undefined;
423
+ prompt_mode?: string | null | undefined;
415
424
  safe_prompt?: boolean | undefined;
416
425
  };
417
426
 
@@ -463,6 +472,7 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
463
472
  n: z.nullable(z.number().int()).optional(),
464
473
  prediction: Prediction$outboundSchema.optional(),
465
474
  parallelToolCalls: z.boolean().optional(),
475
+ promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
466
476
  safePrompt: z.boolean().optional(),
467
477
  }).transform((v) => {
468
478
  return remap$(v, {
@@ -474,6 +484,7 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
474
484
  presencePenalty: "presence_penalty",
475
485
  frequencyPenalty: "frequency_penalty",
476
486
  parallelToolCalls: "parallel_tool_calls",
487
+ promptMode: "prompt_mode",
477
488
  safePrompt: "safe_prompt",
478
489
  });
479
490
  });
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const EmbeddingDtype = {
9
+ Float: "float",
10
+ Int8: "int8",
11
+ Uint8: "uint8",
12
+ Binary: "binary",
13
+ Ubinary: "ubinary",
14
+ } as const;
15
+ export type EmbeddingDtype = ClosedEnum<typeof EmbeddingDtype>;
16
+
17
+ /** @internal */
18
+ export const EmbeddingDtype$inboundSchema: z.ZodNativeEnum<
19
+ typeof EmbeddingDtype
20
+ > = z.nativeEnum(EmbeddingDtype);
21
+
22
+ /** @internal */
23
+ export const EmbeddingDtype$outboundSchema: z.ZodNativeEnum<
24
+ typeof EmbeddingDtype
25
+ > = EmbeddingDtype$inboundSchema;
26
+
27
+ /**
28
+ * @internal
29
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
30
+ */
31
+ export namespace EmbeddingDtype$ {
32
+ /** @deprecated use `EmbeddingDtype$inboundSchema` instead. */
33
+ export const inboundSchema = EmbeddingDtype$inboundSchema;
34
+ /** @deprecated use `EmbeddingDtype$outboundSchema` instead. */
35
+ export const outboundSchema = EmbeddingDtype$outboundSchema;
36
+ }
@@ -7,6 +7,11 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ EmbeddingDtype,
12
+ EmbeddingDtype$inboundSchema,
13
+ EmbeddingDtype$outboundSchema,
14
+ } from "./embeddingdtype.js";
10
15
 
11
16
  /**
12
17
  * Text to embed.
@@ -22,6 +27,11 @@ export type EmbeddingRequest = {
22
27
  * Text to embed.
23
28
  */
24
29
  inputs: string | Array<string>;
30
+ /**
31
+ * The dimension of the output embeddings.
32
+ */
33
+ outputDimension?: number | null | undefined;
34
+ outputDtype?: EmbeddingDtype | undefined;
25
35
  };
26
36
 
27
37
  /** @internal */
@@ -80,9 +90,13 @@ export const EmbeddingRequest$inboundSchema: z.ZodType<
80
90
  > = z.object({
81
91
  model: z.string(),
82
92
  input: z.union([z.string(), z.array(z.string())]),
93
+ output_dimension: z.nullable(z.number().int()).optional(),
94
+ output_dtype: EmbeddingDtype$inboundSchema.optional(),
83
95
  }).transform((v) => {
84
96
  return remap$(v, {
85
97
  "input": "inputs",
98
+ "output_dimension": "outputDimension",
99
+ "output_dtype": "outputDtype",
86
100
  });
87
101
  });
88
102
 
@@ -90,6 +104,8 @@ export const EmbeddingRequest$inboundSchema: z.ZodType<
90
104
  export type EmbeddingRequest$Outbound = {
91
105
  model: string;
92
106
  input: string | Array<string>;
107
+ output_dimension?: number | null | undefined;
108
+ output_dtype?: string | undefined;
93
109
  };
94
110
 
95
111
  /** @internal */
@@ -100,9 +116,13 @@ export const EmbeddingRequest$outboundSchema: z.ZodType<
100
116
  > = z.object({
101
117
  model: z.string(),
102
118
  inputs: z.union([z.string(), z.array(z.string())]),
119
+ outputDimension: z.nullable(z.number().int()).optional(),
120
+ outputDtype: EmbeddingDtype$outboundSchema.optional(),
103
121
  }).transform((v) => {
104
122
  return remap$(v, {
105
123
  inputs: "input",
124
+ outputDimension: "output_dimension",
125
+ outputDtype: "output_dtype",
106
126
  });
107
127
  });
108
128
 
@@ -24,8 +24,8 @@ export type FIMCompletionResponse = {
24
24
  object: string;
25
25
  model: string;
26
26
  usage: UsageInfo;
27
- created?: number | undefined;
28
- choices?: Array<ChatCompletionChoice> | undefined;
27
+ created: number;
28
+ choices: Array<ChatCompletionChoice>;
29
29
  };
30
30
 
31
31
  /** @internal */
@@ -38,8 +38,8 @@ export const FIMCompletionResponse$inboundSchema: z.ZodType<
38
38
  object: z.string(),
39
39
  model: z.string(),
40
40
  usage: UsageInfo$inboundSchema,
41
- created: z.number().int().optional(),
42
- choices: z.array(ChatCompletionChoice$inboundSchema).optional(),
41
+ created: z.number().int(),
42
+ choices: z.array(ChatCompletionChoice$inboundSchema),
43
43
  });
44
44
 
45
45
  /** @internal */
@@ -48,8 +48,8 @@ export type FIMCompletionResponse$Outbound = {
48
48
  object: string;
49
49
  model: string;
50
50
  usage: UsageInfo$Outbound;
51
- created?: number | undefined;
52
- choices?: Array<ChatCompletionChoice$Outbound> | undefined;
51
+ created: number;
52
+ choices: Array<ChatCompletionChoice$Outbound>;
53
53
  };
54
54
 
55
55
  /** @internal */
@@ -62,8 +62,8 @@ export const FIMCompletionResponse$outboundSchema: z.ZodType<
62
62
  object: z.string(),
63
63
  model: z.string(),
64
64
  usage: UsageInfo$outboundSchema,
65
- created: z.number().int().optional(),
66
- choices: z.array(ChatCompletionChoice$outboundSchema).optional(),
65
+ created: z.number().int(),
66
+ choices: z.array(ChatCompletionChoice$outboundSchema),
67
67
  });
68
68
 
69
69
  /**
@@ -67,6 +67,7 @@ export * from "./deletemodelout.js";
67
67
  export * from "./deltamessage.js";
68
68
  export * from "./documentlibrarytool.js";
69
69
  export * from "./documenturlchunk.js";
70
+ export * from "./embeddingdtype.js";
70
71
  export * from "./embeddingrequest.js";
71
72
  export * from "./embeddingresponse.js";
72
73
  export * from "./embeddingresponsedata.js";
@@ -110,6 +111,7 @@ export * from "./messageoutputcontentchunks.js";
110
111
  export * from "./messageoutputentry.js";
111
112
  export * from "./messageoutputevent.js";
112
113
  export * from "./metricout.js";
114
+ export * from "./mistralpromptmode.js";
113
115
  export * from "./modelcapabilities.js";
114
116
  export * from "./modelconversation.js";
115
117
  export * from "./modellist.js";
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import {
7
+ catchUnrecognizedEnum,
8
+ OpenEnum,
9
+ Unrecognized,
10
+ } from "../../types/enums.js";
11
+
12
+ export const MistralPromptMode = {
13
+ Reasoning: "reasoning",
14
+ } as const;
15
+ export type MistralPromptMode = OpenEnum<typeof MistralPromptMode>;
16
+
17
+ /** @internal */
18
+ export const MistralPromptMode$inboundSchema: z.ZodType<
19
+ MistralPromptMode,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z
23
+ .union([
24
+ z.nativeEnum(MistralPromptMode),
25
+ z.string().transform(catchUnrecognizedEnum),
26
+ ]);
27
+
28
+ /** @internal */
29
+ export const MistralPromptMode$outboundSchema: z.ZodType<
30
+ MistralPromptMode,
31
+ z.ZodTypeDef,
32
+ MistralPromptMode
33
+ > = z.union([
34
+ z.nativeEnum(MistralPromptMode),
35
+ z.string().and(z.custom<Unrecognized<string>>()),
36
+ ]);
37
+
38
+ /**
39
+ * @internal
40
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
41
+ */
42
+ export namespace MistralPromptMode$ {
43
+ /** @deprecated use `MistralPromptMode$inboundSchema` instead. */
44
+ export const inboundSchema = MistralPromptMode$inboundSchema;
45
+ /** @deprecated use `MistralPromptMode$outboundSchema` instead. */
46
+ export const outboundSchema = MistralPromptMode$outboundSchema;
47
+ }