@tool-bridge/server 0.21.1 → 0.22.1
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/dist/admin.js +170 -0
- package/dist/airtable-ML2GIGCH.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
- package/dist/anthropic-6ZK24TBB.js +203 -0
- package/dist/apify-VDGYHP6W.js +248 -0
- package/dist/brave_search-TAATLZOS.js +302 -0
- package/dist/chunk-2IAI3XQM.js +302 -0
- package/dist/chunk-7ISGFRC6.js +161 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
- package/dist/chunk-HA4BGL6C.js +8429 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
- package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/chunk-UY6ANCOY.js +378 -0
- package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
- package/dist/circleci-BQ2UWXL2.js +389 -0
- package/dist/clerk-2JYWQNOI.js +1019 -0
- package/dist/cohere-6MI7AQM4.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
- package/dist/deepseek-OSPASO7O.js +210 -0
- package/dist/docker_hub-3ATQOY5L.js +933 -0
- package/dist/dropbox-LSA4GM2Y.js +1305 -0
- package/dist/dub-VZPJSPI6.js +680 -0
- package/dist/e2b-6SDYQZL2.js +278 -0
- package/dist/exa-B6EUYDVP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
- package/dist/figma-OUKSZLD5.js +777 -0
- package/dist/firehydrant-7MOYL7QH.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
- package/dist/fly-PXKY6PNH.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
- package/dist/geocodio-NSYO7TFP.js +213 -0
- package/dist/ghost-QBKKQQMF.js +338 -0
- package/dist/github-ENLSJ4CL.js +5421 -0
- package/dist/gmail-KQSDEB47.js +1887 -0
- package/dist/googlecalendar-5YCX4SZF.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
- package/dist/graphhopper-CURBVHYK.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
- package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
- package/dist/ipqualityscore-OT63L4TI.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
- package/dist/langsmith-IM5N4YAU.js +593 -0
- package/dist/lemlist-277SHUQF.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
- package/dist/logsnag-VEWRAGBG.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
- package/dist/mem0-AXS7GZGI.js +544 -0
- package/dist/memos-7TXG4ZTU.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
- package/dist/mistral_ai-YZ52RGD4.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
- package/dist/ngrok-4O4W3WZW.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
- package/dist/notion-4W4O7J7V.js +940 -0
- package/dist/open_exchange_rates-23QJXVO5.js +215 -0
- package/dist/openai-ZS7GLSLH.js +800 -0
- package/dist/opengraph_io-PMVH7OYI.js +362 -0
- package/dist/openrouter-ONRGFNB6.js +441 -0
- package/dist/outline-UCUYZZ7J.js +599 -0
- package/dist/paddle-35HTKTUL.js +454 -0
- package/dist/perplexity-NVOBYN24.js +220 -0
- package/dist/pinecone-55CJY73C.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
- package/dist/polar-SM4ZM53B.js +395 -0
- package/dist/posthog-NWCXVXNJ.js +3464 -0
- package/dist/postmark-QJV5PHUQ.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
- package/dist/readwise-AGHTQB42.js +470 -0
- package/dist/render-O4HBROCK.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
- package/dist/rootly-XGCUDW6X.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
- package/dist/semantic_scholar-3UJRLKES.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
- package/dist/shopify-LJ2EV2HH.js +610 -0
- package/dist/stripe-3LHMV55K.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
- package/dist/tavily-FBEWGH3Z.js +326 -0
- package/dist/telegram-MYYO3JND.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
- package/dist/todoist-OBWICA5Q.js +664 -0
- package/dist/trello-GUFUJRWO.js +1080 -0
- package/dist/turso-NIAK4UMS.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
- package/dist/umami-42RS2EPS.js +389 -0
- package/dist/unsplash-V7TOTETT.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
- package/dist/uptimerobot-AZC2DHOT.js +483 -0
- package/dist/v2ex-4TVRNMLS.js +667 -0
- package/dist/vercel-DPHTJ3XR.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
- package/dist/wordpress-KMPKVGUX.js +812 -0
- package/dist/workos-PKB2YR7S.js +664 -0
- package/dist/zhihu-Y4H4XYPB.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -1,1195 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readBoundedResponseBytes
|
|
3
|
-
} from "./chunk-LMLX3DJF.js";
|
|
4
|
-
import {
|
|
5
|
-
createAuthedClient
|
|
6
|
-
} from "./chunk-XYBU3WZH.js";
|
|
7
|
-
import "./chunk-E6JCVKW6.js";
|
|
8
|
-
import {
|
|
9
|
-
asJsonObject
|
|
10
|
-
} from "./chunk-JXHMDBAY.js";
|
|
11
|
-
import {
|
|
12
|
-
createProviderPlugin,
|
|
13
|
-
requireApiKey,
|
|
14
|
-
upstreamError
|
|
15
|
-
} from "./chunk-ATK45BXV.js";
|
|
16
|
-
import {
|
|
17
|
-
assertPublicHttpUrl,
|
|
18
|
-
guardedFetch
|
|
19
|
-
} from "./chunk-U7B6DS2O.js";
|
|
20
|
-
import {
|
|
21
|
-
TBError,
|
|
22
|
-
external_exports
|
|
23
|
-
} from "./chunk-UZM2RXZH.js";
|
|
24
|
-
import "./chunk-U67V476Y.js";
|
|
25
|
-
|
|
26
|
-
// ../plugins/src/mistral_ai/schema.ts
|
|
27
|
-
var listModelsInput = external_exports.strictObject({}).describe("No input parameters are required for this action.");
|
|
28
|
-
var listModelsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
29
|
-
var getModelInput = external_exports.looseObject({
|
|
30
|
-
model_id: external_exports.string().min(1).describe("Model ID.")
|
|
31
|
-
}).describe("Get one model.");
|
|
32
|
-
var getModelOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
33
|
-
var listConversationsInput = external_exports.looseObject({
|
|
34
|
-
page: external_exports.int().min(0).describe("Page number, starting from 0.").optional(),
|
|
35
|
-
page_size: external_exports.int().min(1).describe("The number of items returned per page.").optional(),
|
|
36
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional()
|
|
37
|
-
}).describe("Lists conversations with pagination and metadata filters.");
|
|
38
|
-
var listConversationsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
39
|
-
var startConversationInput = external_exports.looseObject({
|
|
40
|
-
inputs: external_exports.union([external_exports.string().describe("Plain text input."), external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.")).describe("Structured input entries.")]).describe("Conversation initial input."),
|
|
41
|
-
stream: external_exports.boolean().describe("Whether to use streaming responses. This connector only supports false or omitted.").optional(),
|
|
42
|
-
store: external_exports.boolean().describe("Whether to persist the conversation.").optional(),
|
|
43
|
-
handoff_execution: external_exports.enum(["client", "server"]).describe("Handoff execution method.").optional(),
|
|
44
|
-
instructions: external_exports.string().describe("Conversation-level instructions.").optional(),
|
|
45
|
-
tools: external_exports.array(external_exports.looseObject({}).describe("Tool definition accepted by Mistral.")).describe("Tools available for this conversation.").optional(),
|
|
46
|
-
completion_args: external_exports.looseObject({}).describe("Completion parameter configuration accepted by Mistral.").optional(),
|
|
47
|
-
guardrails: external_exports.array(external_exports.looseObject({}).describe("Guardrail configuration accepted by Mistral.")).describe("Guardrails to apply.").optional(),
|
|
48
|
-
name: external_exports.string().describe("Conversation name.").optional(),
|
|
49
|
-
description: external_exports.string().describe("Conversation description.").optional(),
|
|
50
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
51
|
-
agent_id: external_exports.string().min(1).describe("Agent ID.").optional(),
|
|
52
|
-
agent_version: external_exports.union([external_exports.string().min(1).describe("Version alias."), external_exports.int()]).describe("Version number or version alias.").optional(),
|
|
53
|
-
model: external_exports.string().describe("Direct model identifier to use.").optional()
|
|
54
|
-
}).describe("Input parameters for creating a conversation.");
|
|
55
|
-
var startConversationOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
56
|
-
var getConversationInput = external_exports.looseObject({
|
|
57
|
-
conversation_id: external_exports.string().min(1).describe("Conversation ID.")
|
|
58
|
-
}).describe("Get one conversation.");
|
|
59
|
-
var getConversationOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
60
|
-
var deleteConversationInput = external_exports.looseObject({
|
|
61
|
-
conversation_id: external_exports.string().min(1).describe("Conversation ID.")
|
|
62
|
-
}).describe("Delete one conversation.");
|
|
63
|
-
var deleteConversationOutput = external_exports.strictObject({
|
|
64
|
-
deleted: external_exports.boolean().describe("Whether the resource has been deleted.")
|
|
65
|
-
}).describe("Delete action response.");
|
|
66
|
-
var appendToConversationInput = external_exports.looseObject({
|
|
67
|
-
conversation_id: external_exports.string().min(1).describe("Conversation ID."),
|
|
68
|
-
inputs: external_exports.union([external_exports.string().describe("Plain text input."), external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.")).describe("Structured input entries.")]).describe("Input to append to the conversation."),
|
|
69
|
-
completion_args: external_exports.looseObject({}).describe("Completion parameter configuration accepted by Mistral.").optional(),
|
|
70
|
-
handoff_execution: external_exports.enum(["client", "server"]).describe("Handoff execution method.").optional(),
|
|
71
|
-
store: external_exports.boolean().describe("Whether to persist storage.").optional(),
|
|
72
|
-
tool_confirmations: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.")).describe("Tool call confirmations.").optional()
|
|
73
|
-
}).describe("Input parameters for appending content to a conversation.");
|
|
74
|
-
var appendToConversationOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
75
|
-
var getConversationHistoryInput = external_exports.looseObject({
|
|
76
|
-
conversation_id: external_exports.string().min(1).describe("Conversation ID.")
|
|
77
|
-
}).describe("Get conversation history.");
|
|
78
|
-
var getConversationHistoryOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
79
|
-
var getConversationMessagesInput = external_exports.looseObject({
|
|
80
|
-
conversation_id: external_exports.string().min(1).describe("Conversation ID.")
|
|
81
|
-
}).describe("Get conversation messages.");
|
|
82
|
-
var getConversationMessagesOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
83
|
-
var restartConversationInput = external_exports.looseObject({
|
|
84
|
-
conversation_id: external_exports.string().min(1).describe("Conversation ID."),
|
|
85
|
-
from_entry_id: external_exports.string().min(1).describe("Entry ID to restart from."),
|
|
86
|
-
inputs: external_exports.union([external_exports.string().describe("Plain text input."), external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.")).describe("Structured input entries.")]).describe("Input to continue after restarting.").optional(),
|
|
87
|
-
completion_args: external_exports.looseObject({}).describe("Completion parameter configuration accepted by Mistral.").optional(),
|
|
88
|
-
handoff_execution: external_exports.enum(["client", "server"]).describe("Handoff execution method.").optional(),
|
|
89
|
-
guardrails: external_exports.array(external_exports.looseObject({}).describe("Guardrail configuration accepted by Mistral.")).describe("Guardrails to apply.").optional(),
|
|
90
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
91
|
-
store: external_exports.boolean().describe("Whether to persist storage.").optional(),
|
|
92
|
-
stream: external_exports.boolean().describe("Whether to use streaming responses. This connector only supports false or omitted.").optional(),
|
|
93
|
-
agent_version: external_exports.union([external_exports.string().min(1).describe("Version alias."), external_exports.int()]).describe("Version number or version alias.").optional()
|
|
94
|
-
}).describe("Input parameters for restarting a conversation.");
|
|
95
|
-
var restartConversationOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
96
|
-
var listAgentsInput = external_exports.looseObject({
|
|
97
|
-
page: external_exports.int().min(0).describe("Page number, starting from 0.").optional(),
|
|
98
|
-
page_size: external_exports.int().min(1).describe("The number of items returned per page.").optional(),
|
|
99
|
-
deployment_chat: external_exports.boolean().describe("Whether to return only deployment_chat agents.").optional(),
|
|
100
|
-
sources: external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.").optional(),
|
|
101
|
-
name: external_exports.string().describe("Filter by agent name.").optional(),
|
|
102
|
-
search: external_exports.string().describe("Search by name or ID.").optional(),
|
|
103
|
-
id: external_exports.string().describe("Filter by exact agent ID.").optional(),
|
|
104
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional()
|
|
105
|
-
}).describe("List agents with pagination and filters.");
|
|
106
|
-
var listAgentsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
107
|
-
var createAgentInput = external_exports.looseObject({
|
|
108
|
-
model: external_exports.string().min(1).describe("The default model used by the agent."),
|
|
109
|
-
name: external_exports.string().min(1).describe("Agent name."),
|
|
110
|
-
instructions: external_exports.string().describe("Agent instructions.").optional(),
|
|
111
|
-
tools: external_exports.array(external_exports.looseObject({}).describe("Tool definition accepted by Mistral.")).describe("Tools available to the agent.").optional(),
|
|
112
|
-
completion_args: external_exports.looseObject({}).describe("Completion parameter configuration accepted by Mistral.").optional(),
|
|
113
|
-
guardrails: external_exports.array(external_exports.looseObject({}).describe("Guardrail configuration accepted by Mistral.")).describe("Guardrails to apply.").optional(),
|
|
114
|
-
description: external_exports.string().describe("Agent description.").optional(),
|
|
115
|
-
handoffs: external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.").optional(),
|
|
116
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
117
|
-
version_message: external_exports.string().describe("Version message for this update.").optional()
|
|
118
|
-
}).describe("Create a Mistral agent.");
|
|
119
|
-
var createAgentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
120
|
-
var getAgentInput = external_exports.looseObject({
|
|
121
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
122
|
-
agent_version: external_exports.union([external_exports.string().min(1).describe("Version alias."), external_exports.int()]).describe("Version number or version alias.").optional()
|
|
123
|
-
}).describe("Get an agent.");
|
|
124
|
-
var getAgentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
125
|
-
var updateAgentInput = external_exports.looseObject({
|
|
126
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
127
|
-
model: external_exports.string().describe("Updated model.").optional(),
|
|
128
|
-
name: external_exports.string().describe("Updated agent name.").optional(),
|
|
129
|
-
instructions: external_exports.string().describe("Updated instructions.").optional(),
|
|
130
|
-
tools: external_exports.array(external_exports.looseObject({}).describe("Tool definition accepted by Mistral.")).describe("Updated tool list.").optional(),
|
|
131
|
-
completion_args: external_exports.looseObject({}).describe("Completion parameter configuration accepted by Mistral.").optional(),
|
|
132
|
-
guardrails: external_exports.array(external_exports.looseObject({}).describe("Guardrail configuration accepted by Mistral.")).describe("Guardrails to apply.").optional(),
|
|
133
|
-
description: external_exports.string().describe("Updated description.").optional(),
|
|
134
|
-
handoffs: external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.").optional(),
|
|
135
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
136
|
-
deployment_chat: external_exports.boolean().describe("Whether to enable deployment chat.").optional(),
|
|
137
|
-
version_message: external_exports.string().describe("Version message for this update.").optional()
|
|
138
|
-
}).describe("Update a Mistral agent and create a new version.");
|
|
139
|
-
var updateAgentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
140
|
-
var deleteAgentInput = external_exports.looseObject({
|
|
141
|
-
agent_id: external_exports.string().min(1).describe("Agent ID.")
|
|
142
|
-
}).describe("Delete one agent.");
|
|
143
|
-
var deleteAgentOutput = external_exports.strictObject({
|
|
144
|
-
deleted: external_exports.boolean().describe("Whether the resource has been deleted.")
|
|
145
|
-
}).describe("Delete action response.");
|
|
146
|
-
var updateAgentVersionInput = external_exports.looseObject({
|
|
147
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
148
|
-
version: external_exports.int().describe("The target version number.")
|
|
149
|
-
}).describe("Update the current agent version.");
|
|
150
|
-
var updateAgentVersionOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
151
|
-
var listAgentVersionsInput = external_exports.looseObject({
|
|
152
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
153
|
-
page: external_exports.int().min(0).describe("Page number, starting from 0.").optional(),
|
|
154
|
-
page_size: external_exports.int().min(1).describe("The number of items returned per page.").optional()
|
|
155
|
-
}).describe("List versions for an agent.");
|
|
156
|
-
var listAgentVersionsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
157
|
-
var getAgentVersionInput = external_exports.looseObject({
|
|
158
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
159
|
-
version: external_exports.union([external_exports.string().min(1).describe("Version alias."), external_exports.int()]).describe("Version number or version alias.")
|
|
160
|
-
}).describe("Get one agent version.");
|
|
161
|
-
var getAgentVersionOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
162
|
-
var createOrUpdateAgentAliasInput = external_exports.looseObject({
|
|
163
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
164
|
-
alias: external_exports.string().min(1).describe("Agent alias name."),
|
|
165
|
-
version: external_exports.int().describe("Version number.")
|
|
166
|
-
}).describe("Create or update an agent alias.");
|
|
167
|
-
var createOrUpdateAgentAliasOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
168
|
-
var listAgentAliasesInput = external_exports.looseObject({
|
|
169
|
-
agent_id: external_exports.string().min(1).describe("Agent ID.")
|
|
170
|
-
}).describe("List agent aliases.");
|
|
171
|
-
var listAgentAliasesOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
172
|
-
var createChatCompletionInput = external_exports.looseObject({
|
|
173
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
174
|
-
messages: external_exports.array(external_exports.looseObject({}).describe("A chat message accepted by Mistral.")).min(1).describe("List of chat messages."),
|
|
175
|
-
temperature: external_exports.number().min(0).max(1.5).describe("Sampling temperature.").optional(),
|
|
176
|
-
top_p: external_exports.number().min(0).max(1).describe("Nucleus sampling threshold.").optional(),
|
|
177
|
-
max_tokens: external_exports.int().min(0).describe("The maximum number of generated tokens.").optional(),
|
|
178
|
-
stream: external_exports.boolean().describe("Whether to use streaming responses. This connector only supports false or omitted.").optional(),
|
|
179
|
-
stop: external_exports.union([external_exports.string().describe("Single stop word."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.")]).describe("Stop generating conditions.").optional(),
|
|
180
|
-
random_seed: external_exports.int().min(0).describe("Random seed.").optional(),
|
|
181
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
182
|
-
response_format: external_exports.looseObject({}).describe("Response format configuration accepted by Mistral.").optional(),
|
|
183
|
-
tools: external_exports.array(external_exports.looseObject({}).describe("Tool definition accepted by Mistral.")).describe("Tools available for the request.").optional(),
|
|
184
|
-
tool_choice: external_exports.unknown().describe("Tool calling strategy.").optional(),
|
|
185
|
-
presence_penalty: external_exports.number().min(-2).max(2).describe("Presence penalty.").optional(),
|
|
186
|
-
frequency_penalty: external_exports.number().min(-2).max(2).describe("Frequency penalty.").optional(),
|
|
187
|
-
n: external_exports.int().min(1).describe("Number of candidates.").optional(),
|
|
188
|
-
prediction: external_exports.looseObject({}).describe("Predictive optimization configuration.").optional(),
|
|
189
|
-
parallel_tool_calls: external_exports.boolean().describe("Whether to enable parallel tool invocation.").optional(),
|
|
190
|
-
prompt_mode: external_exports.string().describe("Prompt mode.").optional(),
|
|
191
|
-
reasoning_effort: external_exports.enum(["high", "none"]).describe("Reasoning strength.").optional(),
|
|
192
|
-
guardrails: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.")).describe("Guardrail configurations.").optional(),
|
|
193
|
-
safe_prompt: external_exports.boolean().describe("Whether to inject safety prompts.").optional()
|
|
194
|
-
}).describe("Input parameters for chat completion.");
|
|
195
|
-
var createChatCompletionOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
196
|
-
var createFimCompletionInput = external_exports.looseObject({
|
|
197
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
198
|
-
prompt: external_exports.string().describe("The prefix content to complete."),
|
|
199
|
-
suffix: external_exports.string().describe("Completed suffix context.").optional(),
|
|
200
|
-
temperature: external_exports.number().min(0).max(1.5).describe("Sampling temperature.").optional(),
|
|
201
|
-
top_p: external_exports.number().min(0).max(1).describe("Nucleus sampling threshold.").optional(),
|
|
202
|
-
max_tokens: external_exports.int().min(0).describe("The maximum number of generated tokens.").optional(),
|
|
203
|
-
min_tokens: external_exports.int().min(0).describe("Minimum number of generated tokens.").optional(),
|
|
204
|
-
stream: external_exports.boolean().describe("Whether to use streaming responses. This connector only supports false or omitted.").optional(),
|
|
205
|
-
stop: external_exports.union([external_exports.string().describe("Single stop word."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.")]).describe("Stop generating conditions.").optional(),
|
|
206
|
-
random_seed: external_exports.int().min(0).describe("Random seed.").optional()
|
|
207
|
-
}).describe("Input parameters for FIM completion.");
|
|
208
|
-
var createFimCompletionOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
209
|
-
var createAgentsCompletionInput = external_exports.looseObject({
|
|
210
|
-
agent_id: external_exports.string().min(1).describe("Agent ID."),
|
|
211
|
-
messages: external_exports.array(external_exports.looseObject({}).describe("A chat message accepted by Mistral.")).min(1).describe("Messages sent to the agent."),
|
|
212
|
-
temperature: external_exports.number().min(0).max(1.5).describe("Sampling temperature.").optional(),
|
|
213
|
-
top_p: external_exports.number().min(0).max(1).describe("Nucleus sampling threshold.").optional(),
|
|
214
|
-
max_tokens: external_exports.int().min(0).describe("The maximum number of generated tokens.").optional(),
|
|
215
|
-
stream: external_exports.boolean().describe("Whether to use streaming responses. This connector only supports false or omitted.").optional(),
|
|
216
|
-
stop: external_exports.union([external_exports.string().describe("Single stop word."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.")]).describe("Stop generating conditions.").optional(),
|
|
217
|
-
random_seed: external_exports.int().min(0).describe("Random seed.").optional(),
|
|
218
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
219
|
-
response_format: external_exports.looseObject({}).describe("Response format configuration accepted by Mistral.").optional(),
|
|
220
|
-
tools: external_exports.array(external_exports.looseObject({}).describe("Tool definition accepted by Mistral.")).describe("Tools added in this request.").optional(),
|
|
221
|
-
tool_choice: external_exports.unknown().describe("Tool calling strategy.").optional(),
|
|
222
|
-
presence_penalty: external_exports.number().min(-2).max(2).describe("Presence penalty.").optional(),
|
|
223
|
-
frequency_penalty: external_exports.number().min(-2).max(2).describe("Frequency penalty.").optional(),
|
|
224
|
-
n: external_exports.int().min(1).describe("Number of candidates.").optional(),
|
|
225
|
-
prediction: external_exports.looseObject({}).describe("Predictive optimization configuration.").optional(),
|
|
226
|
-
parallel_tool_calls: external_exports.boolean().describe("Whether to enable parallel tool invocation.").optional(),
|
|
227
|
-
prompt_mode: external_exports.string().describe("Prompt mode.").optional(),
|
|
228
|
-
reasoning_effort: external_exports.enum(["high", "none"]).describe("Reasoning strength.").optional()
|
|
229
|
-
}).describe("Input parameters for agent completion.");
|
|
230
|
-
var createAgentsCompletionOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
231
|
-
var createEmbeddingsInput = external_exports.looseObject({
|
|
232
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
233
|
-
input: external_exports.union([external_exports.string().describe("Single text."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.")]).describe("Text to embed."),
|
|
234
|
-
metadata: external_exports.record(external_exports.string(), external_exports.unknown().describe("Any JSON value accepted by the Mistral API.")).describe("Any JSON object accepted by the Mistral API.").optional(),
|
|
235
|
-
output_dimension: external_exports.int().min(1).describe("Output vector dimensions.").optional(),
|
|
236
|
-
output_dtype: external_exports.enum(["float", "int8", "uint8", "binary", "ubinary"]).describe("Output vector data type.").optional(),
|
|
237
|
-
encoding_format: external_exports.enum(["float", "base64"]).describe("Vector encoding format.").optional()
|
|
238
|
-
}).describe("Generate embeddings.");
|
|
239
|
-
var createEmbeddingsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
240
|
-
var createModerationInput = external_exports.looseObject({
|
|
241
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
242
|
-
input: external_exports.union([external_exports.string().describe("Single text."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings.")]).describe("Text pending review.")
|
|
243
|
-
}).describe("Moderate text.");
|
|
244
|
-
var createModerationOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
245
|
-
var createChatModerationInput = external_exports.looseObject({
|
|
246
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
247
|
-
input: external_exports.union([external_exports.array(external_exports.looseObject({}).describe("A chat message accepted by Mistral.")).describe("Messages for a single chat session."), external_exports.array(external_exports.array(external_exports.looseObject({}).describe("A chat message accepted by Mistral.")).describe("A chat session.")).describe("Multiple chat sessions.")]).describe("Chat content pending review.")
|
|
248
|
-
}).describe("Moderate chat messages.");
|
|
249
|
-
var createChatModerationOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
250
|
-
var createOcrInput = external_exports.looseObject({
|
|
251
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
252
|
-
id: external_exports.string().describe("Custom ID for this OCR request.").optional(),
|
|
253
|
-
document: external_exports.looseObject({}).describe("OCR document or image reference accepted by Mistral."),
|
|
254
|
-
pages: external_exports.array(external_exports.int().min(0).describe("Page number, starting from 0.")).describe("Only process specified pages.").optional(),
|
|
255
|
-
include_image_base64: external_exports.boolean().describe("Whether to include extracted image base64 data.").optional(),
|
|
256
|
-
image_limit: external_exports.int().describe("Maximum number of images to extract.").optional(),
|
|
257
|
-
image_min_size: external_exports.int().describe("Minimum image size to extract.").optional(),
|
|
258
|
-
bbox_annotation_format: external_exports.looseObject({}).describe("Response format configuration accepted by Mistral.").optional(),
|
|
259
|
-
document_annotation_format: external_exports.looseObject({}).describe("Response format configuration accepted by Mistral.").optional(),
|
|
260
|
-
document_annotation_prompt: external_exports.string().describe("Prompt for structured document extraction.").optional(),
|
|
261
|
-
confidence_scores_granularity: external_exports.enum(["word", "page"]).describe("Confidence granularity.").optional(),
|
|
262
|
-
table_format: external_exports.enum(["markdown", "html"]).describe("Table output format.").optional(),
|
|
263
|
-
extract_header: external_exports.boolean().describe("Whether to extract the header.").optional(),
|
|
264
|
-
extract_footer: external_exports.boolean().describe("Whether to extract the footer.").optional(),
|
|
265
|
-
bbox_annotation_format_prompt: external_exports.string().describe("Prompt for bbox structured extraction.").optional(),
|
|
266
|
-
document_annotation_prompt_extra: external_exports.string().describe("Additional document prompt words.").optional()
|
|
267
|
-
}).describe("Input parameters for OCR.");
|
|
268
|
-
var createOcrOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
269
|
-
var createAudioTranscriptionInput = external_exports.looseObject({
|
|
270
|
-
file: external_exports.union([external_exports.strictObject({
|
|
271
|
-
fileId: external_exports.string().min(1).describe("The transit file identifier returned by POST /api/files."),
|
|
272
|
-
name: external_exports.string().min(1).describe("Optional filename override to send to the provider.").optional(),
|
|
273
|
-
mimeType: external_exports.string().min(1).describe("Optional MIME type override to send to the provider.").optional()
|
|
274
|
-
}).describe("A file previously uploaded to the local transit file API."), external_exports.strictObject({
|
|
275
|
-
name: external_exports.string().min(1).describe("The filename to send to Mistral."),
|
|
276
|
-
mimeType: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
277
|
-
mimetype: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
278
|
-
url: external_exports.url().describe("A public HTTP or HTTPS URL that the connector can fetch and upload.")
|
|
279
|
-
}).describe("A public URL upload source."), external_exports.strictObject({
|
|
280
|
-
name: external_exports.string().min(1).describe("The filename to send to Mistral."),
|
|
281
|
-
mimeType: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
282
|
-
mimetype: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
283
|
-
content_base64: external_exports.string().min(1).describe("Base64-encoded file content.")
|
|
284
|
-
}).describe("A base64 upload source.")]).describe("File content to upload to Mistral.").optional(),
|
|
285
|
-
file_id: external_exports.string().min(1).describe("File ID.").optional(),
|
|
286
|
-
context_bias: external_exports.array(external_exports.string().describe("Bias phrase.")).describe("Context bias phrases.").optional(),
|
|
287
|
-
diarize: external_exports.boolean().describe("Whether to diarize speakers.").optional(),
|
|
288
|
-
language: external_exports.string().describe("Audio language code.").optional(),
|
|
289
|
-
model: external_exports.string().min(1).describe("Model ID."),
|
|
290
|
-
temperature: external_exports.number().describe("Sampling temperature.").optional(),
|
|
291
|
-
timestamp_granularities: external_exports.array(external_exports.enum(["segment", "word"]).describe("Timestamp granularity.")).describe("Timestamp granularities to include.").optional()
|
|
292
|
-
}).describe("Input parameters for audio transcription.");
|
|
293
|
-
var createAudioTranscriptionOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
294
|
-
var listFilesInput = external_exports.looseObject({
|
|
295
|
-
after: external_exports.string().describe("The previous page cursor file ID.").optional(),
|
|
296
|
-
limit: external_exports.int().min(1).describe("Maximum number of files.").optional(),
|
|
297
|
-
order: external_exports.enum(["asc", "desc"]).describe("Sort direction.").optional()
|
|
298
|
-
}).describe("List files.");
|
|
299
|
-
var listFilesOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
300
|
-
var uploadFileInput = external_exports.looseObject({
|
|
301
|
-
file: external_exports.union([external_exports.strictObject({
|
|
302
|
-
fileId: external_exports.string().min(1).describe("The transit file identifier returned by POST /api/files."),
|
|
303
|
-
name: external_exports.string().min(1).describe("Optional filename override to send to the provider.").optional(),
|
|
304
|
-
mimeType: external_exports.string().min(1).describe("Optional MIME type override to send to the provider.").optional()
|
|
305
|
-
}).describe("A file previously uploaded to the local transit file API."), external_exports.strictObject({
|
|
306
|
-
name: external_exports.string().min(1).describe("The filename to send to Mistral."),
|
|
307
|
-
mimeType: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
308
|
-
mimetype: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
309
|
-
url: external_exports.url().describe("A public HTTP or HTTPS URL that the connector can fetch and upload.")
|
|
310
|
-
}).describe("A public URL upload source."), external_exports.strictObject({
|
|
311
|
-
name: external_exports.string().min(1).describe("The filename to send to Mistral."),
|
|
312
|
-
mimeType: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
313
|
-
mimetype: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
314
|
-
content_base64: external_exports.string().min(1).describe("Base64-encoded file content.")
|
|
315
|
-
}).describe("A base64 upload source.")]).describe("File content to upload to Mistral."),
|
|
316
|
-
purpose: external_exports.string().describe("File usage, such as fine-tune, batch, or ocr.").optional(),
|
|
317
|
-
visibility: external_exports.string().describe("File visibility, such as workspace or user.").optional(),
|
|
318
|
-
expiry: external_exports.int().describe("The number of hours before the file expires.").optional()
|
|
319
|
-
}).describe("Upload a file to Mistral.");
|
|
320
|
-
var uploadFileOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
321
|
-
var retrieveFileInput = external_exports.looseObject({
|
|
322
|
-
file_id: external_exports.string().min(1).describe("File ID.")
|
|
323
|
-
}).describe("Retrieve file metadata.");
|
|
324
|
-
var retrieveFileOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
325
|
-
var deleteFileInput = external_exports.looseObject({
|
|
326
|
-
file_id: external_exports.string().min(1).describe("File ID.")
|
|
327
|
-
}).describe("Delete one file.");
|
|
328
|
-
var deleteFileOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
329
|
-
var downloadFileInput = external_exports.looseObject({
|
|
330
|
-
file_id: external_exports.string().min(1).describe("File ID.")
|
|
331
|
-
}).describe("Download one file.");
|
|
332
|
-
var downloadFileOutput = external_exports.strictObject({
|
|
333
|
-
content: external_exports.strictObject({
|
|
334
|
-
fileId: external_exports.string().min(1).describe("The local transit file identifier."),
|
|
335
|
-
downloadUrl: external_exports.url().describe("The local transit download URL."),
|
|
336
|
-
sizeBytes: external_exports.int().min(0).describe("The stored file size in bytes."),
|
|
337
|
-
name: external_exports.string().min(1).describe("The downloaded filename."),
|
|
338
|
-
mimeType: external_exports.string().min(1).describe("The downloaded file MIME type.")
|
|
339
|
-
}).describe("Downloaded file content.")
|
|
340
|
-
}).describe("The output of the file download action.");
|
|
341
|
-
var getFileSignedUrlInput = external_exports.looseObject({
|
|
342
|
-
file_id: external_exports.string().min(1).describe("File ID."),
|
|
343
|
-
expiry: external_exports.int().min(1).describe("The number of hours the signed link remains valid.").optional()
|
|
344
|
-
}).describe("Get a file signed URL.");
|
|
345
|
-
var getFileSignedUrlOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
346
|
-
var getFineTuningJobsInput = external_exports.looseObject({
|
|
347
|
-
page: external_exports.int().min(0).describe("Page number, starting from 0.").optional(),
|
|
348
|
-
page_size: external_exports.int().min(1).describe("The number of items returned per page.").optional(),
|
|
349
|
-
model: external_exports.string().describe("Filter by base model.").optional(),
|
|
350
|
-
status: external_exports.string().describe("Filter by task status.").optional(),
|
|
351
|
-
suffix: external_exports.string().describe("Filter by model suffix.").optional(),
|
|
352
|
-
wandb_name: external_exports.string().describe("Filter by Weights & Biases run name.").optional(),
|
|
353
|
-
wandb_project: external_exports.string().describe("Filter by Weights & Biases project.").optional(),
|
|
354
|
-
created_after: external_exports.string().describe("Only tasks created after this time are returned.").optional(),
|
|
355
|
-
created_before: external_exports.string().describe("Only tasks created before this time are returned.").optional(),
|
|
356
|
-
created_by_me: external_exports.boolean().describe("Whether to return only tasks created by the current caller.").optional()
|
|
357
|
-
}).describe("List fine-tuning jobs.");
|
|
358
|
-
var getFineTuningJobsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
359
|
-
var listBatchJobsInput = external_exports.looseObject({
|
|
360
|
-
page: external_exports.int().min(0).describe("Page number, starting from 0.").optional(),
|
|
361
|
-
page_size: external_exports.int().min(1).describe("The number of items returned per page.").optional(),
|
|
362
|
-
model: external_exports.string().describe("Filter by model.").optional(),
|
|
363
|
-
status: external_exports.string().describe("Filter by task status.").optional(),
|
|
364
|
-
agent_id: external_exports.string().min(1).describe("Agent ID.").optional(),
|
|
365
|
-
metadata: external_exports.string().describe("Filter by metadata string.").optional(),
|
|
366
|
-
created_after: external_exports.string().describe("Only tasks created after this time are returned.").optional(),
|
|
367
|
-
created_by_me: external_exports.boolean().describe("Whether to return only tasks created by the current caller.").optional()
|
|
368
|
-
}).describe("List batch jobs.");
|
|
369
|
-
var listBatchJobsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
370
|
-
var listLibrariesInput = external_exports.looseObject({
|
|
371
|
-
limit: external_exports.int().min(1).describe("Maximum number of libraries.").optional(),
|
|
372
|
-
page_token: external_exports.string().describe("Pagination token.").optional()
|
|
373
|
-
}).describe("List libraries.");
|
|
374
|
-
var listLibrariesOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
375
|
-
var createLibraryInput = external_exports.looseObject({
|
|
376
|
-
name: external_exports.string().min(1).describe("Library name."),
|
|
377
|
-
description: external_exports.string().describe("Library description.").optional(),
|
|
378
|
-
chunk_size: external_exports.int().describe("Document chunk size.").optional()
|
|
379
|
-
}).describe("Create a library.");
|
|
380
|
-
var createLibraryOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
381
|
-
var getLibraryInput = external_exports.looseObject({
|
|
382
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID.")
|
|
383
|
-
}).describe("Get one library.");
|
|
384
|
-
var getLibraryOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
385
|
-
var updateLibraryInput = external_exports.looseObject({
|
|
386
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
387
|
-
name: external_exports.string().describe("Updated library name.").optional(),
|
|
388
|
-
description: external_exports.string().describe("Updated library description.").optional()
|
|
389
|
-
}).describe("Update a library.");
|
|
390
|
-
var updateLibraryOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
391
|
-
var deleteLibraryInput = external_exports.looseObject({
|
|
392
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID.")
|
|
393
|
-
}).describe("Delete one library.");
|
|
394
|
-
var deleteLibraryOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
395
|
-
var listLibraryDocumentsInput = external_exports.looseObject({
|
|
396
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
397
|
-
page: external_exports.int().min(0).describe("Page number, starting from 0.").optional(),
|
|
398
|
-
page_size: external_exports.int().min(1).describe("The number of items returned per page.").optional(),
|
|
399
|
-
search: external_exports.string().describe("Document search keywords.").optional(),
|
|
400
|
-
filters_attributes: external_exports.string().describe("Property filter expression.").optional(),
|
|
401
|
-
sort_by: external_exports.string().describe("Sort field.").optional(),
|
|
402
|
-
sort_order: external_exports.enum(["asc", "desc"]).describe("Sort direction.").optional()
|
|
403
|
-
}).describe("List library documents.");
|
|
404
|
-
var listLibraryDocumentsOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
405
|
-
var uploadLibraryDocumentInput = external_exports.looseObject({
|
|
406
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
407
|
-
file: external_exports.union([external_exports.strictObject({
|
|
408
|
-
fileId: external_exports.string().min(1).describe("The transit file identifier returned by POST /api/files."),
|
|
409
|
-
name: external_exports.string().min(1).describe("Optional filename override to send to the provider.").optional(),
|
|
410
|
-
mimeType: external_exports.string().min(1).describe("Optional MIME type override to send to the provider.").optional()
|
|
411
|
-
}).describe("A file previously uploaded to the local transit file API."), external_exports.strictObject({
|
|
412
|
-
name: external_exports.string().min(1).describe("The filename to send to Mistral."),
|
|
413
|
-
mimeType: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
414
|
-
mimetype: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
415
|
-
url: external_exports.url().describe("A public HTTP or HTTPS URL that the connector can fetch and upload.")
|
|
416
|
-
}).describe("A public URL upload source."), external_exports.strictObject({
|
|
417
|
-
name: external_exports.string().min(1).describe("The filename to send to Mistral."),
|
|
418
|
-
mimeType: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
419
|
-
mimetype: external_exports.string().min(1).describe("The MIME type of the uploaded file.").optional(),
|
|
420
|
-
content_base64: external_exports.string().min(1).describe("Base64-encoded file content.")
|
|
421
|
-
}).describe("A base64 upload source.")]).describe("File content to upload to Mistral.")
|
|
422
|
-
}).describe("Upload a document to a library.");
|
|
423
|
-
var uploadLibraryDocumentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
424
|
-
var getLibraryDocumentInput = external_exports.looseObject({
|
|
425
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
426
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
427
|
-
}).describe("Get one library document.");
|
|
428
|
-
var getLibraryDocumentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
429
|
-
var updateLibraryDocumentInput = external_exports.looseObject({
|
|
430
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
431
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID."),
|
|
432
|
-
name: external_exports.string().describe("Updated document name.").optional(),
|
|
433
|
-
attributes: external_exports.record(external_exports.string(), external_exports.union([external_exports.boolean().describe("Boolean attribute."), external_exports.string().describe("String attribute."), external_exports.number().describe("Numeric attribute."), external_exports.array(external_exports.string().min(1)).min(1).describe("A list of strings."), external_exports.array(external_exports.number().describe("A number.")).describe("A list of numbers."), external_exports.array(external_exports.boolean().describe("A boolean.")).describe("A list of booleans.")]).describe("Attribute value.")).describe("Knowledge base document attributes.").optional()
|
|
434
|
-
}).describe("Update a library document.");
|
|
435
|
-
var updateLibraryDocumentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
436
|
-
var deleteLibraryDocumentInput = external_exports.looseObject({
|
|
437
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
438
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
439
|
-
}).describe("Delete one library document.");
|
|
440
|
-
var deleteLibraryDocumentOutput = external_exports.strictObject({
|
|
441
|
-
deleted: external_exports.boolean().describe("Whether the resource has been deleted.")
|
|
442
|
-
}).describe("Delete action response.");
|
|
443
|
-
var getDocumentTextContentInput = external_exports.looseObject({
|
|
444
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
445
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
446
|
-
}).describe("Get document text content.");
|
|
447
|
-
var getDocumentTextContentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
448
|
-
var getDocumentStatusInput = external_exports.looseObject({
|
|
449
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
450
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
451
|
-
}).describe("Get document processing status.");
|
|
452
|
-
var getDocumentStatusOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
453
|
-
var getDocumentSignedUrlInput = external_exports.looseObject({
|
|
454
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
455
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
456
|
-
}).describe("Get document signed URL.");
|
|
457
|
-
var getDocumentSignedUrlOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
458
|
-
var getDocumentExtractedTextUrlInput = external_exports.looseObject({
|
|
459
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
460
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
461
|
-
}).describe("Get document extracted text URL.");
|
|
462
|
-
var getDocumentExtractedTextUrlOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
463
|
-
var reprocessDocumentInput = external_exports.looseObject({
|
|
464
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
465
|
-
document_id: external_exports.string().min(1).describe("Knowledge base document ID.")
|
|
466
|
-
}).describe("Reprocess a library document.");
|
|
467
|
-
var reprocessDocumentOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
468
|
-
var listLibrarySharesInput = external_exports.looseObject({
|
|
469
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID.")
|
|
470
|
-
}).describe("List library shares.");
|
|
471
|
-
var listLibrarySharesOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
472
|
-
var createLibraryShareInput = external_exports.looseObject({
|
|
473
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
474
|
-
level: external_exports.enum(["Viewer", "Editor"]).describe("Sharing permission level."),
|
|
475
|
-
org_id: external_exports.string().describe("Organization ID.").optional(),
|
|
476
|
-
share_with_uuid: external_exports.string().min(1).describe("The UUID of the shared object."),
|
|
477
|
-
share_with_type: external_exports.string().min(1).describe("The entity type of the shared object.")
|
|
478
|
-
}).describe("Create or update a library share.");
|
|
479
|
-
var createLibraryShareOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
480
|
-
var deleteLibraryShareInput = external_exports.looseObject({
|
|
481
|
-
library_id: external_exports.string().min(1).describe("Knowledge base library ID."),
|
|
482
|
-
org_id: external_exports.string().describe("Organization ID.").optional(),
|
|
483
|
-
share_with_uuid: external_exports.string().min(1).describe("The UUID of the object to unshare."),
|
|
484
|
-
share_with_type: external_exports.string().min(1).describe("The object entity type to unshare.")
|
|
485
|
-
}).describe("Remove a library share.");
|
|
486
|
-
var deleteLibraryShareOutput = external_exports.unknown().describe("Raw response data returned by the Mistral API.");
|
|
487
|
-
var mistralAiActions = {
|
|
488
|
-
list_models: {
|
|
489
|
-
description: "List all Mistral models accessible by the current API key.",
|
|
490
|
-
effect: "read",
|
|
491
|
-
inputSchema: listModelsInput,
|
|
492
|
-
outputSchema: external_exports.toJSONSchema(listModelsOutput, { io: "output", unrepresentable: "any" })
|
|
493
|
-
},
|
|
494
|
-
get_model: {
|
|
495
|
-
description: "Get details of a single Mistral model by model ID.",
|
|
496
|
-
effect: "read",
|
|
497
|
-
inputSchema: getModelInput,
|
|
498
|
-
outputSchema: external_exports.toJSONSchema(getModelOutput, { io: "output", unrepresentable: "any" })
|
|
499
|
-
},
|
|
500
|
-
list_conversations: {
|
|
501
|
-
description: "List conversations under the current organization with pagination and metadata filters.",
|
|
502
|
-
effect: "read",
|
|
503
|
-
inputSchema: listConversationsInput,
|
|
504
|
-
outputSchema: external_exports.toJSONSchema(listConversationsOutput, { io: "output", unrepresentable: "any" })
|
|
505
|
-
},
|
|
506
|
-
start_conversation: {
|
|
507
|
-
description: "Create a new conversation and append initial context.",
|
|
508
|
-
effect: "write",
|
|
509
|
-
inputSchema: startConversationInput,
|
|
510
|
-
outputSchema: external_exports.toJSONSchema(startConversationOutput, { io: "output", unrepresentable: "any" })
|
|
511
|
-
},
|
|
512
|
-
get_conversation: {
|
|
513
|
-
description: "Get metadata for a single conversation by ID.",
|
|
514
|
-
effect: "read",
|
|
515
|
-
inputSchema: getConversationInput,
|
|
516
|
-
outputSchema: external_exports.toJSONSchema(getConversationOutput, { io: "output", unrepresentable: "any" })
|
|
517
|
-
},
|
|
518
|
-
delete_conversation: {
|
|
519
|
-
description: "Delete the specified conversation.",
|
|
520
|
-
effect: "destructive",
|
|
521
|
-
inputSchema: deleteConversationInput,
|
|
522
|
-
outputSchema: external_exports.toJSONSchema(deleteConversationOutput, { io: "output", unrepresentable: "any" })
|
|
523
|
-
},
|
|
524
|
-
append_to_conversation: {
|
|
525
|
-
description: "Append a new message to an existing conversation.",
|
|
526
|
-
effect: "write",
|
|
527
|
-
inputSchema: appendToConversationInput,
|
|
528
|
-
outputSchema: external_exports.toJSONSchema(appendToConversationOutput, { io: "output", unrepresentable: "any" })
|
|
529
|
-
},
|
|
530
|
-
get_conversation_history: {
|
|
531
|
-
description: "Get all history entries in a conversation.",
|
|
532
|
-
effect: "read",
|
|
533
|
-
inputSchema: getConversationHistoryInput,
|
|
534
|
-
outputSchema: external_exports.toJSONSchema(getConversationHistoryOutput, { io: "output", unrepresentable: "any" })
|
|
535
|
-
},
|
|
536
|
-
get_conversation_messages: {
|
|
537
|
-
description: "Get all message entries in a conversation.",
|
|
538
|
-
effect: "read",
|
|
539
|
-
inputSchema: getConversationMessagesInput,
|
|
540
|
-
outputSchema: external_exports.toJSONSchema(getConversationMessagesOutput, { io: "output", unrepresentable: "any" })
|
|
541
|
-
},
|
|
542
|
-
restart_conversation: {
|
|
543
|
-
description: "Restart a conversation from a historical entry.",
|
|
544
|
-
effect: "write",
|
|
545
|
-
inputSchema: restartConversationInput,
|
|
546
|
-
outputSchema: external_exports.toJSONSchema(restartConversationOutput, { io: "output", unrepresentable: "any" })
|
|
547
|
-
},
|
|
548
|
-
list_agents: {
|
|
549
|
-
description: "List agents with pagination, name, source, or metadata filters.",
|
|
550
|
-
effect: "read",
|
|
551
|
-
inputSchema: listAgentsInput,
|
|
552
|
-
outputSchema: external_exports.toJSONSchema(listAgentsOutput, { io: "output", unrepresentable: "any" })
|
|
553
|
-
},
|
|
554
|
-
create_agent: {
|
|
555
|
-
description: "Create a new Mistral agent.",
|
|
556
|
-
effect: "write",
|
|
557
|
-
inputSchema: createAgentInput,
|
|
558
|
-
outputSchema: external_exports.toJSONSchema(createAgentOutput, { io: "output", unrepresentable: "any" })
|
|
559
|
-
},
|
|
560
|
-
get_agent: {
|
|
561
|
-
description: "Get a single agent by ID.",
|
|
562
|
-
effect: "read",
|
|
563
|
-
inputSchema: getAgentInput,
|
|
564
|
-
outputSchema: external_exports.toJSONSchema(getAgentOutput, { io: "output", unrepresentable: "any" })
|
|
565
|
-
},
|
|
566
|
-
update_agent: {
|
|
567
|
-
description: "Update an agent configuration and create a new version.",
|
|
568
|
-
effect: "write",
|
|
569
|
-
inputSchema: updateAgentInput,
|
|
570
|
-
outputSchema: external_exports.toJSONSchema(updateAgentOutput, { io: "output", unrepresentable: "any" })
|
|
571
|
-
},
|
|
572
|
-
delete_agent: {
|
|
573
|
-
description: "Delete the specified agent.",
|
|
574
|
-
effect: "destructive",
|
|
575
|
-
inputSchema: deleteAgentInput,
|
|
576
|
-
outputSchema: external_exports.toJSONSchema(deleteAgentOutput, { io: "output", unrepresentable: "any" })
|
|
577
|
-
},
|
|
578
|
-
update_agent_version: {
|
|
579
|
-
description: "Switch the current version of an agent.",
|
|
580
|
-
effect: "write",
|
|
581
|
-
inputSchema: updateAgentVersionInput,
|
|
582
|
-
outputSchema: external_exports.toJSONSchema(updateAgentVersionOutput, { io: "output", unrepresentable: "any" })
|
|
583
|
-
},
|
|
584
|
-
list_agent_versions: {
|
|
585
|
-
description: "List all versions of the specified agent.",
|
|
586
|
-
effect: "read",
|
|
587
|
-
inputSchema: listAgentVersionsInput,
|
|
588
|
-
outputSchema: external_exports.toJSONSchema(listAgentVersionsOutput, { io: "output", unrepresentable: "any" })
|
|
589
|
-
},
|
|
590
|
-
get_agent_version: {
|
|
591
|
-
description: "Get version details of the specified agent.",
|
|
592
|
-
effect: "read",
|
|
593
|
-
inputSchema: getAgentVersionInput,
|
|
594
|
-
outputSchema: external_exports.toJSONSchema(getAgentVersionOutput, { io: "output", unrepresentable: "any" })
|
|
595
|
-
},
|
|
596
|
-
create_or_update_agent_alias: {
|
|
597
|
-
description: "Create or update an agent version alias.",
|
|
598
|
-
effect: "write",
|
|
599
|
-
inputSchema: createOrUpdateAgentAliasInput,
|
|
600
|
-
outputSchema: external_exports.toJSONSchema(createOrUpdateAgentAliasOutput, { io: "output", unrepresentable: "any" })
|
|
601
|
-
},
|
|
602
|
-
list_agent_aliases: {
|
|
603
|
-
description: "List all version aliases for the specified agent.",
|
|
604
|
-
effect: "read",
|
|
605
|
-
inputSchema: listAgentAliasesInput,
|
|
606
|
-
outputSchema: external_exports.toJSONSchema(listAgentAliasesOutput, { io: "output", unrepresentable: "any" })
|
|
607
|
-
},
|
|
608
|
-
create_chat_completion: {
|
|
609
|
-
description: "Call the Mistral chat completions API.",
|
|
610
|
-
effect: "write",
|
|
611
|
-
inputSchema: createChatCompletionInput,
|
|
612
|
-
outputSchema: external_exports.toJSONSchema(createChatCompletionOutput, { io: "output", unrepresentable: "any" })
|
|
613
|
-
},
|
|
614
|
-
create_fim_completion: {
|
|
615
|
-
description: "Call the Mistral FIM completions API.",
|
|
616
|
-
effect: "write",
|
|
617
|
-
inputSchema: createFimCompletionInput,
|
|
618
|
-
outputSchema: external_exports.toJSONSchema(createFimCompletionOutput, { io: "output", unrepresentable: "any" })
|
|
619
|
-
},
|
|
620
|
-
create_agents_completion: {
|
|
621
|
-
description: "Call the Mistral agents completions API.",
|
|
622
|
-
effect: "write",
|
|
623
|
-
inputSchema: createAgentsCompletionInput,
|
|
624
|
-
outputSchema: external_exports.toJSONSchema(createAgentsCompletionOutput, { io: "output", unrepresentable: "any" })
|
|
625
|
-
},
|
|
626
|
-
create_embeddings: {
|
|
627
|
-
description: "Generate embeddings with Mistral.",
|
|
628
|
-
effect: "write",
|
|
629
|
-
inputSchema: createEmbeddingsInput,
|
|
630
|
-
outputSchema: external_exports.toJSONSchema(createEmbeddingsOutput, { io: "output", unrepresentable: "any" })
|
|
631
|
-
},
|
|
632
|
-
create_moderation: {
|
|
633
|
-
description: "Detect text safety risks with Mistral moderation.",
|
|
634
|
-
effect: "write",
|
|
635
|
-
inputSchema: createModerationInput,
|
|
636
|
-
outputSchema: external_exports.toJSONSchema(createModerationOutput, { io: "output", unrepresentable: "any" })
|
|
637
|
-
},
|
|
638
|
-
create_chat_moderation: {
|
|
639
|
-
description: "Detect chat message safety risks with Mistral moderation.",
|
|
640
|
-
effect: "write",
|
|
641
|
-
inputSchema: createChatModerationInput,
|
|
642
|
-
outputSchema: external_exports.toJSONSchema(createChatModerationOutput, { io: "output", unrepresentable: "any" })
|
|
643
|
-
},
|
|
644
|
-
create_ocr: {
|
|
645
|
-
description: "Run Mistral OCR on a document or image.",
|
|
646
|
-
effect: "write",
|
|
647
|
-
inputSchema: createOcrInput,
|
|
648
|
-
outputSchema: external_exports.toJSONSchema(createOcrOutput, { io: "output", unrepresentable: "any" })
|
|
649
|
-
},
|
|
650
|
-
create_audio_transcription: {
|
|
651
|
-
description: "Upload or reference audio and create a transcription.",
|
|
652
|
-
effect: "write",
|
|
653
|
-
inputSchema: createAudioTranscriptionInput,
|
|
654
|
-
outputSchema: external_exports.toJSONSchema(createAudioTranscriptionOutput, { io: "output", unrepresentable: "any" })
|
|
655
|
-
},
|
|
656
|
-
list_files: {
|
|
657
|
-
description: "List all files under the current organization.",
|
|
658
|
-
effect: "read",
|
|
659
|
-
inputSchema: listFilesInput,
|
|
660
|
-
outputSchema: external_exports.toJSONSchema(listFilesOutput, { io: "output", unrepresentable: "any" })
|
|
661
|
-
},
|
|
662
|
-
upload_file: {
|
|
663
|
-
description: "Upload a file to Mistral for fine-tuning, batch, or OCR.",
|
|
664
|
-
effect: "write",
|
|
665
|
-
inputSchema: uploadFileInput,
|
|
666
|
-
outputSchema: external_exports.toJSONSchema(uploadFileOutput, { io: "output", unrepresentable: "any" })
|
|
667
|
-
},
|
|
668
|
-
retrieve_file: {
|
|
669
|
-
description: "Get file metadata by file ID.",
|
|
670
|
-
effect: "read",
|
|
671
|
-
inputSchema: retrieveFileInput,
|
|
672
|
-
outputSchema: external_exports.toJSONSchema(retrieveFileOutput, { io: "output", unrepresentable: "any" })
|
|
673
|
-
},
|
|
674
|
-
delete_file: {
|
|
675
|
-
description: "Delete the specified file.",
|
|
676
|
-
effect: "destructive",
|
|
677
|
-
inputSchema: deleteFileInput,
|
|
678
|
-
outputSchema: external_exports.toJSONSchema(deleteFileOutput, { io: "output", unrepresentable: "any" })
|
|
679
|
-
},
|
|
680
|
-
download_file: {
|
|
681
|
-
description: "Download Mistral file contents into the local transit file store.",
|
|
682
|
-
effect: "read",
|
|
683
|
-
inputSchema: downloadFileInput,
|
|
684
|
-
outputSchema: external_exports.toJSONSchema(downloadFileOutput, { io: "output", unrepresentable: "any" })
|
|
685
|
-
},
|
|
686
|
-
get_file_signed_url: {
|
|
687
|
-
description: "Get a temporary signed download link for a file.",
|
|
688
|
-
effect: "read",
|
|
689
|
-
inputSchema: getFileSignedUrlInput,
|
|
690
|
-
outputSchema: external_exports.toJSONSchema(getFileSignedUrlOutput, { io: "output", unrepresentable: "any" })
|
|
691
|
-
},
|
|
692
|
-
get_fine_tuning_jobs: {
|
|
693
|
-
description: "List fine-tuning jobs with pagination and filters.",
|
|
694
|
-
effect: "read",
|
|
695
|
-
inputSchema: getFineTuningJobsInput,
|
|
696
|
-
outputSchema: external_exports.toJSONSchema(getFineTuningJobsOutput, { io: "output", unrepresentable: "any" })
|
|
697
|
-
},
|
|
698
|
-
list_batch_jobs: {
|
|
699
|
-
description: "List batch jobs with pagination and filters.",
|
|
700
|
-
effect: "read",
|
|
701
|
-
inputSchema: listBatchJobsInput,
|
|
702
|
-
outputSchema: external_exports.toJSONSchema(listBatchJobsOutput, { io: "output", unrepresentable: "any" })
|
|
703
|
-
},
|
|
704
|
-
list_libraries: {
|
|
705
|
-
description: "List libraries under the current organization.",
|
|
706
|
-
effect: "read",
|
|
707
|
-
inputSchema: listLibrariesInput,
|
|
708
|
-
outputSchema: external_exports.toJSONSchema(listLibrariesOutput, { io: "output", unrepresentable: "any" })
|
|
709
|
-
},
|
|
710
|
-
create_library: {
|
|
711
|
-
description: "Create a new Mistral library.",
|
|
712
|
-
effect: "write",
|
|
713
|
-
inputSchema: createLibraryInput,
|
|
714
|
-
outputSchema: external_exports.toJSONSchema(createLibraryOutput, { io: "output", unrepresentable: "any" })
|
|
715
|
-
},
|
|
716
|
-
get_library: {
|
|
717
|
-
description: "Get library details by library ID.",
|
|
718
|
-
effect: "read",
|
|
719
|
-
inputSchema: getLibraryInput,
|
|
720
|
-
outputSchema: external_exports.toJSONSchema(getLibraryOutput, { io: "output", unrepresentable: "any" })
|
|
721
|
-
},
|
|
722
|
-
update_library: {
|
|
723
|
-
description: "Update a library.",
|
|
724
|
-
effect: "write",
|
|
725
|
-
inputSchema: updateLibraryInput,
|
|
726
|
-
outputSchema: external_exports.toJSONSchema(updateLibraryOutput, { io: "output", unrepresentable: "any" })
|
|
727
|
-
},
|
|
728
|
-
delete_library: {
|
|
729
|
-
description: "Delete the specified library.",
|
|
730
|
-
effect: "destructive",
|
|
731
|
-
inputSchema: deleteLibraryInput,
|
|
732
|
-
outputSchema: external_exports.toJSONSchema(deleteLibraryOutput, { io: "output", unrepresentable: "any" })
|
|
733
|
-
},
|
|
734
|
-
list_library_documents: {
|
|
735
|
-
description: "List documents under a library.",
|
|
736
|
-
effect: "read",
|
|
737
|
-
inputSchema: listLibraryDocumentsInput,
|
|
738
|
-
outputSchema: external_exports.toJSONSchema(listLibraryDocumentsOutput, { io: "output", unrepresentable: "any" })
|
|
739
|
-
},
|
|
740
|
-
upload_library_document: {
|
|
741
|
-
description: "Upload a new document to a library.",
|
|
742
|
-
effect: "write",
|
|
743
|
-
inputSchema: uploadLibraryDocumentInput,
|
|
744
|
-
outputSchema: external_exports.toJSONSchema(uploadLibraryDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
745
|
-
},
|
|
746
|
-
get_library_document: {
|
|
747
|
-
description: "Get details of a single library document.",
|
|
748
|
-
effect: "read",
|
|
749
|
-
inputSchema: getLibraryDocumentInput,
|
|
750
|
-
outputSchema: external_exports.toJSONSchema(getLibraryDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
751
|
-
},
|
|
752
|
-
update_library_document: {
|
|
753
|
-
description: "Update a library document.",
|
|
754
|
-
effect: "write",
|
|
755
|
-
inputSchema: updateLibraryDocumentInput,
|
|
756
|
-
outputSchema: external_exports.toJSONSchema(updateLibraryDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
757
|
-
},
|
|
758
|
-
delete_library_document: {
|
|
759
|
-
description: "Delete a library document.",
|
|
760
|
-
effect: "destructive",
|
|
761
|
-
inputSchema: deleteLibraryDocumentInput,
|
|
762
|
-
outputSchema: external_exports.toJSONSchema(deleteLibraryDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
763
|
-
},
|
|
764
|
-
get_document_text_content: {
|
|
765
|
-
description: "Get extracted text content for a library document.",
|
|
766
|
-
effect: "read",
|
|
767
|
-
inputSchema: getDocumentTextContentInput,
|
|
768
|
-
outputSchema: external_exports.toJSONSchema(getDocumentTextContentOutput, { io: "output", unrepresentable: "any" })
|
|
769
|
-
},
|
|
770
|
-
get_document_status: {
|
|
771
|
-
description: "Get processing status for a library document.",
|
|
772
|
-
effect: "read",
|
|
773
|
-
inputSchema: getDocumentStatusInput,
|
|
774
|
-
outputSchema: external_exports.toJSONSchema(getDocumentStatusOutput, { io: "output", unrepresentable: "any" })
|
|
775
|
-
},
|
|
776
|
-
get_document_signed_url: {
|
|
777
|
-
description: "Get a temporary signed link to a library document's original file.",
|
|
778
|
-
effect: "read",
|
|
779
|
-
inputSchema: getDocumentSignedUrlInput,
|
|
780
|
-
outputSchema: external_exports.toJSONSchema(getDocumentSignedUrlOutput, { io: "output", unrepresentable: "any" })
|
|
781
|
-
},
|
|
782
|
-
get_document_extracted_text_url: {
|
|
783
|
-
description: "Get a temporary signed link to a library document's extracted text file.",
|
|
784
|
-
effect: "read",
|
|
785
|
-
inputSchema: getDocumentExtractedTextUrlInput,
|
|
786
|
-
outputSchema: external_exports.toJSONSchema(getDocumentExtractedTextUrlOutput, { io: "output", unrepresentable: "any" })
|
|
787
|
-
},
|
|
788
|
-
reprocess_document: {
|
|
789
|
-
description: "Reprocess the specified library document.",
|
|
790
|
-
effect: "write",
|
|
791
|
-
inputSchema: reprocessDocumentInput,
|
|
792
|
-
outputSchema: external_exports.toJSONSchema(reprocessDocumentOutput, { io: "output", unrepresentable: "any" })
|
|
793
|
-
},
|
|
794
|
-
list_library_shares: {
|
|
795
|
-
description: "List shared access records for a library.",
|
|
796
|
-
effect: "read",
|
|
797
|
-
inputSchema: listLibrarySharesInput,
|
|
798
|
-
outputSchema: external_exports.toJSONSchema(listLibrarySharesOutput, { io: "output", unrepresentable: "any" })
|
|
799
|
-
},
|
|
800
|
-
create_library_share: {
|
|
801
|
-
description: "Create or update shared access for a library.",
|
|
802
|
-
effect: "write",
|
|
803
|
-
inputSchema: createLibraryShareInput,
|
|
804
|
-
outputSchema: external_exports.toJSONSchema(createLibraryShareOutput, { io: "output", unrepresentable: "any" })
|
|
805
|
-
},
|
|
806
|
-
delete_library_share: {
|
|
807
|
-
description: "Remove shared access from a library.",
|
|
808
|
-
effect: "destructive",
|
|
809
|
-
inputSchema: deleteLibraryShareInput,
|
|
810
|
-
outputSchema: external_exports.toJSONSchema(deleteLibraryShareOutput, { io: "output", unrepresentable: "any" })
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
|
-
|
|
814
|
-
// ../plugins/src/mistral_ai/api.ts
|
|
815
|
-
var SERVICE = "mistral_ai";
|
|
816
|
-
var API_BASE = "https://api.mistral.ai";
|
|
817
|
-
var MAX_REMOTE_UPLOAD_BYTES = 100 * 1024 * 1024;
|
|
818
|
-
var SPECS = {
|
|
819
|
-
list_models: { method: "GET", path: "/v1/models" },
|
|
820
|
-
get_model: { method: "GET", path: "/v1/models/{model_id}", pathKeys: ["model_id"] },
|
|
821
|
-
list_conversations: { method: "GET", path: "/v1/conversations" },
|
|
822
|
-
start_conversation: { method: "POST", path: "/v1/conversations" },
|
|
823
|
-
get_conversation: { method: "GET", path: "/v1/conversations/{conversation_id}", pathKeys: ["conversation_id"] },
|
|
824
|
-
delete_conversation: { method: "DELETE", path: "/v1/conversations/{conversation_id}", pathKeys: ["conversation_id"] },
|
|
825
|
-
append_to_conversation: { method: "POST", path: "/v1/conversations/{conversation_id}", pathKeys: ["conversation_id"] },
|
|
826
|
-
get_conversation_history: {
|
|
827
|
-
method: "GET",
|
|
828
|
-
path: "/v1/conversations/{conversation_id}/history",
|
|
829
|
-
pathKeys: ["conversation_id"]
|
|
830
|
-
},
|
|
831
|
-
get_conversation_messages: {
|
|
832
|
-
method: "GET",
|
|
833
|
-
path: "/v1/conversations/{conversation_id}/messages",
|
|
834
|
-
pathKeys: ["conversation_id"]
|
|
835
|
-
},
|
|
836
|
-
restart_conversation: {
|
|
837
|
-
method: "POST",
|
|
838
|
-
path: "/v1/conversations/{conversation_id}/restart",
|
|
839
|
-
pathKeys: ["conversation_id"]
|
|
840
|
-
},
|
|
841
|
-
list_agents: { method: "GET", path: "/v1/agents" },
|
|
842
|
-
create_agent: { method: "POST", path: "/v1/agents" },
|
|
843
|
-
get_agent: { method: "GET", path: "/v1/agents/{agent_id}", pathKeys: ["agent_id"] },
|
|
844
|
-
update_agent: { method: "PATCH", path: "/v1/agents/{agent_id}", pathKeys: ["agent_id"] },
|
|
845
|
-
delete_agent: { method: "DELETE", path: "/v1/agents/{agent_id}", pathKeys: ["agent_id"] },
|
|
846
|
-
update_agent_version: {
|
|
847
|
-
method: "PATCH",
|
|
848
|
-
path: "/v1/agents/{agent_id}/version",
|
|
849
|
-
pathKeys: ["agent_id"],
|
|
850
|
-
queryKeys: ["version"]
|
|
851
|
-
},
|
|
852
|
-
list_agent_versions: { method: "GET", path: "/v1/agents/{agent_id}/versions", pathKeys: ["agent_id"] },
|
|
853
|
-
get_agent_version: {
|
|
854
|
-
method: "GET",
|
|
855
|
-
path: "/v1/agents/{agent_id}/versions/{version}",
|
|
856
|
-
pathKeys: ["agent_id", "version"]
|
|
857
|
-
},
|
|
858
|
-
create_or_update_agent_alias: {
|
|
859
|
-
method: "PUT",
|
|
860
|
-
path: "/v1/agents/{agent_id}/aliases",
|
|
861
|
-
pathKeys: ["agent_id"],
|
|
862
|
-
queryKeys: ["alias", "version"]
|
|
863
|
-
},
|
|
864
|
-
list_agent_aliases: { method: "GET", path: "/v1/agents/{agent_id}/aliases", pathKeys: ["agent_id"] },
|
|
865
|
-
create_chat_completion: { method: "POST", path: "/v1/chat/completions" },
|
|
866
|
-
create_fim_completion: { method: "POST", path: "/v1/fim/completions" },
|
|
867
|
-
create_agents_completion: { method: "POST", path: "/v1/agents/completions" },
|
|
868
|
-
create_embeddings: { method: "POST", path: "/v1/embeddings" },
|
|
869
|
-
create_moderation: { method: "POST", path: "/v1/moderations" },
|
|
870
|
-
create_chat_moderation: { method: "POST", path: "/v1/chat/moderations" },
|
|
871
|
-
create_ocr: { method: "POST", path: "/v1/ocr" },
|
|
872
|
-
create_audio_transcription: { method: "POST", path: "/v1/audio/transcriptions", kind: "multipart" },
|
|
873
|
-
list_files: { method: "GET", path: "/v1/files" },
|
|
874
|
-
upload_file: { method: "POST", path: "/v1/files", kind: "multipart" },
|
|
875
|
-
retrieve_file: { method: "GET", path: "/v1/files/{file_id}", pathKeys: ["file_id"] },
|
|
876
|
-
delete_file: { method: "DELETE", path: "/v1/files/{file_id}", pathKeys: ["file_id"] },
|
|
877
|
-
download_file: { method: "GET", path: "/v1/files/{file_id}/content", pathKeys: ["file_id"], kind: "download" },
|
|
878
|
-
get_file_signed_url: { method: "GET", path: "/v1/files/{file_id}/url", pathKeys: ["file_id"] },
|
|
879
|
-
get_fine_tuning_jobs: { method: "GET", path: "/v1/fine_tuning/jobs" },
|
|
880
|
-
list_batch_jobs: { method: "GET", path: "/v1/batch/jobs" },
|
|
881
|
-
list_libraries: { method: "GET", path: "/v1/libraries" },
|
|
882
|
-
create_library: { method: "POST", path: "/v1/libraries" },
|
|
883
|
-
get_library: { method: "GET", path: "/v1/libraries/{library_id}", pathKeys: ["library_id"] },
|
|
884
|
-
update_library: { method: "PUT", path: "/v1/libraries/{library_id}", pathKeys: ["library_id"] },
|
|
885
|
-
delete_library: { method: "DELETE", path: "/v1/libraries/{library_id}", pathKeys: ["library_id"] },
|
|
886
|
-
list_library_documents: {
|
|
887
|
-
method: "GET",
|
|
888
|
-
path: "/v1/libraries/{library_id}/documents",
|
|
889
|
-
pathKeys: ["library_id"]
|
|
890
|
-
},
|
|
891
|
-
upload_library_document: {
|
|
892
|
-
method: "POST",
|
|
893
|
-
path: "/v1/libraries/{library_id}/documents",
|
|
894
|
-
pathKeys: ["library_id"],
|
|
895
|
-
kind: "multipart"
|
|
896
|
-
},
|
|
897
|
-
get_library_document: {
|
|
898
|
-
method: "GET",
|
|
899
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}",
|
|
900
|
-
pathKeys: ["library_id", "document_id"]
|
|
901
|
-
},
|
|
902
|
-
update_library_document: {
|
|
903
|
-
method: "PUT",
|
|
904
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}",
|
|
905
|
-
pathKeys: ["library_id", "document_id"]
|
|
906
|
-
},
|
|
907
|
-
delete_library_document: {
|
|
908
|
-
method: "DELETE",
|
|
909
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}",
|
|
910
|
-
pathKeys: ["library_id", "document_id"]
|
|
911
|
-
},
|
|
912
|
-
get_document_text_content: {
|
|
913
|
-
method: "GET",
|
|
914
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}/text_content",
|
|
915
|
-
pathKeys: ["library_id", "document_id"]
|
|
916
|
-
},
|
|
917
|
-
get_document_status: {
|
|
918
|
-
method: "GET",
|
|
919
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}/status",
|
|
920
|
-
pathKeys: ["library_id", "document_id"]
|
|
921
|
-
},
|
|
922
|
-
get_document_signed_url: {
|
|
923
|
-
method: "GET",
|
|
924
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}/signed-url",
|
|
925
|
-
pathKeys: ["library_id", "document_id"]
|
|
926
|
-
},
|
|
927
|
-
get_document_extracted_text_url: {
|
|
928
|
-
method: "GET",
|
|
929
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url",
|
|
930
|
-
pathKeys: ["library_id", "document_id"]
|
|
931
|
-
},
|
|
932
|
-
reprocess_document: {
|
|
933
|
-
method: "POST",
|
|
934
|
-
path: "/v1/libraries/{library_id}/documents/{document_id}/reprocess",
|
|
935
|
-
pathKeys: ["library_id", "document_id"]
|
|
936
|
-
},
|
|
937
|
-
list_library_shares: { method: "GET", path: "/v1/libraries/{library_id}/share", pathKeys: ["library_id"] },
|
|
938
|
-
create_library_share: { method: "PUT", path: "/v1/libraries/{library_id}/share", pathKeys: ["library_id"] },
|
|
939
|
-
delete_library_share: {
|
|
940
|
-
method: "DELETE",
|
|
941
|
-
path: "/v1/libraries/{library_id}/share",
|
|
942
|
-
pathKeys: ["library_id"],
|
|
943
|
-
bodyOnDelete: true
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
function text(value) {
|
|
947
|
-
return typeof value === "string" && value !== "" ? value : void 0;
|
|
948
|
-
}
|
|
949
|
-
var http = createAuthedClient({
|
|
950
|
-
baseUrl: API_BASE,
|
|
951
|
-
service: SERVICE,
|
|
952
|
-
auth: { kind: "bearer" },
|
|
953
|
-
headers: { "content-type": "application/json" },
|
|
954
|
-
mapError: ({ data, rawText, status }) => {
|
|
955
|
-
const payload = asJsonObject(data);
|
|
956
|
-
const fallback = `mistral_ai request failed with ${status}`;
|
|
957
|
-
const message = text(payload?.detail) ?? text(payload?.message) ?? text(payload?.error) ?? text(rawText) ?? fallback;
|
|
958
|
-
return upstreamError(status === 422 ? 400 : status || 502, message);
|
|
959
|
-
}
|
|
960
|
-
});
|
|
961
|
-
function compactJson(value) {
|
|
962
|
-
if (Array.isArray(value)) return value.map((item) => compactJson(item));
|
|
963
|
-
if (value === null || typeof value !== "object") return value;
|
|
964
|
-
return Object.fromEntries(
|
|
965
|
-
Object.entries(value).filter(([, child]) => child !== void 0).map(([key, child]) => [key, compactJson(child)])
|
|
966
|
-
);
|
|
967
|
-
}
|
|
968
|
-
function appendQuery(url, key, value) {
|
|
969
|
-
if (value === void 0 || value === null) return;
|
|
970
|
-
if (Array.isArray(value)) {
|
|
971
|
-
for (const item of value) appendQuery(url, key, item);
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
if (typeof value === "object") {
|
|
975
|
-
url.searchParams.append(key, JSON.stringify(value));
|
|
976
|
-
return;
|
|
977
|
-
}
|
|
978
|
-
url.searchParams.append(key, String(value));
|
|
979
|
-
}
|
|
980
|
-
function appendMultipart(form, key, value) {
|
|
981
|
-
if (value === void 0 || value === null) return;
|
|
982
|
-
if (Array.isArray(value)) {
|
|
983
|
-
for (const item of value) appendMultipart(form, key, item);
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
form.append(key, typeof value === "string" ? value : typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value));
|
|
987
|
-
}
|
|
988
|
-
async function errorMessage(response) {
|
|
989
|
-
const fallback = `mistral_ai request failed with ${response.status}`;
|
|
990
|
-
const body = await response.text().catch(() => "");
|
|
991
|
-
if (body.trim() === "") return fallback;
|
|
992
|
-
try {
|
|
993
|
-
const payload = asJsonObject(JSON.parse(body));
|
|
994
|
-
return text(payload?.detail) ?? text(payload?.message) ?? text(payload?.error) ?? fallback;
|
|
995
|
-
} catch {
|
|
996
|
-
return body;
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
async function assertOk(response) {
|
|
1000
|
-
if (response.ok) return;
|
|
1001
|
-
const message = await errorMessage(response);
|
|
1002
|
-
throw upstreamError(response.status === 422 ? 400 : response.status || 502, message);
|
|
1003
|
-
}
|
|
1004
|
-
async function readResponse(response) {
|
|
1005
|
-
if ((response.headers.get("content-type") ?? "").includes("application/json")) {
|
|
1006
|
-
try {
|
|
1007
|
-
return await response.json();
|
|
1008
|
-
} catch {
|
|
1009
|
-
throw upstreamError(502, "mistral_ai returned malformed JSON");
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
return await response.text();
|
|
1013
|
-
}
|
|
1014
|
-
function buildUrl(spec, input) {
|
|
1015
|
-
const remaining = { ...input };
|
|
1016
|
-
let path = spec.path;
|
|
1017
|
-
for (const key of spec.pathKeys ?? []) {
|
|
1018
|
-
const value = remaining[key];
|
|
1019
|
-
if (value === void 0 || value === null || String(value) === "") {
|
|
1020
|
-
throw new TBError("invalid_argument", `${key} is required.`);
|
|
1021
|
-
}
|
|
1022
|
-
path = path.replace(`{${key}}`, encodeURIComponent(String(value)));
|
|
1023
|
-
delete remaining[key];
|
|
1024
|
-
}
|
|
1025
|
-
const url = new URL(path, API_BASE);
|
|
1026
|
-
const takesAllAsQuery = spec.method === "GET" || spec.method === "DELETE" && spec.bodyOnDelete !== true;
|
|
1027
|
-
if (takesAllAsQuery) {
|
|
1028
|
-
for (const [key, value] of Object.entries(remaining)) appendQuery(url, key, value);
|
|
1029
|
-
return { url: url.toString(), remaining };
|
|
1030
|
-
}
|
|
1031
|
-
for (const key of spec.queryKeys ?? []) {
|
|
1032
|
-
if (key in remaining) {
|
|
1033
|
-
appendQuery(url, key, remaining[key]);
|
|
1034
|
-
delete remaining[key];
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
return { url: url.toString(), remaining };
|
|
1038
|
-
}
|
|
1039
|
-
function decodeBase64(value) {
|
|
1040
|
-
let binary;
|
|
1041
|
-
try {
|
|
1042
|
-
binary = atob(value);
|
|
1043
|
-
} catch {
|
|
1044
|
-
throw new TBError("invalid_argument", "file.content_base64 \u4E0D\u662F\u5408\u6CD5\u7684 base64");
|
|
1045
|
-
}
|
|
1046
|
-
const bytes = new Uint8Array(binary.length);
|
|
1047
|
-
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
1048
|
-
return bytes;
|
|
1049
|
-
}
|
|
1050
|
-
async function readBounded(response, maxBytes, field) {
|
|
1051
|
-
return readBoundedResponseBytes(response, {
|
|
1052
|
-
checkContentLength: false,
|
|
1053
|
-
maxBytes,
|
|
1054
|
-
tooLarge: () => new TBError("invalid_argument", `${field} \u8D85\u8FC7 ${maxBytes} \u5B57\u8282\u4E0A\u9650`)
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
async function resolveUpload(remaining) {
|
|
1058
|
-
const file = asJsonObject(remaining.file);
|
|
1059
|
-
if (file === void 0) throw new TBError("invalid_argument", "file is required.");
|
|
1060
|
-
if (text(file.fileId) !== void 0) {
|
|
1061
|
-
throw new TBError(
|
|
1062
|
-
"invalid_argument",
|
|
1063
|
-
"file.fileId(transit file)\u5728 tool-bridge \u4E0A\u4E0D\u53EF\u7528,\u8BF7\u6539\u7528 file.url \u6216 file.content_base64"
|
|
1064
|
-
);
|
|
1065
|
-
}
|
|
1066
|
-
const fileName = text(file.name);
|
|
1067
|
-
if (fileName === void 0) throw new TBError("invalid_argument", "file.name is required.");
|
|
1068
|
-
const mimeType = text(file.mimeType) ?? text(file.mimetype);
|
|
1069
|
-
const fileUrl = text(file.url);
|
|
1070
|
-
const contentBase64 = text(file.content_base64);
|
|
1071
|
-
if (fileUrl !== void 0 && contentBase64 !== void 0) {
|
|
1072
|
-
throw new TBError("invalid_argument", "provide only one of file.url or file.content_base64");
|
|
1073
|
-
}
|
|
1074
|
-
if (contentBase64 !== void 0) {
|
|
1075
|
-
return { bytes: decodeBase64(contentBase64), fileName, mimeType: mimeType ?? "application/octet-stream" };
|
|
1076
|
-
}
|
|
1077
|
-
if (fileUrl === void 0) {
|
|
1078
|
-
throw new TBError("invalid_argument", "file must include url or content_base64");
|
|
1079
|
-
}
|
|
1080
|
-
const response = await guardedFetch(fileUrl, { headers: { accept: "*/*" } });
|
|
1081
|
-
if (!response.ok) {
|
|
1082
|
-
throw upstreamError(response.status >= 500 ? 502 : response.status, `failed to fetch file.url: ${response.status}`);
|
|
1083
|
-
}
|
|
1084
|
-
return {
|
|
1085
|
-
bytes: await readBounded(response, MAX_REMOTE_UPLOAD_BYTES, "file.url"),
|
|
1086
|
-
fileName,
|
|
1087
|
-
mimeType: mimeType ?? response.headers.get("content-type") ?? "application/octet-stream"
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
function authHeaders(ctx) {
|
|
1091
|
-
return { authorization: `Bearer ${requireApiKey(ctx, SERVICE)}` };
|
|
1092
|
-
}
|
|
1093
|
-
async function executeJson(spec, input, ctx) {
|
|
1094
|
-
const { url, remaining } = buildUrl(spec, input);
|
|
1095
|
-
const sendsBody = spec.method === "POST" || spec.method === "PUT" || spec.method === "PATCH" || spec.method === "DELETE" && spec.bodyOnDelete === true;
|
|
1096
|
-
const result = await http.request(ctx, {
|
|
1097
|
-
path: url,
|
|
1098
|
-
method: spec.method,
|
|
1099
|
-
...sendsBody ? { json: compactJson(remaining) } : {},
|
|
1100
|
-
responseType: "auto",
|
|
1101
|
-
invalidJsonMessage: "mistral_ai returned malformed JSON"
|
|
1102
|
-
});
|
|
1103
|
-
if (result.status === 204) return { deleted: true };
|
|
1104
|
-
return result.bodyKind === "empty" ? "" : result.data;
|
|
1105
|
-
}
|
|
1106
|
-
async function executeMultipart(spec, input, ctx) {
|
|
1107
|
-
const { url, remaining } = buildUrl(spec, input);
|
|
1108
|
-
const source = await resolveUpload(remaining);
|
|
1109
|
-
const form = new FormData();
|
|
1110
|
-
form.set("file", new File([source.bytes], source.fileName, { type: source.mimeType }));
|
|
1111
|
-
for (const [key, value] of Object.entries(remaining)) {
|
|
1112
|
-
if (key !== "file") appendMultipart(form, key, value);
|
|
1113
|
-
}
|
|
1114
|
-
const response = await guardedFetch(url, {
|
|
1115
|
-
method: spec.method,
|
|
1116
|
-
headers: authHeaders(ctx),
|
|
1117
|
-
body: form
|
|
1118
|
-
});
|
|
1119
|
-
await assertOk(response);
|
|
1120
|
-
return await readResponse(response);
|
|
1121
|
-
}
|
|
1122
|
-
async function executeAudioTranscription(spec, input, ctx) {
|
|
1123
|
-
const { url, remaining } = buildUrl(spec, input);
|
|
1124
|
-
const file = asJsonObject(remaining.file);
|
|
1125
|
-
const fileId = text(remaining.file_id);
|
|
1126
|
-
const fileUrl = text(file?.url);
|
|
1127
|
-
const inline = text(file?.content_base64) ?? text(file?.fileId);
|
|
1128
|
-
const sources = [fileId, fileUrl, inline].filter((item) => item !== void 0).length;
|
|
1129
|
-
if (sources > 1) {
|
|
1130
|
-
throw new TBError(
|
|
1131
|
-
"invalid_argument",
|
|
1132
|
-
"provide only one of file_id, file.url, file.fileId, or file.content_base64"
|
|
1133
|
-
);
|
|
1134
|
-
}
|
|
1135
|
-
const form = new FormData();
|
|
1136
|
-
if (fileId !== void 0) {
|
|
1137
|
-
form.set("file_id", fileId);
|
|
1138
|
-
} else if (fileUrl !== void 0) {
|
|
1139
|
-
try {
|
|
1140
|
-
assertPublicHttpUrl(fileUrl);
|
|
1141
|
-
} catch {
|
|
1142
|
-
throw new TBError("invalid_argument", "file.url \u5FC5\u987B\u662F\u516C\u7F51\u53EF\u8FBE\u7684 http(s) \u5730\u5740");
|
|
1143
|
-
}
|
|
1144
|
-
form.set("file_url", fileUrl);
|
|
1145
|
-
} else {
|
|
1146
|
-
const source = await resolveUpload(remaining);
|
|
1147
|
-
form.set("file", new File([source.bytes], source.fileName, { type: source.mimeType }));
|
|
1148
|
-
}
|
|
1149
|
-
for (const [key, value] of Object.entries(remaining)) {
|
|
1150
|
-
if (key !== "file" && key !== "file_id") appendMultipart(form, key, value);
|
|
1151
|
-
}
|
|
1152
|
-
const response = await guardedFetch(url, {
|
|
1153
|
-
method: spec.method,
|
|
1154
|
-
headers: authHeaders(ctx),
|
|
1155
|
-
body: form
|
|
1156
|
-
});
|
|
1157
|
-
await assertOk(response);
|
|
1158
|
-
return await readResponse(response);
|
|
1159
|
-
}
|
|
1160
|
-
function downloadFile() {
|
|
1161
|
-
return Promise.reject(new TBError(
|
|
1162
|
-
"unavailable",
|
|
1163
|
-
"download_file \u9700\u8981\u672C\u5730 transit file \u5B58\u50A8,tool-bridge \u5C1A\u672A\u63D0\u4F9B;\u8BF7\u6539\u7528 get_file_signed_url",
|
|
1164
|
-
{ httpStatus: 501 }
|
|
1165
|
-
));
|
|
1166
|
-
}
|
|
1167
|
-
async function execute(name, input, ctx) {
|
|
1168
|
-
const spec = SPECS[name];
|
|
1169
|
-
if (input.stream === true) {
|
|
1170
|
-
throw new TBError("invalid_argument", `${name} does not support stream=true in connector actions`);
|
|
1171
|
-
}
|
|
1172
|
-
if (spec.kind === "download") return await downloadFile();
|
|
1173
|
-
if (name === "create_audio_transcription") return await executeAudioTranscription(spec, input, ctx);
|
|
1174
|
-
if (spec.kind === "multipart") return await executeMultipart(spec, input, ctx);
|
|
1175
|
-
return await executeJson(spec, input, ctx);
|
|
1176
|
-
}
|
|
1177
|
-
var mistralAiHandlers = Object.fromEntries(
|
|
1178
|
-
Object.keys(SPECS).map((name) => [name, (input, ctx) => execute(name, input, ctx)])
|
|
1179
|
-
);
|
|
1180
|
-
|
|
1181
|
-
// ../plugins/src/mistral_ai/index.ts
|
|
1182
|
-
function createMistralAiPlugin() {
|
|
1183
|
-
return createProviderPlugin({
|
|
1184
|
-
description: "Mistral AI",
|
|
1185
|
-
actions: mistralAiActions,
|
|
1186
|
-
// 上游的 credentialValidator 打的就是 /v1/models,只读、无必填入参、不消耗 token 额度。
|
|
1187
|
-
credentialProbe: "list_models",
|
|
1188
|
-
handlers: mistralAiHandlers
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1191
|
-
var mistral_ai_default = createMistralAiPlugin();
|
|
1192
|
-
export {
|
|
1193
|
-
createMistralAiPlugin,
|
|
1194
|
-
mistral_ai_default as default
|
|
1195
|
-
};
|