@mistralai/mistralai 2.4.1 → 2.5.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.
Files changed (238) hide show
  1. package/README.md +80 -9
  2. package/esm/funcs/betaAgentsList.d.ts +3 -1
  3. package/esm/funcs/betaAgentsList.d.ts.map +1 -1
  4. package/esm/funcs/betaAgentsList.js +3 -1
  5. package/esm/funcs/betaAgentsList.js.map +1 -1
  6. package/esm/funcs/betaAgentsListPages.d.ts +21 -0
  7. package/esm/funcs/betaAgentsListPages.d.ts.map +1 -0
  8. package/esm/funcs/betaAgentsListPages.js +131 -0
  9. package/esm/funcs/betaAgentsListPages.js.map +1 -0
  10. package/esm/funcs/betaConnectorsDeleteAllUserCredentials.d.ts +19 -0
  11. package/esm/funcs/betaConnectorsDeleteAllUserCredentials.d.ts.map +1 -0
  12. package/esm/funcs/betaConnectorsDeleteAllUserCredentials.js +88 -0
  13. package/esm/funcs/betaConnectorsDeleteAllUserCredentials.js.map +1 -0
  14. package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.d.ts +22 -0
  15. package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.d.ts.map +1 -0
  16. package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.js +110 -0
  17. package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.js.map +1 -0
  18. package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.d.ts +22 -0
  19. package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.d.ts.map +1 -0
  20. package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.js +114 -0
  21. package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.js.map +1 -0
  22. package/esm/funcs/betaRagSearchIndexesGetIndexSummary.d.ts +19 -0
  23. package/esm/funcs/betaRagSearchIndexesGetIndexSummary.d.ts.map +1 -0
  24. package/esm/funcs/betaRagSearchIndexesGetIndexSummary.js +96 -0
  25. package/esm/funcs/betaRagSearchIndexesGetIndexSummary.js.map +1 -0
  26. package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.d.ts +19 -0
  27. package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.d.ts.map +1 -0
  28. package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.js +100 -0
  29. package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.js.map +1 -0
  30. package/esm/funcs/betaRagSearchIndexesSetIndexSummary.d.ts +1 -1
  31. package/esm/funcs/betaRagSearchIndexesSetIndexSummary.d.ts.map +1 -1
  32. package/esm/funcs/betaRagSearchIndexesSetIndexSummary.js +8 -4
  33. package/esm/funcs/betaRagSearchIndexesSetIndexSummary.js.map +1 -1
  34. package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.d.ts +1 -1
  35. package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.d.ts.map +1 -1
  36. package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.js +8 -4
  37. package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.js.map +1 -1
  38. package/esm/funcs/betaUsersGetIdentity.d.ts +2 -1
  39. package/esm/funcs/betaUsersGetIdentity.d.ts.map +1 -1
  40. package/esm/funcs/betaUsersGetIdentity.js +12 -8
  41. package/esm/funcs/betaUsersGetIdentity.js.map +1 -1
  42. package/esm/lib/config.d.ts +13 -3
  43. package/esm/lib/config.d.ts.map +1 -1
  44. package/esm/lib/config.js +14 -4
  45. package/esm/lib/config.js.map +1 -1
  46. package/esm/lib/jsonl.d.ts +10 -0
  47. package/esm/lib/jsonl.d.ts.map +1 -0
  48. package/esm/lib/jsonl.js +103 -0
  49. package/esm/lib/jsonl.js.map +1 -0
  50. package/esm/models/components/agentlistpage.d.ts +13 -0
  51. package/esm/models/components/agentlistpage.d.ts.map +1 -0
  52. package/esm/models/components/agentlistpage.js +23 -0
  53. package/esm/models/components/agentlistpage.js.map +1 -0
  54. package/esm/models/components/authenticationconfiguration.d.ts +1 -0
  55. package/esm/models/components/authenticationconfiguration.d.ts.map +1 -1
  56. package/esm/models/components/authenticationconfiguration.js +1 -0
  57. package/esm/models/components/authenticationconfiguration.js.map +1 -1
  58. package/esm/models/components/connector.d.ts +1 -0
  59. package/esm/models/components/connector.d.ts.map +1 -1
  60. package/esm/models/components/connector.js +2 -0
  61. package/esm/models/components/connector.js.map +1 -1
  62. package/esm/models/components/credentialscreateorupdate.d.ts +5 -0
  63. package/esm/models/components/credentialscreateorupdate.d.ts.map +1 -1
  64. package/esm/models/components/credentialscreateorupdate.js +1 -0
  65. package/esm/models/components/credentialscreateorupdate.js.map +1 -1
  66. package/esm/models/components/getsearchindexdetailresponseindex.d.ts +0 -1
  67. package/esm/models/components/getsearchindexdetailresponseindex.d.ts.map +1 -1
  68. package/esm/models/components/getsearchindexdetailresponseindex.js +0 -1
  69. package/esm/models/components/getsearchindexdetailresponseindex.js.map +1 -1
  70. package/esm/models/components/getsearchindexschemadetailresponseschemamodel.d.ts +0 -1
  71. package/esm/models/components/getsearchindexschemadetailresponseschemamodel.d.ts.map +1 -1
  72. package/esm/models/components/getsearchindexschemadetailresponseschemamodel.js +0 -1
  73. package/esm/models/components/getsearchindexschemadetailresponseschemamodel.js.map +1 -1
  74. package/esm/models/components/getsummaryresponsesummary.d.ts +13 -0
  75. package/esm/models/components/getsummaryresponsesummary.d.ts.map +1 -0
  76. package/esm/models/components/getsummaryresponsesummary.js +17 -0
  77. package/esm/models/components/getsummaryresponsesummary.js.map +1 -0
  78. package/esm/models/components/index.d.ts +8 -2
  79. package/esm/models/components/index.d.ts.map +1 -1
  80. package/esm/models/components/index.js +8 -2
  81. package/esm/models/components/index.js.map +1 -1
  82. package/esm/models/components/locationtype.d.ts +1 -0
  83. package/esm/models/components/locationtype.d.ts.map +1 -1
  84. package/esm/models/components/locationtype.js +1 -0
  85. package/esm/models/components/locationtype.js.map +1 -1
  86. package/esm/models/components/modelcapabilities.d.ts +1 -0
  87. package/esm/models/components/modelcapabilities.d.ts.map +1 -1
  88. package/esm/models/components/modelcapabilities.js +2 -0
  89. package/esm/models/components/modelcapabilities.js.map +1 -1
  90. package/esm/models/components/speechrequest.d.ts +2 -0
  91. package/esm/models/components/speechrequest.d.ts.map +1 -1
  92. package/esm/models/components/speechrequest.js +2 -0
  93. package/esm/models/components/speechrequest.js.map +1 -1
  94. package/esm/models/components/summarychunk.d.ts +13 -0
  95. package/esm/models/components/summarychunk.d.ts.map +1 -0
  96. package/esm/models/components/summarychunk.js +15 -0
  97. package/esm/models/components/summarychunk.js.map +1 -0
  98. package/esm/models/components/summaryerror.d.ts +13 -0
  99. package/esm/models/components/summaryerror.d.ts.map +1 -0
  100. package/esm/models/components/summaryerror.js +15 -0
  101. package/esm/models/components/summaryerror.js.map +1 -0
  102. package/esm/models/components/summarymetadata.d.ts +15 -0
  103. package/esm/models/components/summarymetadata.d.ts.map +1 -0
  104. package/esm/models/components/summarymetadata.js +16 -0
  105. package/esm/models/components/summarymetadata.js.map +1 -0
  106. package/esm/models/components/summarystatus.d.ts +11 -0
  107. package/esm/models/components/summarystatus.d.ts.map +1 -0
  108. package/esm/models/components/summarystatus.js +13 -0
  109. package/esm/models/components/summarystatus.js.map +1 -0
  110. package/esm/models/components/summarystatusdollardefs.d.ts +11 -0
  111. package/esm/models/components/summarystatusdollardefs.d.ts.map +1 -0
  112. package/esm/models/components/summarystatusdollardefs.js +13 -0
  113. package/esm/models/components/summarystatusdollardefs.js.map +1 -0
  114. package/esm/models/components/updatesummaryrequestsummary.d.ts +24 -0
  115. package/esm/models/components/updatesummaryrequestsummary.d.ts.map +1 -0
  116. package/esm/models/components/updatesummaryrequestsummary.js +21 -0
  117. package/esm/models/components/updatesummaryrequestsummary.js.map +1 -0
  118. package/esm/models/operations/agentsapiv1agentslistpages.d.ts +51 -0
  119. package/esm/models/operations/agentsapiv1agentslistpages.d.ts.map +1 -0
  120. package/esm/models/operations/agentsapiv1agentslistpages.js +41 -0
  121. package/esm/models/operations/agentsapiv1agentslistpages.js.map +1 -0
  122. package/esm/models/operations/connectordeleteallusercredentialsv1.d.ts +12 -0
  123. package/esm/models/operations/connectordeleteallusercredentialsv1.d.ts.map +1 -0
  124. package/esm/models/operations/connectordeleteallusercredentialsv1.js +18 -0
  125. package/esm/models/operations/connectordeleteallusercredentialsv1.js.map +1 -0
  126. package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.d.ts +39 -0
  127. package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.d.ts.map +1 -0
  128. package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.js +46 -0
  129. package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.js.map +1 -0
  130. package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.d.ts +41 -0
  131. package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.d.ts.map +1 -0
  132. package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.js +48 -0
  133. package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.js.map +1 -0
  134. package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.d.ts +29 -0
  135. package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.d.ts.map +1 -0
  136. package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.js +33 -0
  137. package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.js.map +1 -0
  138. package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.d.ts +31 -0
  139. package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.d.ts.map +1 -0
  140. package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.js +35 -0
  141. package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.js.map +1 -0
  142. package/esm/models/operations/index.d.ts +9 -2
  143. package/esm/models/operations/index.d.ts.map +1 -1
  144. package/esm/models/operations/index.js +9 -2
  145. package/esm/models/operations/index.js.map +1 -1
  146. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.d.ts +32 -0
  147. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.d.ts.map +1 -0
  148. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.js +36 -0
  149. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.js.map +1 -0
  150. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.d.ts +34 -0
  151. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.d.ts.map +1 -0
  152. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.js +38 -0
  153. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.js.map +1 -0
  154. package/esm/models/operations/usersapigetidentity.d.ts +12 -0
  155. package/esm/models/operations/usersapigetidentity.d.ts.map +1 -0
  156. package/esm/models/operations/usersapigetidentity.js +18 -0
  157. package/esm/models/operations/usersapigetidentity.js.map +1 -0
  158. package/esm/sdk/betaagents.d.ts +13 -1
  159. package/esm/sdk/betaagents.d.ts.map +1 -1
  160. package/esm/sdk/betaagents.js +14 -1
  161. package/esm/sdk/betaagents.js.map +1 -1
  162. package/esm/sdk/connectors.d.ts +7 -0
  163. package/esm/sdk/connectors.d.ts.map +1 -1
  164. package/esm/sdk/connectors.js +10 -0
  165. package/esm/sdk/connectors.js.map +1 -1
  166. package/esm/sdk/searchindexes.d.ts +40 -5
  167. package/esm/sdk/searchindexes.d.ts.map +1 -1
  168. package/esm/sdk/searchindexes.js +50 -4
  169. package/esm/sdk/searchindexes.js.map +1 -1
  170. package/esm/sdk/users.d.ts +2 -1
  171. package/esm/sdk/users.d.ts.map +1 -1
  172. package/esm/sdk/users.js +2 -2
  173. package/esm/sdk/users.js.map +1 -1
  174. package/jsr.json +1 -1
  175. package/package.json +1 -1
  176. package/src/funcs/betaAgentsList.ts +3 -1
  177. package/src/funcs/betaAgentsListPages.ts +265 -0
  178. package/src/funcs/betaConnectorsDeleteAllUserCredentials.ts +183 -0
  179. package/src/funcs/betaRagSearchIndexesGenerateIndexSummary.ts +215 -0
  180. package/src/funcs/betaRagSearchIndexesGenerateSchemaSummary.ts +219 -0
  181. package/src/funcs/betaRagSearchIndexesGetIndexSummary.ts +190 -0
  182. package/src/funcs/betaRagSearchIndexesGetSchemaSummary.ts +194 -0
  183. package/src/funcs/betaRagSearchIndexesSetIndexSummary.ts +12 -8
  184. package/src/funcs/betaRagSearchIndexesSetSchemaSummary.ts +10 -6
  185. package/src/funcs/betaUsersGetIdentity.ts +15 -5
  186. package/src/lib/config.ts +14 -4
  187. package/src/lib/jsonl.ts +128 -0
  188. package/src/models/components/agentlistpage.ts +39 -0
  189. package/src/models/components/authenticationconfiguration.ts +2 -0
  190. package/src/models/components/connector.ts +3 -0
  191. package/src/models/components/credentialscreateorupdate.ts +6 -0
  192. package/src/models/components/getsearchindexdetailresponseindex.ts +0 -2
  193. package/src/models/components/getsearchindexschemadetailresponseschemamodel.ts +0 -2
  194. package/src/models/components/getsummaryresponsesummary.ts +36 -0
  195. package/src/models/components/index.ts +8 -2
  196. package/src/models/components/locationtype.ts +1 -0
  197. package/src/models/components/modelcapabilities.ts +3 -0
  198. package/src/models/components/speechrequest.ts +4 -0
  199. package/src/models/components/summarychunk.ts +32 -0
  200. package/src/models/components/summaryerror.ts +32 -0
  201. package/src/models/components/summarymetadata.ts +40 -0
  202. package/src/models/components/summarystatus.ts +19 -0
  203. package/src/models/components/summarystatusdollardefs.ts +21 -0
  204. package/src/models/components/updatesummaryrequestsummary.ts +53 -0
  205. package/src/models/operations/agentsapiv1agentslistpages.ts +105 -0
  206. package/src/models/operations/connectordeleteallusercredentialsv1.ts +40 -0
  207. package/src/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.ts +113 -0
  208. package/src/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.ts +117 -0
  209. package/src/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.ts +74 -0
  210. package/src/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.ts +78 -0
  211. package/src/models/operations/index.ts +9 -2
  212. package/src/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.ts +81 -0
  213. package/src/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.ts +85 -0
  214. package/src/models/operations/usersapigetidentity.ts +38 -0
  215. package/src/sdk/betaagents.ts +27 -1
  216. package/src/sdk/connectors.ts +18 -0
  217. package/src/sdk/searchindexes.ts +99 -8
  218. package/src/sdk/users.ts +3 -0
  219. package/esm/models/components/updateindexsummaryrequestsummary.d.ts +0 -12
  220. package/esm/models/components/updateindexsummaryrequestsummary.d.ts.map +0 -1
  221. package/esm/models/components/updateindexsummaryrequestsummary.js +0 -13
  222. package/esm/models/components/updateindexsummaryrequestsummary.js.map +0 -1
  223. package/esm/models/components/updateschemasummaryrequestsummary.d.ts +0 -12
  224. package/esm/models/components/updateschemasummaryrequestsummary.d.ts.map +0 -1
  225. package/esm/models/components/updateschemasummaryrequestsummary.js +0 -13
  226. package/esm/models/components/updateschemasummaryrequestsummary.js.map +0 -1
  227. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.d.ts +0 -15
  228. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.d.ts.map +0 -1
  229. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.js +0 -22
  230. package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.js.map +0 -1
  231. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.d.ts +0 -17
  232. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.d.ts.map +0 -1
  233. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.js +0 -24
  234. package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.js.map +0 -1
  235. package/src/models/components/updateindexsummaryrequestsummary.ts +0 -33
  236. package/src/models/components/updateschemasummaryrequestsummary.ts +0 -33
  237. package/src/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.ts +0 -47
  238. package/src/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.ts +0 -55
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 91112f407e0a
4
+ */
5
+
6
+ import { MistralCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import * as components from "../models/components/index.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { MistralError } from "../models/errors/mistralerror.js";
25
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
26
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Get Index Summary
33
+ *
34
+ * @remarks
35
+ * Retrieve the summary field for an index if it exists
36
+ */
37
+ export function betaRagSearchIndexesGetIndexSummary(
38
+ client: MistralCore,
39
+ request:
40
+ operations.GetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguageGetRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ components.GetSummaryResponseSummary,
45
+ | errors.HTTPValidationError
46
+ | MistralError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: MistralCore,
65
+ request:
66
+ operations.GetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguageGetRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ components.GetSummaryResponseSummary,
72
+ | errors.HTTPValidationError
73
+ | MistralError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) =>
88
+ operations
89
+ .GetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguageGetRequest$outboundSchema
90
+ .parse(value),
91
+ "Input validation failed",
92
+ );
93
+ if (!parsed.ok) {
94
+ return [parsed, { status: "invalid" }];
95
+ }
96
+ const payload = parsed.value;
97
+ const body = null;
98
+
99
+ const pathParams = {
100
+ index_id: encodeSimple("index_id", payload.index_id, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ language: encodeSimple("language", payload.language, {
105
+ explode: false,
106
+ charEncoding: "percent",
107
+ }),
108
+ };
109
+ const path = pathToFunc(
110
+ "/v1/rag/indexes/index/{index_id}/summary_field/{language}",
111
+ )(pathParams);
112
+
113
+ const headers = new Headers(compactMap({
114
+ Accept: "application/json",
115
+ }));
116
+
117
+ const secConfig = await extractSecurity(client._options.apiKey);
118
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
119
+ const requestSecurity = resolveGlobalSecurity(securityInput);
120
+
121
+ const context = {
122
+ options: client._options,
123
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
124
+ operationID:
125
+ "get_index_summary_v1_rag_indexes_index__index_id__summary_field__language__get",
126
+ oAuth2Scopes: null,
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.apiKey,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || { strategy: "none" },
134
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
+ };
136
+
137
+ const requestRes = client._createRequest(context, {
138
+ security: requestSecurity,
139
+ method: "GET",
140
+ baseURL: options?.serverURL,
141
+ path: path,
142
+ headers: headers,
143
+ body: body,
144
+ userAgent: client._options.userAgent,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
146
+ }, options);
147
+ if (!requestRes.ok) {
148
+ return [requestRes, { status: "invalid" }];
149
+ }
150
+ const req = requestRes.value;
151
+
152
+ const doResult = await client._do(req, {
153
+ context,
154
+ isErrorStatusCode: (statusCode: number) =>
155
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
156
+ retryConfig: context.retryConfig,
157
+ retryCodes: context.retryCodes,
158
+ });
159
+ if (!doResult.ok) {
160
+ return [doResult, { status: "request-error", request: req }];
161
+ }
162
+ const response = doResult.value;
163
+
164
+ const responseFields = {
165
+ HttpMeta: { Response: response, Request: req },
166
+ };
167
+
168
+ const [result] = await M.match<
169
+ components.GetSummaryResponseSummary,
170
+ | errors.HTTPValidationError
171
+ | MistralError
172
+ | ResponseValidationError
173
+ | ConnectionError
174
+ | RequestAbortedError
175
+ | RequestTimeoutError
176
+ | InvalidRequestError
177
+ | UnexpectedClientError
178
+ | SDKValidationError
179
+ >(
180
+ M.json(200, components.GetSummaryResponseSummary$inboundSchema),
181
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
182
+ M.fail([400, 403, 404, "4XX"]),
183
+ M.fail([500, "5XX"]),
184
+ )(response, req, { extraFields: responseFields });
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
@@ -0,0 +1,194 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8e8855d6827d
4
+ */
5
+
6
+ import { MistralCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import * as components from "../models/components/index.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/httpclienterrors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { MistralError } from "../models/errors/mistralerror.js";
25
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
26
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Get Schema Summary
33
+ *
34
+ * @remarks
35
+ * Retrieve the summary field for a schema if it exists
36
+ */
37
+ export function betaRagSearchIndexesGetSchemaSummary(
38
+ client: MistralCore,
39
+ request:
40
+ operations.GetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguageGetRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ components.GetSummaryResponseSummary,
45
+ | errors.HTTPValidationError
46
+ | MistralError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: MistralCore,
65
+ request:
66
+ operations.GetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguageGetRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ components.GetSummaryResponseSummary,
72
+ | errors.HTTPValidationError
73
+ | MistralError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) =>
88
+ operations
89
+ .GetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguageGetRequest$outboundSchema
90
+ .parse(value),
91
+ "Input validation failed",
92
+ );
93
+ if (!parsed.ok) {
94
+ return [parsed, { status: "invalid" }];
95
+ }
96
+ const payload = parsed.value;
97
+ const body = null;
98
+
99
+ const pathParams = {
100
+ index_id: encodeSimple("index_id", payload.index_id, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ language: encodeSimple("language", payload.language, {
105
+ explode: false,
106
+ charEncoding: "percent",
107
+ }),
108
+ schema_id: encodeSimple("schema_id", payload.schema_id, {
109
+ explode: false,
110
+ charEncoding: "percent",
111
+ }),
112
+ };
113
+ const path = pathToFunc(
114
+ "/v1/rag/indexes/index/{index_id}/schemas/schema/{schema_id}/summary_field/{language}",
115
+ )(pathParams);
116
+
117
+ const headers = new Headers(compactMap({
118
+ Accept: "application/json",
119
+ }));
120
+
121
+ const secConfig = await extractSecurity(client._options.apiKey);
122
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
123
+ const requestSecurity = resolveGlobalSecurity(securityInput);
124
+
125
+ const context = {
126
+ options: client._options,
127
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
128
+ operationID:
129
+ "get_schema_summary_v1_rag_indexes_index__index_id__schemas_schema__schema_id__summary_field__language__get",
130
+ oAuth2Scopes: null,
131
+
132
+ resolvedSecurity: requestSecurity,
133
+
134
+ securitySource: client._options.apiKey,
135
+ retryConfig: options?.retries
136
+ || client._options.retryConfig
137
+ || { strategy: "none" },
138
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
139
+ };
140
+
141
+ const requestRes = client._createRequest(context, {
142
+ security: requestSecurity,
143
+ method: "GET",
144
+ baseURL: options?.serverURL,
145
+ path: path,
146
+ headers: headers,
147
+ body: body,
148
+ userAgent: client._options.userAgent,
149
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
150
+ }, options);
151
+ if (!requestRes.ok) {
152
+ return [requestRes, { status: "invalid" }];
153
+ }
154
+ const req = requestRes.value;
155
+
156
+ const doResult = await client._do(req, {
157
+ context,
158
+ isErrorStatusCode: (statusCode: number) =>
159
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
160
+ retryConfig: context.retryConfig,
161
+ retryCodes: context.retryCodes,
162
+ });
163
+ if (!doResult.ok) {
164
+ return [doResult, { status: "request-error", request: req }];
165
+ }
166
+ const response = doResult.value;
167
+
168
+ const responseFields = {
169
+ HttpMeta: { Response: response, Request: req },
170
+ };
171
+
172
+ const [result] = await M.match<
173
+ components.GetSummaryResponseSummary,
174
+ | errors.HTTPValidationError
175
+ | MistralError
176
+ | ResponseValidationError
177
+ | ConnectionError
178
+ | RequestAbortedError
179
+ | RequestTimeoutError
180
+ | InvalidRequestError
181
+ | UnexpectedClientError
182
+ | SDKValidationError
183
+ >(
184
+ M.json(200, components.GetSummaryResponseSummary$inboundSchema),
185
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
186
+ M.fail([400, 403, 404, "4XX"]),
187
+ M.fail([500, "5XX"]),
188
+ )(response, req, { extraFields: responseFields });
189
+ if (!result.ok) {
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
192
+
193
+ return [result, { status: "complete", request: req, response }];
194
+ }
@@ -37,7 +37,7 @@ import { Result } from "../types/fp.js";
37
37
  export function betaRagSearchIndexesSetIndexSummary(
38
38
  client: MistralCore,
39
39
  request:
40
- operations.SetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldPutRequest,
40
+ operations.SetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePutRequest,
41
41
  options?: RequestOptions,
42
42
  ): APIPromise<
43
43
  Result<
@@ -63,7 +63,7 @@ export function betaRagSearchIndexesSetIndexSummary(
63
63
  async function $do(
64
64
  client: MistralCore,
65
65
  request:
66
- operations.SetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldPutRequest,
66
+ operations.SetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePutRequest,
67
67
  options?: RequestOptions,
68
68
  ): Promise<
69
69
  [
@@ -86,7 +86,7 @@ async function $do(
86
86
  request,
87
87
  (value) =>
88
88
  operations
89
- .SetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldPutRequest$outboundSchema
89
+ .SetIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePutRequest$outboundSchema
90
90
  .parse(value),
91
91
  "Input validation failed",
92
92
  );
@@ -94,7 +94,7 @@ async function $do(
94
94
  return [parsed, { status: "invalid" }];
95
95
  }
96
96
  const payload = parsed.value;
97
- const body = encodeJSON("body", payload.UpdateIndexSummaryRequestSummary, {
97
+ const body = encodeJSON("body", payload.UpdateSummaryRequestSummary, {
98
98
  explode: true,
99
99
  });
100
100
 
@@ -103,10 +103,14 @@ async function $do(
103
103
  explode: false,
104
104
  charEncoding: "percent",
105
105
  }),
106
+ language: encodeSimple("language", payload.language, {
107
+ explode: false,
108
+ charEncoding: "percent",
109
+ }),
106
110
  };
107
- const path = pathToFunc("/v1/rag/indexes/index/{index_id}/summary_field")(
108
- pathParams,
109
- );
111
+ const path = pathToFunc(
112
+ "/v1/rag/indexes/index/{index_id}/summary_field/{language}",
113
+ )(pathParams);
110
114
 
111
115
  const headers = new Headers(compactMap({
112
116
  "Content-Type": "application/json",
@@ -121,7 +125,7 @@ async function $do(
121
125
  options: client._options,
122
126
  baseURL: options?.serverURL ?? client._baseURL ?? "",
123
127
  operationID:
124
- "set_index_summary_v1_rag_indexes_index__index_id__summary_field_put",
128
+ "set_index_summary_v1_rag_indexes_index__index_id__summary_field__language__put",
125
129
  oAuth2Scopes: null,
126
130
 
127
131
  resolvedSecurity: requestSecurity,
@@ -37,7 +37,7 @@ import { Result } from "../types/fp.js";
37
37
  export function betaRagSearchIndexesSetSchemaSummary(
38
38
  client: MistralCore,
39
39
  request:
40
- operations.SetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldPutRequest,
40
+ operations.SetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePutRequest,
41
41
  options?: RequestOptions,
42
42
  ): APIPromise<
43
43
  Result<
@@ -63,7 +63,7 @@ export function betaRagSearchIndexesSetSchemaSummary(
63
63
  async function $do(
64
64
  client: MistralCore,
65
65
  request:
66
- operations.SetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldPutRequest,
66
+ operations.SetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePutRequest,
67
67
  options?: RequestOptions,
68
68
  ): Promise<
69
69
  [
@@ -86,7 +86,7 @@ async function $do(
86
86
  request,
87
87
  (value) =>
88
88
  operations
89
- .SetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldPutRequest$outboundSchema
89
+ .SetSchemaSummaryV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePutRequest$outboundSchema
90
90
  .parse(value),
91
91
  "Input validation failed",
92
92
  );
@@ -94,7 +94,7 @@ async function $do(
94
94
  return [parsed, { status: "invalid" }];
95
95
  }
96
96
  const payload = parsed.value;
97
- const body = encodeJSON("body", payload.UpdateSchemaSummaryRequestSummary, {
97
+ const body = encodeJSON("body", payload.UpdateSummaryRequestSummary, {
98
98
  explode: true,
99
99
  });
100
100
 
@@ -103,13 +103,17 @@ async function $do(
103
103
  explode: false,
104
104
  charEncoding: "percent",
105
105
  }),
106
+ language: encodeSimple("language", payload.language, {
107
+ explode: false,
108
+ charEncoding: "percent",
109
+ }),
106
110
  schema_id: encodeSimple("schema_id", payload.schema_id, {
107
111
  explode: false,
108
112
  charEncoding: "percent",
109
113
  }),
110
114
  };
111
115
  const path = pathToFunc(
112
- "/v1/rag/indexes/index/{index_id}/schemas/schema/{schema_id}/summary_field",
116
+ "/v1/rag/indexes/index/{index_id}/schemas/schema/{schema_id}/summary_field/{language}",
113
117
  )(pathParams);
114
118
 
115
119
  const headers = new Headers(compactMap({
@@ -125,7 +129,7 @@ async function $do(
125
129
  options: client._options,
126
130
  baseURL: options?.serverURL ?? client._baseURL ?? "",
127
131
  operationID:
128
- "set_schema_summary_v1_rag_indexes_index__index_id__schemas_schema__schema_id__summary_field_put",
132
+ "set_schema_summary_v1_rag_indexes_index__index_id__schemas_schema__schema_id__summary_field__language__put",
129
133
  oAuth2Scopes: null,
130
134
 
131
135
  resolvedSecurity: requestSecurity,
@@ -8,7 +8,7 @@ import { matchStatusCode } from "../lib/http.js";
8
8
  import * as M from "../lib/matchers.js";
9
9
  import { compactMap } from "../lib/primitives.js";
10
10
  import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { resolveSecurity } from "../lib/security.js";
12
12
  import { pathToFunc } from "../lib/url.js";
13
13
  import * as components from "../models/components/index.js";
14
14
  import {
@@ -21,6 +21,7 @@ import {
21
21
  import { MistralError } from "../models/errors/mistralerror.js";
22
22
  import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
23
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
24
25
  import { APICall, APIPromise } from "../types/async.js";
25
26
  import { Result } from "../types/fp.js";
26
27
 
@@ -29,6 +30,7 @@ import { Result } from "../types/fp.js";
29
30
  */
30
31
  export function betaUsersGetIdentity(
31
32
  client: MistralCore,
33
+ security: operations.UsersApiGetIdentitySecurity,
32
34
  options?: RequestOptions,
33
35
  ): APIPromise<
34
36
  Result<
@@ -45,12 +47,14 @@ export function betaUsersGetIdentity(
45
47
  > {
46
48
  return new APIPromise($do(
47
49
  client,
50
+ security,
48
51
  options,
49
52
  ));
50
53
  }
51
54
 
52
55
  async function $do(
53
56
  client: MistralCore,
57
+ security: operations.UsersApiGetIdentitySecurity,
54
58
  options?: RequestOptions,
55
59
  ): Promise<
56
60
  [
@@ -74,9 +78,15 @@ async function $do(
74
78
  Accept: "application/json",
75
79
  }));
76
80
 
77
- const secConfig = await extractSecurity(client._options.apiKey);
78
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
79
- const requestSecurity = resolveGlobalSecurity(securityInput);
81
+ const requestSecurity = resolveSecurity(
82
+ [
83
+ {
84
+ fieldName: "x-api-key",
85
+ type: "apiKey:header",
86
+ value: security?.dashboardUserContextAuth,
87
+ },
88
+ ],
89
+ );
80
90
 
81
91
  const context = {
82
92
  options: client._options,
@@ -86,7 +96,7 @@ async function $do(
86
96
 
87
97
  resolvedSecurity: requestSecurity,
88
98
 
89
- securitySource: client._options.apiKey,
99
+ securitySource: security,
90
100
  retryConfig: options?.retries
91
101
  || client._options.retryConfig
92
102
  || { strategy: "none" },
package/src/lib/config.ts CHANGED
@@ -8,15 +8,25 @@ import { Logger } from "./logger.js";
8
8
  import { RetryConfig } from "./retries.js";
9
9
  import { Params, pathToFunc } from "./url.js";
10
10
 
11
+ /**
12
+ * Global Production server
13
+ */
14
+ export const ServerGlobal = "global";
11
15
  /**
12
16
  * EU Production server
13
17
  */
14
18
  export const ServerEu = "eu";
19
+ /**
20
+ * US Production server
21
+ */
22
+ export const ServerUs = "us";
15
23
  /**
16
24
  * Contains the list of servers available to the SDK
17
25
  */
18
26
  export const ServerList = {
19
- [ServerEu]: "https://api.mistral.ai",
27
+ [ServerGlobal]: "https://api.mistral.ai",
28
+ [ServerEu]: "https://api.eu.mistral.ai",
29
+ [ServerUs]: "https://api.us.mistral.ai",
20
30
  } as const;
21
31
 
22
32
  export type SDKOptions = {
@@ -49,7 +59,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
49
59
  const params: Params = {};
50
60
 
51
61
  if (!serverURL) {
52
- const server = options.server ?? ServerEu;
62
+ const server = options.server ?? ServerGlobal;
53
63
  serverURL = ServerList[server] || "";
54
64
  }
55
65
 
@@ -60,8 +70,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
60
70
  export const SDK_METADATA = {
61
71
  language: "typescript",
62
72
  openapiDocVersion: "1.0.0",
63
- sdkVersion: "2.4.1",
73
+ sdkVersion: "2.5.0",
64
74
  genVersion: "2.884.13",
65
75
  userAgent:
66
- "speakeasy-sdk/typescript 2.4.1 2.884.13 1.0.0 @mistralai/mistralai",
76
+ "speakeasy-sdk/typescript 2.5.0 2.884.13 1.0.0 @mistralai/mistralai",
67
77
  } as const;