@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.
- package/README.md +80 -9
- package/esm/funcs/betaAgentsList.d.ts +3 -1
- package/esm/funcs/betaAgentsList.d.ts.map +1 -1
- package/esm/funcs/betaAgentsList.js +3 -1
- package/esm/funcs/betaAgentsList.js.map +1 -1
- package/esm/funcs/betaAgentsListPages.d.ts +21 -0
- package/esm/funcs/betaAgentsListPages.d.ts.map +1 -0
- package/esm/funcs/betaAgentsListPages.js +131 -0
- package/esm/funcs/betaAgentsListPages.js.map +1 -0
- package/esm/funcs/betaConnectorsDeleteAllUserCredentials.d.ts +19 -0
- package/esm/funcs/betaConnectorsDeleteAllUserCredentials.d.ts.map +1 -0
- package/esm/funcs/betaConnectorsDeleteAllUserCredentials.js +88 -0
- package/esm/funcs/betaConnectorsDeleteAllUserCredentials.js.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.d.ts +22 -0
- package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.d.ts.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.js +110 -0
- package/esm/funcs/betaRagSearchIndexesGenerateIndexSummary.js.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.d.ts +22 -0
- package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.d.ts.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.js +114 -0
- package/esm/funcs/betaRagSearchIndexesGenerateSchemaSummary.js.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGetIndexSummary.d.ts +19 -0
- package/esm/funcs/betaRagSearchIndexesGetIndexSummary.d.ts.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGetIndexSummary.js +96 -0
- package/esm/funcs/betaRagSearchIndexesGetIndexSummary.js.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.d.ts +19 -0
- package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.d.ts.map +1 -0
- package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.js +100 -0
- package/esm/funcs/betaRagSearchIndexesGetSchemaSummary.js.map +1 -0
- package/esm/funcs/betaRagSearchIndexesSetIndexSummary.d.ts +1 -1
- package/esm/funcs/betaRagSearchIndexesSetIndexSummary.d.ts.map +1 -1
- package/esm/funcs/betaRagSearchIndexesSetIndexSummary.js +8 -4
- package/esm/funcs/betaRagSearchIndexesSetIndexSummary.js.map +1 -1
- package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.d.ts +1 -1
- package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.d.ts.map +1 -1
- package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.js +8 -4
- package/esm/funcs/betaRagSearchIndexesSetSchemaSummary.js.map +1 -1
- package/esm/funcs/betaUsersGetIdentity.d.ts +2 -1
- package/esm/funcs/betaUsersGetIdentity.d.ts.map +1 -1
- package/esm/funcs/betaUsersGetIdentity.js +12 -8
- package/esm/funcs/betaUsersGetIdentity.js.map +1 -1
- package/esm/lib/config.d.ts +13 -3
- package/esm/lib/config.d.ts.map +1 -1
- package/esm/lib/config.js +14 -4
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/jsonl.d.ts +10 -0
- package/esm/lib/jsonl.d.ts.map +1 -0
- package/esm/lib/jsonl.js +103 -0
- package/esm/lib/jsonl.js.map +1 -0
- package/esm/models/components/agentlistpage.d.ts +13 -0
- package/esm/models/components/agentlistpage.d.ts.map +1 -0
- package/esm/models/components/agentlistpage.js +23 -0
- package/esm/models/components/agentlistpage.js.map +1 -0
- package/esm/models/components/authenticationconfiguration.d.ts +1 -0
- package/esm/models/components/authenticationconfiguration.d.ts.map +1 -1
- package/esm/models/components/authenticationconfiguration.js +1 -0
- package/esm/models/components/authenticationconfiguration.js.map +1 -1
- package/esm/models/components/connector.d.ts +1 -0
- package/esm/models/components/connector.d.ts.map +1 -1
- package/esm/models/components/connector.js +2 -0
- package/esm/models/components/connector.js.map +1 -1
- package/esm/models/components/credentialscreateorupdate.d.ts +5 -0
- package/esm/models/components/credentialscreateorupdate.d.ts.map +1 -1
- package/esm/models/components/credentialscreateorupdate.js +1 -0
- package/esm/models/components/credentialscreateorupdate.js.map +1 -1
- package/esm/models/components/getsearchindexdetailresponseindex.d.ts +0 -1
- package/esm/models/components/getsearchindexdetailresponseindex.d.ts.map +1 -1
- package/esm/models/components/getsearchindexdetailresponseindex.js +0 -1
- package/esm/models/components/getsearchindexdetailresponseindex.js.map +1 -1
- package/esm/models/components/getsearchindexschemadetailresponseschemamodel.d.ts +0 -1
- package/esm/models/components/getsearchindexschemadetailresponseschemamodel.d.ts.map +1 -1
- package/esm/models/components/getsearchindexschemadetailresponseschemamodel.js +0 -1
- package/esm/models/components/getsearchindexschemadetailresponseschemamodel.js.map +1 -1
- package/esm/models/components/getsummaryresponsesummary.d.ts +13 -0
- package/esm/models/components/getsummaryresponsesummary.d.ts.map +1 -0
- package/esm/models/components/getsummaryresponsesummary.js +17 -0
- package/esm/models/components/getsummaryresponsesummary.js.map +1 -0
- package/esm/models/components/index.d.ts +8 -2
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +8 -2
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/locationtype.d.ts +1 -0
- package/esm/models/components/locationtype.d.ts.map +1 -1
- package/esm/models/components/locationtype.js +1 -0
- package/esm/models/components/locationtype.js.map +1 -1
- package/esm/models/components/modelcapabilities.d.ts +1 -0
- package/esm/models/components/modelcapabilities.d.ts.map +1 -1
- package/esm/models/components/modelcapabilities.js +2 -0
- package/esm/models/components/modelcapabilities.js.map +1 -1
- package/esm/models/components/speechrequest.d.ts +2 -0
- package/esm/models/components/speechrequest.d.ts.map +1 -1
- package/esm/models/components/speechrequest.js +2 -0
- package/esm/models/components/speechrequest.js.map +1 -1
- package/esm/models/components/summarychunk.d.ts +13 -0
- package/esm/models/components/summarychunk.d.ts.map +1 -0
- package/esm/models/components/summarychunk.js +15 -0
- package/esm/models/components/summarychunk.js.map +1 -0
- package/esm/models/components/summaryerror.d.ts +13 -0
- package/esm/models/components/summaryerror.d.ts.map +1 -0
- package/esm/models/components/summaryerror.js +15 -0
- package/esm/models/components/summaryerror.js.map +1 -0
- package/esm/models/components/summarymetadata.d.ts +15 -0
- package/esm/models/components/summarymetadata.d.ts.map +1 -0
- package/esm/models/components/summarymetadata.js +16 -0
- package/esm/models/components/summarymetadata.js.map +1 -0
- package/esm/models/components/summarystatus.d.ts +11 -0
- package/esm/models/components/summarystatus.d.ts.map +1 -0
- package/esm/models/components/summarystatus.js +13 -0
- package/esm/models/components/summarystatus.js.map +1 -0
- package/esm/models/components/summarystatusdollardefs.d.ts +11 -0
- package/esm/models/components/summarystatusdollardefs.d.ts.map +1 -0
- package/esm/models/components/summarystatusdollardefs.js +13 -0
- package/esm/models/components/summarystatusdollardefs.js.map +1 -0
- package/esm/models/components/updatesummaryrequestsummary.d.ts +24 -0
- package/esm/models/components/updatesummaryrequestsummary.d.ts.map +1 -0
- package/esm/models/components/updatesummaryrequestsummary.js +21 -0
- package/esm/models/components/updatesummaryrequestsummary.js.map +1 -0
- package/esm/models/operations/agentsapiv1agentslistpages.d.ts +51 -0
- package/esm/models/operations/agentsapiv1agentslistpages.d.ts.map +1 -0
- package/esm/models/operations/agentsapiv1agentslistpages.js +41 -0
- package/esm/models/operations/agentsapiv1agentslistpages.js.map +1 -0
- package/esm/models/operations/connectordeleteallusercredentialsv1.d.ts +12 -0
- package/esm/models/operations/connectordeleteallusercredentialsv1.d.ts.map +1 -0
- package/esm/models/operations/connectordeleteallusercredentialsv1.js +18 -0
- package/esm/models/operations/connectordeleteallusercredentialsv1.js.map +1 -0
- package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.d.ts +39 -0
- package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.d.ts.map +1 -0
- package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.js +46 -0
- package/esm/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.js.map +1 -0
- package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.d.ts +41 -0
- package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.d.ts.map +1 -0
- package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.js +48 -0
- package/esm/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.js.map +1 -0
- package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.d.ts +29 -0
- package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.d.ts.map +1 -0
- package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.js +33 -0
- package/esm/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.js.map +1 -0
- package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.d.ts +31 -0
- package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.d.ts.map +1 -0
- package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.js +35 -0
- package/esm/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.js.map +1 -0
- package/esm/models/operations/index.d.ts +9 -2
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +9 -2
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.d.ts +32 -0
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.d.ts.map +1 -0
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.js +36 -0
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.js.map +1 -0
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.d.ts +34 -0
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.d.ts.map +1 -0
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.js +38 -0
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.js.map +1 -0
- package/esm/models/operations/usersapigetidentity.d.ts +12 -0
- package/esm/models/operations/usersapigetidentity.d.ts.map +1 -0
- package/esm/models/operations/usersapigetidentity.js +18 -0
- package/esm/models/operations/usersapigetidentity.js.map +1 -0
- package/esm/sdk/betaagents.d.ts +13 -1
- package/esm/sdk/betaagents.d.ts.map +1 -1
- package/esm/sdk/betaagents.js +14 -1
- package/esm/sdk/betaagents.js.map +1 -1
- 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/searchindexes.d.ts +40 -5
- package/esm/sdk/searchindexes.d.ts.map +1 -1
- package/esm/sdk/searchindexes.js +50 -4
- package/esm/sdk/searchindexes.js.map +1 -1
- package/esm/sdk/users.d.ts +2 -1
- package/esm/sdk/users.d.ts.map +1 -1
- package/esm/sdk/users.js +2 -2
- package/esm/sdk/users.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/betaAgentsList.ts +3 -1
- package/src/funcs/betaAgentsListPages.ts +265 -0
- package/src/funcs/betaConnectorsDeleteAllUserCredentials.ts +183 -0
- package/src/funcs/betaRagSearchIndexesGenerateIndexSummary.ts +215 -0
- package/src/funcs/betaRagSearchIndexesGenerateSchemaSummary.ts +219 -0
- package/src/funcs/betaRagSearchIndexesGetIndexSummary.ts +190 -0
- package/src/funcs/betaRagSearchIndexesGetSchemaSummary.ts +194 -0
- package/src/funcs/betaRagSearchIndexesSetIndexSummary.ts +12 -8
- package/src/funcs/betaRagSearchIndexesSetSchemaSummary.ts +10 -6
- package/src/funcs/betaUsersGetIdentity.ts +15 -5
- package/src/lib/config.ts +14 -4
- package/src/lib/jsonl.ts +128 -0
- package/src/models/components/agentlistpage.ts +39 -0
- package/src/models/components/authenticationconfiguration.ts +2 -0
- package/src/models/components/connector.ts +3 -0
- package/src/models/components/credentialscreateorupdate.ts +6 -0
- package/src/models/components/getsearchindexdetailresponseindex.ts +0 -2
- package/src/models/components/getsearchindexschemadetailresponseschemamodel.ts +0 -2
- package/src/models/components/getsummaryresponsesummary.ts +36 -0
- package/src/models/components/index.ts +8 -2
- package/src/models/components/locationtype.ts +1 -0
- package/src/models/components/modelcapabilities.ts +3 -0
- package/src/models/components/speechrequest.ts +4 -0
- package/src/models/components/summarychunk.ts +32 -0
- package/src/models/components/summaryerror.ts +32 -0
- package/src/models/components/summarymetadata.ts +40 -0
- package/src/models/components/summarystatus.ts +19 -0
- package/src/models/components/summarystatusdollardefs.ts +21 -0
- package/src/models/components/updatesummaryrequestsummary.ts +53 -0
- package/src/models/operations/agentsapiv1agentslistpages.ts +105 -0
- package/src/models/operations/connectordeleteallusercredentialsv1.ts +40 -0
- package/src/models/operations/generateindexsummaryv1ragindexesindexindexidsummaryfieldlanguagepost.ts +113 -0
- package/src/models/operations/generateschemasummarypostv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguagepost.ts +117 -0
- package/src/models/operations/getindexsummaryv1ragindexesindexindexidsummaryfieldlanguageget.ts +74 -0
- package/src/models/operations/getschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageget.ts +78 -0
- package/src/models/operations/index.ts +9 -2
- package/src/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldlanguageput.ts +81 -0
- package/src/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldlanguageput.ts +85 -0
- package/src/models/operations/usersapigetidentity.ts +38 -0
- package/src/sdk/betaagents.ts +27 -1
- package/src/sdk/connectors.ts +18 -0
- package/src/sdk/searchindexes.ts +99 -8
- package/src/sdk/users.ts +3 -0
- package/esm/models/components/updateindexsummaryrequestsummary.d.ts +0 -12
- package/esm/models/components/updateindexsummaryrequestsummary.d.ts.map +0 -1
- package/esm/models/components/updateindexsummaryrequestsummary.js +0 -13
- package/esm/models/components/updateindexsummaryrequestsummary.js.map +0 -1
- package/esm/models/components/updateschemasummaryrequestsummary.d.ts +0 -12
- package/esm/models/components/updateschemasummaryrequestsummary.d.ts.map +0 -1
- package/esm/models/components/updateschemasummaryrequestsummary.js +0 -13
- package/esm/models/components/updateschemasummaryrequestsummary.js.map +0 -1
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.d.ts +0 -15
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.d.ts.map +0 -1
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.js +0 -22
- package/esm/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.js.map +0 -1
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.d.ts +0 -17
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.d.ts.map +0 -1
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.js +0 -24
- package/esm/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.js.map +0 -1
- package/src/models/components/updateindexsummaryrequestsummary.ts +0 -33
- package/src/models/components/updateschemasummaryrequestsummary.ts +0 -33
- package/src/models/operations/setindexsummaryv1ragindexesindexindexidsummaryfieldput.ts +0 -47
- package/src/models/operations/setschemasummaryv1ragindexesindexindexidschemasschemaschemaidsummaryfieldput.ts +0 -55
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 84c2e367aaed
|
|
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
|
+
* Delete all user credentials for a connector.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Delete all credentials configured at the user level for a given connector.
|
|
36
|
+
*/
|
|
37
|
+
export function betaConnectorsDeleteAllUserCredentials(
|
|
38
|
+
client: MistralCore,
|
|
39
|
+
request: operations.ConnectorDeleteAllUserCredentialsV1Request,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
components.MessageResponse,
|
|
44
|
+
| errors.HTTPValidationError
|
|
45
|
+
| MistralError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: MistralCore,
|
|
64
|
+
request: operations.ConnectorDeleteAllUserCredentialsV1Request,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
components.MessageResponse,
|
|
70
|
+
| errors.HTTPValidationError
|
|
71
|
+
| MistralError
|
|
72
|
+
| ResponseValidationError
|
|
73
|
+
| ConnectionError
|
|
74
|
+
| RequestAbortedError
|
|
75
|
+
| RequestTimeoutError
|
|
76
|
+
| InvalidRequestError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
82
|
+
> {
|
|
83
|
+
const parsed = safeParse(
|
|
84
|
+
request,
|
|
85
|
+
(value) =>
|
|
86
|
+
operations.ConnectorDeleteAllUserCredentialsV1Request$outboundSchema
|
|
87
|
+
.parse(value),
|
|
88
|
+
"Input validation failed",
|
|
89
|
+
);
|
|
90
|
+
if (!parsed.ok) {
|
|
91
|
+
return [parsed, { status: "invalid" }];
|
|
92
|
+
}
|
|
93
|
+
const payload = parsed.value;
|
|
94
|
+
const body = null;
|
|
95
|
+
|
|
96
|
+
const pathParams = {
|
|
97
|
+
connector_id_or_name: encodeSimple(
|
|
98
|
+
"connector_id_or_name",
|
|
99
|
+
payload.connector_id_or_name,
|
|
100
|
+
{ explode: false, charEncoding: "percent" },
|
|
101
|
+
),
|
|
102
|
+
};
|
|
103
|
+
const path = pathToFunc(
|
|
104
|
+
"/v1/connectors/{connector_id_or_name}/user/credentials",
|
|
105
|
+
)(pathParams);
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
112
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "connector_delete_all_user_credentials_v1",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.apiKey,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "DELETE",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
148
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
components.MessageResponse,
|
|
163
|
+
| errors.HTTPValidationError
|
|
164
|
+
| MistralError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, components.MessageResponse$inboundSchema),
|
|
174
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
175
|
+
M.fail("4XX"),
|
|
176
|
+
M.fail("5XX"),
|
|
177
|
+
)(response, req, { extraFields: responseFields });
|
|
178
|
+
if (!result.ok) {
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 68e65ad818c3
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { MistralCore } from "../core.js";
|
|
8
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
9
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
10
|
+
import { JsonLStream } from "../lib/jsonl.js";
|
|
11
|
+
import * as M from "../lib/matchers.js";
|
|
12
|
+
import { compactMap } from "../lib/primitives.js";
|
|
13
|
+
import { safeParse } from "../lib/schemas.js";
|
|
14
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
15
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
16
|
+
import { pathToFunc } from "../lib/url.js";
|
|
17
|
+
import {
|
|
18
|
+
ConnectionError,
|
|
19
|
+
InvalidRequestError,
|
|
20
|
+
RequestAbortedError,
|
|
21
|
+
RequestTimeoutError,
|
|
22
|
+
UnexpectedClientError,
|
|
23
|
+
} from "../models/errors/httpclienterrors.js";
|
|
24
|
+
import * as errors from "../models/errors/index.js";
|
|
25
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
26
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
27
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
28
|
+
import * as operations from "../models/operations/index.js";
|
|
29
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
30
|
+
import { Result } from "../types/fp.js";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Generate a summary field for an index
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Streams a summary for the index in chunks of json.
|
|
37
|
+
*
|
|
38
|
+
* The first chunk contains metadata for the summary, the following contain
|
|
39
|
+
* chunks of 'content' that should be joined together to form a full summary.
|
|
40
|
+
*/
|
|
41
|
+
export function betaRagSearchIndexesGenerateIndexSummary(
|
|
42
|
+
client: MistralCore,
|
|
43
|
+
request:
|
|
44
|
+
operations.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostRequest,
|
|
45
|
+
options?: RequestOptions,
|
|
46
|
+
): APIPromise<
|
|
47
|
+
Result<
|
|
48
|
+
JsonLStream<
|
|
49
|
+
operations.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostSummaryStreamTypes
|
|
50
|
+
>,
|
|
51
|
+
| errors.HTTPValidationError
|
|
52
|
+
| MistralError
|
|
53
|
+
| ResponseValidationError
|
|
54
|
+
| ConnectionError
|
|
55
|
+
| RequestAbortedError
|
|
56
|
+
| RequestTimeoutError
|
|
57
|
+
| InvalidRequestError
|
|
58
|
+
| UnexpectedClientError
|
|
59
|
+
| SDKValidationError
|
|
60
|
+
>
|
|
61
|
+
> {
|
|
62
|
+
return new APIPromise($do(
|
|
63
|
+
client,
|
|
64
|
+
request,
|
|
65
|
+
options,
|
|
66
|
+
));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function $do(
|
|
70
|
+
client: MistralCore,
|
|
71
|
+
request:
|
|
72
|
+
operations.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
JsonLStream<
|
|
78
|
+
operations.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostSummaryStreamTypes
|
|
79
|
+
>,
|
|
80
|
+
| errors.HTTPValidationError
|
|
81
|
+
| MistralError
|
|
82
|
+
| ResponseValidationError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| InvalidRequestError
|
|
87
|
+
| UnexpectedClientError
|
|
88
|
+
| SDKValidationError
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
92
|
+
> {
|
|
93
|
+
const parsed = safeParse(
|
|
94
|
+
request,
|
|
95
|
+
(value) =>
|
|
96
|
+
operations
|
|
97
|
+
.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostRequest$outboundSchema
|
|
98
|
+
.parse(value),
|
|
99
|
+
"Input validation failed",
|
|
100
|
+
);
|
|
101
|
+
if (!parsed.ok) {
|
|
102
|
+
return [parsed, { status: "invalid" }];
|
|
103
|
+
}
|
|
104
|
+
const payload = parsed.value;
|
|
105
|
+
const body = null;
|
|
106
|
+
|
|
107
|
+
const pathParams = {
|
|
108
|
+
index_id: encodeSimple("index_id", payload.index_id, {
|
|
109
|
+
explode: false,
|
|
110
|
+
charEncoding: "percent",
|
|
111
|
+
}),
|
|
112
|
+
language: encodeSimple("language", payload.language, {
|
|
113
|
+
explode: false,
|
|
114
|
+
charEncoding: "percent",
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
const path = pathToFunc(
|
|
118
|
+
"/v1/rag/indexes/index/{index_id}/summary_field/{language}",
|
|
119
|
+
)(pathParams);
|
|
120
|
+
|
|
121
|
+
const headers = new Headers(compactMap({
|
|
122
|
+
Accept: "application/x-ndjson",
|
|
123
|
+
}));
|
|
124
|
+
|
|
125
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
126
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
127
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
128
|
+
|
|
129
|
+
const context = {
|
|
130
|
+
options: client._options,
|
|
131
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
132
|
+
operationID:
|
|
133
|
+
"generate_index_summary_v1_rag_indexes_index__index_id__summary_field__language__post",
|
|
134
|
+
oAuth2Scopes: null,
|
|
135
|
+
|
|
136
|
+
resolvedSecurity: requestSecurity,
|
|
137
|
+
|
|
138
|
+
securitySource: client._options.apiKey,
|
|
139
|
+
retryConfig: options?.retries
|
|
140
|
+
|| client._options.retryConfig
|
|
141
|
+
|| { strategy: "none" },
|
|
142
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const requestRes = client._createRequest(context, {
|
|
146
|
+
security: requestSecurity,
|
|
147
|
+
method: "POST",
|
|
148
|
+
baseURL: options?.serverURL,
|
|
149
|
+
path: path,
|
|
150
|
+
headers: headers,
|
|
151
|
+
body: body,
|
|
152
|
+
userAgent: client._options.userAgent,
|
|
153
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|
|
154
|
+
}, options);
|
|
155
|
+
if (!requestRes.ok) {
|
|
156
|
+
return [requestRes, { status: "invalid" }];
|
|
157
|
+
}
|
|
158
|
+
const req = requestRes.value;
|
|
159
|
+
|
|
160
|
+
const doResult = await client._do(req, {
|
|
161
|
+
context,
|
|
162
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
163
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
164
|
+
retryConfig: context.retryConfig,
|
|
165
|
+
retryCodes: context.retryCodes,
|
|
166
|
+
});
|
|
167
|
+
if (!doResult.ok) {
|
|
168
|
+
return [doResult, { status: "request-error", request: req }];
|
|
169
|
+
}
|
|
170
|
+
const response = doResult.value;
|
|
171
|
+
|
|
172
|
+
const responseFields = {
|
|
173
|
+
HttpMeta: { Response: response, Request: req },
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const [result] = await M.match<
|
|
177
|
+
JsonLStream<
|
|
178
|
+
operations.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostSummaryStreamTypes
|
|
179
|
+
>,
|
|
180
|
+
| errors.HTTPValidationError
|
|
181
|
+
| MistralError
|
|
182
|
+
| ResponseValidationError
|
|
183
|
+
| ConnectionError
|
|
184
|
+
| RequestAbortedError
|
|
185
|
+
| RequestTimeoutError
|
|
186
|
+
| InvalidRequestError
|
|
187
|
+
| UnexpectedClientError
|
|
188
|
+
| SDKValidationError
|
|
189
|
+
>(
|
|
190
|
+
M.jsonl(
|
|
191
|
+
200,
|
|
192
|
+
z.custom<ReadableStream<Uint8Array>>(x => x instanceof ReadableStream)
|
|
193
|
+
.transform(stream => {
|
|
194
|
+
return new JsonLStream({
|
|
195
|
+
stream,
|
|
196
|
+
decoder(rawEvent) {
|
|
197
|
+
const schema =
|
|
198
|
+
operations
|
|
199
|
+
.GenerateIndexSummaryV1RagIndexesIndexIndexIdSummaryFieldLanguagePostSummaryStreamTypes$inboundSchema;
|
|
200
|
+
return schema.parse(rawEvent);
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
}),
|
|
204
|
+
{ ctype: "application/x-ndjson" },
|
|
205
|
+
),
|
|
206
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
207
|
+
M.fail([400, 403, 404, "4XX"]),
|
|
208
|
+
M.fail([500, "5XX"]),
|
|
209
|
+
)(response, req, { extraFields: responseFields });
|
|
210
|
+
if (!result.ok) {
|
|
211
|
+
return [result, { status: "complete", request: req, response }];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return [result, { status: "complete", request: req, response }];
|
|
215
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: afee370f33eb
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { MistralCore } from "../core.js";
|
|
8
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
9
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
10
|
+
import { JsonLStream } from "../lib/jsonl.js";
|
|
11
|
+
import * as M from "../lib/matchers.js";
|
|
12
|
+
import { compactMap } from "../lib/primitives.js";
|
|
13
|
+
import { safeParse } from "../lib/schemas.js";
|
|
14
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
15
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
16
|
+
import { pathToFunc } from "../lib/url.js";
|
|
17
|
+
import {
|
|
18
|
+
ConnectionError,
|
|
19
|
+
InvalidRequestError,
|
|
20
|
+
RequestAbortedError,
|
|
21
|
+
RequestTimeoutError,
|
|
22
|
+
UnexpectedClientError,
|
|
23
|
+
} from "../models/errors/httpclienterrors.js";
|
|
24
|
+
import * as errors from "../models/errors/index.js";
|
|
25
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
26
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
27
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
28
|
+
import * as operations from "../models/operations/index.js";
|
|
29
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
30
|
+
import { Result } from "../types/fp.js";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Generate a summary field for a schema
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Streams a summary for the schema in chunks of json.
|
|
37
|
+
*
|
|
38
|
+
* The first chunk contains metadata for the summary, the following contain
|
|
39
|
+
* chunks of 'content' that should be joined together to form a full summary.
|
|
40
|
+
*/
|
|
41
|
+
export function betaRagSearchIndexesGenerateSchemaSummary(
|
|
42
|
+
client: MistralCore,
|
|
43
|
+
request:
|
|
44
|
+
operations.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostRequest,
|
|
45
|
+
options?: RequestOptions,
|
|
46
|
+
): APIPromise<
|
|
47
|
+
Result<
|
|
48
|
+
JsonLStream<
|
|
49
|
+
operations.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostSummaryStreamTypes
|
|
50
|
+
>,
|
|
51
|
+
| errors.HTTPValidationError
|
|
52
|
+
| MistralError
|
|
53
|
+
| ResponseValidationError
|
|
54
|
+
| ConnectionError
|
|
55
|
+
| RequestAbortedError
|
|
56
|
+
| RequestTimeoutError
|
|
57
|
+
| InvalidRequestError
|
|
58
|
+
| UnexpectedClientError
|
|
59
|
+
| SDKValidationError
|
|
60
|
+
>
|
|
61
|
+
> {
|
|
62
|
+
return new APIPromise($do(
|
|
63
|
+
client,
|
|
64
|
+
request,
|
|
65
|
+
options,
|
|
66
|
+
));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function $do(
|
|
70
|
+
client: MistralCore,
|
|
71
|
+
request:
|
|
72
|
+
operations.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
JsonLStream<
|
|
78
|
+
operations.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostSummaryStreamTypes
|
|
79
|
+
>,
|
|
80
|
+
| errors.HTTPValidationError
|
|
81
|
+
| MistralError
|
|
82
|
+
| ResponseValidationError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| InvalidRequestError
|
|
87
|
+
| UnexpectedClientError
|
|
88
|
+
| SDKValidationError
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
92
|
+
> {
|
|
93
|
+
const parsed = safeParse(
|
|
94
|
+
request,
|
|
95
|
+
(value) =>
|
|
96
|
+
operations
|
|
97
|
+
.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostRequest$outboundSchema
|
|
98
|
+
.parse(value),
|
|
99
|
+
"Input validation failed",
|
|
100
|
+
);
|
|
101
|
+
if (!parsed.ok) {
|
|
102
|
+
return [parsed, { status: "invalid" }];
|
|
103
|
+
}
|
|
104
|
+
const payload = parsed.value;
|
|
105
|
+
const body = null;
|
|
106
|
+
|
|
107
|
+
const pathParams = {
|
|
108
|
+
index_id: encodeSimple("index_id", payload.index_id, {
|
|
109
|
+
explode: false,
|
|
110
|
+
charEncoding: "percent",
|
|
111
|
+
}),
|
|
112
|
+
language: encodeSimple("language", payload.language, {
|
|
113
|
+
explode: false,
|
|
114
|
+
charEncoding: "percent",
|
|
115
|
+
}),
|
|
116
|
+
schema_id: encodeSimple("schema_id", payload.schema_id, {
|
|
117
|
+
explode: false,
|
|
118
|
+
charEncoding: "percent",
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
const path = pathToFunc(
|
|
122
|
+
"/v1/rag/indexes/index/{index_id}/schemas/schema/{schema_id}/summary_field/{language}",
|
|
123
|
+
)(pathParams);
|
|
124
|
+
|
|
125
|
+
const headers = new Headers(compactMap({
|
|
126
|
+
Accept: "application/x-ndjson",
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
130
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
131
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
132
|
+
|
|
133
|
+
const context = {
|
|
134
|
+
options: client._options,
|
|
135
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
136
|
+
operationID:
|
|
137
|
+
"generate_schema_summary_post_v1_rag_indexes_index__index_id__schemas_schema__schema_id__summary_field__language__post",
|
|
138
|
+
oAuth2Scopes: null,
|
|
139
|
+
|
|
140
|
+
resolvedSecurity: requestSecurity,
|
|
141
|
+
|
|
142
|
+
securitySource: client._options.apiKey,
|
|
143
|
+
retryConfig: options?.retries
|
|
144
|
+
|| client._options.retryConfig
|
|
145
|
+
|| { strategy: "none" },
|
|
146
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const requestRes = client._createRequest(context, {
|
|
150
|
+
security: requestSecurity,
|
|
151
|
+
method: "POST",
|
|
152
|
+
baseURL: options?.serverURL,
|
|
153
|
+
path: path,
|
|
154
|
+
headers: headers,
|
|
155
|
+
body: body,
|
|
156
|
+
userAgent: client._options.userAgent,
|
|
157
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|
|
158
|
+
}, options);
|
|
159
|
+
if (!requestRes.ok) {
|
|
160
|
+
return [requestRes, { status: "invalid" }];
|
|
161
|
+
}
|
|
162
|
+
const req = requestRes.value;
|
|
163
|
+
|
|
164
|
+
const doResult = await client._do(req, {
|
|
165
|
+
context,
|
|
166
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
167
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
168
|
+
retryConfig: context.retryConfig,
|
|
169
|
+
retryCodes: context.retryCodes,
|
|
170
|
+
});
|
|
171
|
+
if (!doResult.ok) {
|
|
172
|
+
return [doResult, { status: "request-error", request: req }];
|
|
173
|
+
}
|
|
174
|
+
const response = doResult.value;
|
|
175
|
+
|
|
176
|
+
const responseFields = {
|
|
177
|
+
HttpMeta: { Response: response, Request: req },
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const [result] = await M.match<
|
|
181
|
+
JsonLStream<
|
|
182
|
+
operations.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostSummaryStreamTypes
|
|
183
|
+
>,
|
|
184
|
+
| errors.HTTPValidationError
|
|
185
|
+
| MistralError
|
|
186
|
+
| ResponseValidationError
|
|
187
|
+
| ConnectionError
|
|
188
|
+
| RequestAbortedError
|
|
189
|
+
| RequestTimeoutError
|
|
190
|
+
| InvalidRequestError
|
|
191
|
+
| UnexpectedClientError
|
|
192
|
+
| SDKValidationError
|
|
193
|
+
>(
|
|
194
|
+
M.jsonl(
|
|
195
|
+
200,
|
|
196
|
+
z.custom<ReadableStream<Uint8Array>>(x => x instanceof ReadableStream)
|
|
197
|
+
.transform(stream => {
|
|
198
|
+
return new JsonLStream({
|
|
199
|
+
stream,
|
|
200
|
+
decoder(rawEvent) {
|
|
201
|
+
const schema =
|
|
202
|
+
operations
|
|
203
|
+
.GenerateSchemaSummaryPostV1RagIndexesIndexIndexIdSchemasSchemaSchemaIdSummaryFieldLanguagePostSummaryStreamTypes$inboundSchema;
|
|
204
|
+
return schema.parse(rawEvent);
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
}),
|
|
208
|
+
{ ctype: "application/x-ndjson" },
|
|
209
|
+
),
|
|
210
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
211
|
+
M.fail([400, 403, 404, "4XX"]),
|
|
212
|
+
M.fail([500, "5XX"]),
|
|
213
|
+
)(response, req, { extraFields: responseFields });
|
|
214
|
+
if (!result.ok) {
|
|
215
|
+
return [result, { status: "complete", request: req, response }];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return [result, { status: "complete", request: req, response }];
|
|
219
|
+
}
|