AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(mistral-ai): ui improvement (#16704)
Talal Jaber8e9bec4c2ba0
diff --git a/bun.lock b/bun.lockindex 6fe67b4d5c9..1e7ee1eae7d 100644--- a/bun.lock+++ b/bun.lock@@ -6170,7 +6170,7 @@},"packages/pieces/community/mistral-ai": {"name": "@activepieces/piece-mistral-ai",- "version": "0.4.0",+ "version": "0.5.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*",diff --git a/packages/pieces/community/mistral-ai/package.json b/packages/pieces/community/mistral-ai/package.jsonindex dece296a798..091cdcfc1e4 100644--- a/packages/pieces/community/mistral-ai/package.json+++ b/packages/pieces/community/mistral-ai/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-mistral-ai",- "version": "0.4.0",+ "version": "0.5.0","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","scripts": {diff --git a/packages/pieces/community/mistral-ai/src/i18n/de.json b/packages/pieces/community/mistral-ai/src/i18n/de.jsonindex 1baf6189b46..68b812ed348 100644--- a/packages/pieces/community/mistral-ai/src/i18n/de.json+++ b/packages/pieces/community/mistral-ai/src/i18n/de.json@@ -62,5 +62,41 @@"None": "Keine","JSON": "JSON","Form Data": "Formulardaten",- "Raw": "Rohe"+ "Raw": "Rohe",+ "Ask a Mistral model a question and get its answer.": "Stellen Sie einem Mistral-Modell eine Frage und erhalten Sie die Antwort.",+ "Settings": "Einstellungen",+ "Message": "Nachricht",+ "The Mistral model that writes the reply.": "Das Mistral-Modell, das die Antwort schreibt.",+ "What you want the model to answer or do.": "Was das Modell beantworten oder tun soll.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "Von 0 bis 1,5. Niedriger ist fokussierter, höher ist abwechslungsreicher.",+ "From 0 to 1. Adjust this or Temperature, not both.": "Von 0 bis 1. Passen Sie dies oder die Temperatur an, nicht beides.",+ "Longest reply in tokens, about 4 characters each.": "Längste Antwort in Tokens, je etwa 4 Zeichen.",+ "Set a seed to make repeated calls return the same output.": "Legen Sie einen Seed fest, damit wiederholte Aufrufe dieselbe Ausgabe liefern.",+ "Timeout": "Zeitlimit",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Millisekunden, die auf eine Antwort gewartet wird. Leer: 30 Sekunden.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Wandeln Sie eine Liste von Texten mit dem Modell mistral-embed in Vektoren um.",+ "Content": "Inhalt",+ "Texts": "Texte",+ "Each text gets its own vector from the mistral-embed model.": "Jeder Text erhält einen eigenen Vektor vom Modell mistral-embed.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Laden Sie eine Datei für OCR, Batch-Jobs oder Fine-Tuning zu Mistral hoch.",+ "Upload": "Hochladen",+ "Use for": "Verwenden für",+ "The file to send to Mistral, up to 512 MB.": "Die Datei, die an Mistral gesendet wird, bis zu 512 MB.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Wofür Mistral die Datei verwenden darf. Fine-Tuning benötigt eine .jsonl-Datei.",+ "OCR": "OCR",+ "Batch": "Batch",+ "Fine-Tuning": "Fine-Tuning",+ "Extract the text of a PDF or image as Markdown.": "Extrahieren Sie den Text einer PDF-Datei oder eines Bildes als Markdown.",+ "Latest is recommended. Version 2505 never changes.": "Neueste wird empfohlen. Version 2505 ändert sich nie.",+ "Latest": "Neueste",+ "Version 2505": "Version 2505",+ "Where the PDF or image to read comes from.": "Woher die zu lesende PDF-Datei oder das Bild stammt.",+ "Public URL": "Öffentliche URL",+ "Mistral File ID": "Mistral-Datei-ID",+ "Page numbers to read, starting at 0. Empty: every page.": "Zu lesende Seitennummern, beginnend bei 0. Leer: alle Seiten.",+ "Include Images": "Bilder einbeziehen",+ "Also return the images found in the document, as base64.": "Gibt auch die im Dokument gefundenen Bilder als Base64 zurück.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Millisekunden, die auf eine Antwort gewartet wird. Leer: 2 Minuten.",+ "Request": "Anfrage",+ "Data to send": "Zu sendende Daten"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/es.json b/packages/pieces/community/mistral-ai/src/i18n/es.jsonindex ac2bdae4af0..cc2cb94039b 100644--- a/packages/pieces/community/mistral-ai/src/i18n/es.json+++ b/packages/pieces/community/mistral-ai/src/i18n/es.json@@ -62,5 +62,41 @@"None": "Ninguna","JSON": "JSON","Form Data": "Datos de Formulario",- "Raw": "Rápido"+ "Raw": "Rápido",+ "Ask a Mistral model a question and get its answer.": "Haz una pregunta a un modelo de Mistral y obtén su respuesta.",+ "Settings": "Configuración",+ "Message": "Mensaje",+ "The Mistral model that writes the reply.": "El modelo de Mistral que escribe la respuesta.",+ "What you want the model to answer or do.": "Lo que quieres que el modelo responda o haga.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "De 0 a 1,5. Más bajo es más preciso, más alto es más variado.",+ "From 0 to 1. Adjust this or Temperature, not both.": "De 0 a 1. Ajusta esto o la temperatura, no ambos.",+ "Longest reply in tokens, about 4 characters each.": "Respuesta más larga en tokens, de unos 4 caracteres cada uno.",+ "Set a seed to make repeated calls return the same output.": "Define una semilla para que las llamadas repetidas devuelvan el mismo resultado.",+ "Timeout": "Tiempo de espera",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Milisegundos de espera de una respuesta. Vacío: 30 segundos.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Convierte una lista de textos en vectores con el modelo mistral-embed.",+ "Content": "Contenido",+ "Texts": "Textos",+ "Each text gets its own vector from the mistral-embed model.": "Cada texto recibe su propio vector del modelo mistral-embed.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Sube un archivo a Mistral para OCR, trabajos por lotes o ajuste fino.",+ "Upload": "Subir",+ "Use for": "Usar para",+ "The file to send to Mistral, up to 512 MB.": "El archivo que se envía a Mistral, hasta 512 MB.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Para qué puede usar Mistral el archivo. El ajuste fino necesita un archivo .jsonl.",+ "OCR": "OCR",+ "Batch": "Lote",+ "Fine-Tuning": "Ajuste fino",+ "Extract the text of a PDF or image as Markdown.": "Extrae el texto de un PDF o una imagen como Markdown.",+ "Latest is recommended. Version 2505 never changes.": "Se recomienda la más reciente. La versión 2505 nunca cambia.",+ "Latest": "Más reciente",+ "Version 2505": "Versión 2505",+ "Where the PDF or image to read comes from.": "De dónde procede el PDF o la imagen que se va a leer.",+ "Public URL": "URL pública",+ "Mistral File ID": "ID de archivo de Mistral",+ "Page numbers to read, starting at 0. Empty: every page.": "Números de página que se leerán, empezando por 0. Vacío: todas las páginas.",+ "Include Images": "Incluir imágenes",+ "Also return the images found in the document, as base64.": "Devuelve también las imágenes encontradas en el documento, en base64.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Milisegundos de espera de una respuesta. Vacío: 2 minutos.",+ "Request": "Solicitud",+ "Data to send": "Datos a enviar"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/fr.json b/packages/pieces/community/mistral-ai/src/i18n/fr.jsonindex 328bf94f85f..1c08400474d 100644--- a/packages/pieces/community/mistral-ai/src/i18n/fr.json+++ b/packages/pieces/community/mistral-ai/src/i18n/fr.json@@ -62,5 +62,41 @@"None": "Aucun","JSON": "JSON","Form Data": "Données du formulaire",- "Raw": "Brut"+ "Raw": "Brut",+ "Ask a Mistral model a question and get its answer.": "Posez une question à un modèle Mistral et obtenez sa réponse.",+ "Settings": "Paramètres",+ "Message": "Message",+ "The Mistral model that writes the reply.": "Le modèle Mistral qui rédige la réponse.",+ "What you want the model to answer or do.": "Ce que le modèle doit répondre ou faire.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "De 0 à 1,5. Plus bas est plus ciblé, plus haut est plus varié.",+ "From 0 to 1. Adjust this or Temperature, not both.": "De 0 à 1. Ajustez ceci ou la température, pas les deux.",+ "Longest reply in tokens, about 4 characters each.": "Réponse la plus longue en jetons, environ 4 caractères chacun.",+ "Set a seed to make repeated calls return the same output.": "Définissez une graine pour que les appels répétés renvoient le même résultat.",+ "Timeout": "Délai d'expiration",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Millisecondes d'attente d'une réponse. Vide : 30 secondes.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Transformez une liste de textes en vecteurs avec le modèle mistral-embed.",+ "Content": "Contenu",+ "Texts": "Textes",+ "Each text gets its own vector from the mistral-embed model.": "Chaque texte obtient son propre vecteur du modèle mistral-embed.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Chargez un fichier dans Mistral pour l'OCR, des traitements par lot ou le fine-tuning.",+ "Upload": "Charger",+ "Use for": "Utiliser pour",+ "The file to send to Mistral, up to 512 MB.": "Le fichier à envoyer à Mistral, jusqu'à 512 Mo.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Ce pour quoi Mistral peut utiliser le fichier. Le fine-tuning nécessite un fichier .jsonl.",+ "OCR": "OCR",+ "Batch": "Lot",+ "Fine-Tuning": "Fine-tuning",+ "Extract the text of a PDF or image as Markdown.": "Extrayez le texte d'un PDF ou d'une image au format Markdown.",+ "Latest is recommended. Version 2505 never changes.": "La plus récente est recommandée. La version 2505 ne change jamais.",+ "Latest": "La plus récente",+ "Version 2505": "Version 2505",+ "Where the PDF or image to read comes from.": "D'où provient le PDF ou l'image à lire.",+ "Public URL": "URL publique",+ "Mistral File ID": "ID de fichier Mistral",+ "Page numbers to read, starting at 0. Empty: every page.": "Numéros des pages à lire, à partir de 0. Vide : toutes les pages.",+ "Include Images": "Inclure les images",+ "Also return the images found in the document, as base64.": "Renvoie aussi les images trouvées dans le document, en base64.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Millisecondes d'attente d'une réponse. Vide : 2 minutes.",+ "Request": "Requête",+ "Data to send": "Données à envoyer"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/ja.json b/packages/pieces/community/mistral-ai/src/i18n/ja.jsonindex 16258cad242..5b4b5ff4bb7 100644--- a/packages/pieces/community/mistral-ai/src/i18n/ja.json+++ b/packages/pieces/community/mistral-ai/src/i18n/ja.json@@ -62,5 +62,41 @@"None": "なし","JSON": "JSON","Form Data": "フォームデータ",- "Raw": "Raw"+ "Raw": "Raw",+ "Ask a Mistral model a question and get its answer.": "Mistral モデルに質問して回答を受け取ります。",+ "Settings": "設定",+ "Message": "メッセージ",+ "The Mistral model that writes the reply.": "回答を作成する Mistral モデル。",+ "What you want the model to answer or do.": "モデルに答えてほしいこと、またはしてほしいこと。",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "0 から 1.5。低いほど的を絞った出力に、高いほど多様な出力になります。",+ "From 0 to 1. Adjust this or Temperature, not both.": "0 から 1。これか温度のどちらか一方だけを調整してください。",+ "Longest reply in tokens, about 4 characters each.": "回答の最大長(トークン数)。1 トークンは約 4 文字です。",+ "Set a seed to make repeated calls return the same output.": "シードを設定すると、繰り返し呼び出しても同じ出力が返ります。",+ "Timeout": "タイムアウト",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "応答を待つミリ秒数。空欄の場合は 30 秒。",+ "Turn a list of texts into vectors with the mistral-embed model.": "mistral-embed モデルでテキストのリストをベクトルに変換します。",+ "Content": "コンテンツ",+ "Texts": "テキスト",+ "Each text gets its own vector from the mistral-embed model.": "各テキストに mistral-embed モデルのベクトルが 1 つずつ作成されます。",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "OCR、バッチジョブ、ファインチューニング用に Mistral へファイルをアップロードします。",+ "Upload": "アップロード",+ "Use for": "用途",+ "The file to send to Mistral, up to 512 MB.": "Mistral に送信するファイル(最大 512 MB)。",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Mistral がこのファイルを使う用途。ファインチューニングには .jsonl ファイルが必要です。",+ "OCR": "OCR",+ "Batch": "バッチ",+ "Fine-Tuning": "ファインチューニング",+ "Extract the text of a PDF or image as Markdown.": "PDF または画像のテキストを Markdown として抽出します。",+ "Latest is recommended. Version 2505 never changes.": "最新版を推奨します。バージョン 2505 は変わりません。",+ "Latest": "最新版",+ "Version 2505": "バージョン 2505",+ "Where the PDF or image to read comes from.": "読み取る PDF または画像の取得元。",+ "Public URL": "公開 URL",+ "Mistral File ID": "Mistral ファイル ID",+ "Page numbers to read, starting at 0. Empty: every page.": "読み取るページ番号(0 から開始)。空欄の場合はすべてのページ。",+ "Include Images": "画像を含める",+ "Also return the images found in the document, as base64.": "ドキュメント内の画像も base64 で返します。",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "応答を待つミリ秒数。空欄の場合は 2 分。",+ "Request": "リクエスト",+ "Data to send": "送信するデータ"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/nl.json b/packages/pieces/community/mistral-ai/src/i18n/nl.jsonindex d9bab8bf622..526671ebdf7 100644--- a/packages/pieces/community/mistral-ai/src/i18n/nl.json+++ b/packages/pieces/community/mistral-ai/src/i18n/nl.json@@ -62,5 +62,41 @@"None": "geen","JSON": "JSON","Form Data": "Formulieren gegevens",- "Raw": "Onbewerkte"+ "Raw": "Onbewerkte",+ "Ask a Mistral model a question and get its answer.": "Stel een Mistral-model een vraag en krijg het antwoord.",+ "Settings": "Instellingen",+ "Message": "Bericht",+ "The Mistral model that writes the reply.": "Het Mistral-model dat het antwoord schrijft.",+ "What you want the model to answer or do.": "Wat het model moet beantwoorden of doen.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "Van 0 tot 1,5. Lager is gerichter, hoger is gevarieerder.",+ "From 0 to 1. Adjust this or Temperature, not both.": "Van 0 tot 1. Pas dit of de temperatuur aan, niet allebei.",+ "Longest reply in tokens, about 4 characters each.": "Langste antwoord in tokens, elk ongeveer 4 tekens.",+ "Set a seed to make repeated calls return the same output.": "Stel een seed in zodat herhaalde aanroepen dezelfde uitvoer geven.",+ "Timeout": "Time-out",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Milliseconden wachten op een antwoord. Leeg: 30 seconden.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Zet een lijst met teksten om in vectoren met het model mistral-embed.",+ "Content": "Inhoud",+ "Texts": "Teksten",+ "Each text gets its own vector from the mistral-embed model.": "Elke tekst krijgt een eigen vector van het model mistral-embed.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Upload een bestand naar Mistral voor OCR, batchtaken of fine-tuning.",+ "Upload": "Uploaden",+ "Use for": "Gebruiken voor",+ "The file to send to Mistral, up to 512 MB.": "Het bestand dat naar Mistral wordt gestuurd, tot 512 MB.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Waarvoor Mistral het bestand mag gebruiken. Fine-tuning vereist een .jsonl-bestand.",+ "OCR": "OCR",+ "Batch": "Batch",+ "Fine-Tuning": "Fine-tuning",+ "Extract the text of a PDF or image as Markdown.": "Haal de tekst van een pdf of afbeelding op als Markdown.",+ "Latest is recommended. Version 2505 never changes.": "Nieuwste wordt aanbevolen. Versie 2505 verandert nooit.",+ "Latest": "Nieuwste",+ "Version 2505": "Versie 2505",+ "Where the PDF or image to read comes from.": "Waar de te lezen pdf of afbeelding vandaan komt.",+ "Public URL": "Openbare URL",+ "Mistral File ID": "Mistral-bestands-ID",+ "Page numbers to read, starting at 0. Empty: every page.": "Paginanummers om te lezen, vanaf 0. Leeg: alle pagina's.",+ "Include Images": "Afbeeldingen opnemen",+ "Also return the images found in the document, as base64.": "Geef ook de afbeeldingen uit het document terug, als base64.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Milliseconden wachten op een antwoord. Leeg: 2 minuten.",+ "Request": "Verzoek",+ "Data to send": "Te verzenden gegevens"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/pt.json b/packages/pieces/community/mistral-ai/src/i18n/pt.jsonindex 44b2db11af0..9496eb20fac 100644--- a/packages/pieces/community/mistral-ai/src/i18n/pt.json+++ b/packages/pieces/community/mistral-ai/src/i18n/pt.json@@ -62,5 +62,41 @@"None": "Nenhuma","JSON": "JSON","Form Data": "Dados de Formulário",- "Raw": "RAW"+ "Raw": "RAW",+ "Ask a Mistral model a question and get its answer.": "Faça uma pergunta a um modelo da Mistral e receba a resposta.",+ "Settings": "Configurações",+ "Message": "Mensagem",+ "The Mistral model that writes the reply.": "O modelo da Mistral que escreve a resposta.",+ "What you want the model to answer or do.": "O que você quer que o modelo responda ou faça.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "De 0 a 1,5. Menor é mais focado, maior é mais variado.",+ "From 0 to 1. Adjust this or Temperature, not both.": "De 0 a 1. Ajuste isto ou a temperatura, não ambos.",+ "Longest reply in tokens, about 4 characters each.": "Resposta mais longa em tokens, cerca de 4 caracteres cada.",+ "Set a seed to make repeated calls return the same output.": "Defina uma semente para que chamadas repetidas retornem o mesmo resultado.",+ "Timeout": "Tempo limite",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Milissegundos de espera por uma resposta. Vazio: 30 segundos.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Transforme uma lista de textos em vetores com o modelo mistral-embed.",+ "Content": "Conteúdo",+ "Texts": "Textos",+ "Each text gets its own vector from the mistral-embed model.": "Cada texto recebe seu próprio vetor do modelo mistral-embed.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Envie um arquivo para a Mistral para OCR, trabalhos em lote ou ajuste fino.",+ "Upload": "Envio",+ "Use for": "Usar para",+ "The file to send to Mistral, up to 512 MB.": "O arquivo a enviar para a Mistral, até 512 MB.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Para que a Mistral pode usar o arquivo. O ajuste fino precisa de um arquivo .jsonl.",+ "OCR": "OCR",+ "Batch": "Lote",+ "Fine-Tuning": "Ajuste fino",+ "Extract the text of a PDF or image as Markdown.": "Extraia o texto de um PDF ou imagem como Markdown.",+ "Latest is recommended. Version 2505 never changes.": "A mais recente é recomendada. A versão 2505 nunca muda.",+ "Latest": "Mais recente",+ "Version 2505": "Versão 2505",+ "Where the PDF or image to read comes from.": "De onde vem o PDF ou a imagem a ser lida.",+ "Public URL": "URL pública",+ "Mistral File ID": "ID do arquivo da Mistral",+ "Page numbers to read, starting at 0. Empty: every page.": "Números das páginas a ler, começando em 0. Vazio: todas as páginas.",+ "Include Images": "Incluir imagens",+ "Also return the images found in the document, as base64.": "Também retorna as imagens encontradas no documento, em base64.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Milissegundos de espera por uma resposta. Vazio: 2 minutos.",+ "Request": "Requisição",+ "Data to send": "Dados a enviar"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/ru.json b/packages/pieces/community/mistral-ai/src/i18n/ru.jsonindex 0d1f1385ce9..d129ff4d25b 100644--- a/packages/pieces/community/mistral-ai/src/i18n/ru.json+++ b/packages/pieces/community/mistral-ai/src/i18n/ru.json@@ -43,5 +43,42 @@"PATCH": "ПАТЧ","PUT": "ПОКУПИТЬ","DELETE": "УДАЛИТЬ",- "HEAD": "HEAD"+ "HEAD": "HEAD",+ "Ask a Mistral model a question and get its answer.": "Задайте вопрос модели Mistral и получите ответ.",+ "Settings": "Настройки",+ "Message": "Сообщение",+ "The Mistral model that writes the reply.": "Модель Mistral, которая пишет ответ.",+ "What you want the model to answer or do.": "Что модель должна ответить или сделать.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "От 0 до 1,5. Ниже — точнее, выше — разнообразнее.",+ "From 0 to 1. Adjust this or Temperature, not both.": "От 0 до 1. Меняйте это или температуру, но не оба.",+ "Longest reply in tokens, about 4 characters each.": "Максимальная длина ответа в токенах, примерно 4 символа каждый.",+ "Set a seed to make repeated calls return the same output.": "Задайте seed, чтобы повторные вызовы возвращали одинаковый результат.",+ "Timeout": "Тайм-аут",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Сколько миллисекунд ждать ответа. Пусто: 30 секунд.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Преобразует список текстов в векторы с помощью модели mistral-embed.",+ "Content": "Содержимое",+ "Texts": "Тексты",+ "Each text gets its own vector from the mistral-embed model.": "Каждый текст получает свой вектор от модели mistral-embed.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Загружает файл в Mistral для OCR, пакетных заданий или тонкой настройки.",+ "Upload": "Загрузка",+ "Use for": "Назначение",+ "The file to send to Mistral, up to 512 MB.": "Файл для отправки в Mistral, до 512 МБ.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Для чего Mistral может использовать файл. Для тонкой настройки нужен файл .jsonl.",+ "OCR": "OCR",+ "Batch": "Пакет",+ "Fine-Tuning": "Тонкая настройка",+ "Extract the text of a PDF or image as Markdown.": "Извлекает текст из PDF или изображения в формате Markdown.",+ "Latest is recommended. Version 2505 never changes.": "Рекомендуется последняя. Версия 2505 не меняется.",+ "Latest": "Последняя",+ "Version 2505": "Версия 2505",+ "Where the PDF or image to read comes from.": "Откуда берётся PDF или изображение для чтения.",+ "Public URL": "Публичный URL",+ "Mistral File ID": "ID файла Mistral",+ "Page numbers to read, starting at 0. Empty: every page.": "Номера страниц для чтения, начиная с 0. Пусто: все страницы.",+ "Include Images": "Включить изображения",+ "Also return the images found in the document, as base64.": "Также возвращает найденные в документе изображения в base64.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Сколько миллисекунд ждать ответа. Пусто: 2 минуты.",+ "Request": "Запрос",+ "Data to send": "Отправляемые данные",+ "Document": "Документ"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/translation.json b/packages/pieces/community/mistral-ai/src/i18n/translation.jsonindex 36eb911425b..0601fbad7e4 100644--- a/packages/pieces/community/mistral-ai/src/i18n/translation.json+++ b/packages/pieces/community/mistral-ai/src/i18n/translation.json@@ -48,10 +48,10 @@"Get Batch Job": "Get Batch Job","Cancel Batch Job": "Cancel Batch Job","Custom API Call": "Custom API Call",- "Ask Mistral anything you want!": "Ask Mistral anything you want!",- "Creates new embedding in Mistral AI.": "Creates new embedding in Mistral AI.",- "Upload a file to Mistral AI (e.g., for fine-tuning or context storage).": "Upload a file to Mistral AI (e.g., for fine-tuning or context storage).",- "Extract text from PDFs and images using mistral-ocr-latest. To OCR a file from a previous step, run Upload File first (with purpose=ocr) and pass the returned id here.": "Extract text from PDFs and images using mistral-ocr-latest. To OCR a file from a previous step, run Upload File first (with purpose=ocr) and pass the returned id here.",+ "Ask a Mistral model a question and get its answer.": "Ask a Mistral model a question and get its answer.",+ "Turn a list of texts into vectors with the mistral-embed model.": "Turn a list of texts into vectors with the mistral-embed model.",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "Upload a file to Mistral for OCR, batch jobs or fine-tuning.",+ "Extract the text of a PDF or image as Markdown.": "Extract the text of a PDF or image as Markdown.","Retrieves a list of available Mistral AI models.": "Retrieves a list of available Mistral AI models.","Generate a reply from a Mistral chat model given a system prompt and a list of messages.": "Generate a reply from a Mistral chat model given a system prompt and a list of messages.","Generate the code that belongs between a prefix and an optional suffix with a Codestral model.": "Generate the code that belongs between a prefix and an optional suffix with a Codestral model.",@@ -102,14 +102,14 @@"Top P": "Top P","Max Tokens": "Max Tokens","Random Seed": "Random Seed",- "Timeout (ms)": "Timeout (ms)",- "Input": "Input",+ "Timeout": "Timeout",+ "Texts": "Texts","File": "File","Purpose": "Purpose","Document Source": "Document Source","Document": "Document","Pages": "Pages",- "Include Image Base64": "Include Image Base64",+ "Include Images": "Include Images","System Prompt": "System Prompt","Messages": "Messages","Response Format": "Response Format",@@ -126,7 +126,6 @@"Voice": "Voice","Audio Format": "Audio Format","File Name": "File Name",- "Texts": "Texts","Model ID": "Model ID","Search": "Search","Page": "Page",@@ -168,24 +167,28 @@"Body": "Body","Response is Binary": "Response is Binary","Return Error as Output": "Return Error as Output",- "Timeout": "Timeout","Follow redirects": "Follow redirects",- "Select a Mistral model. List is fetched live from your account.": "Select a Mistral model. List is fetched live from your account.",- "Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.": "Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.",- "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.",- "The input text for which to create an embedding.": "The input text for which to create an embedding.",- "The file to upload (max 512MB).For fine tuning purspose provide .jsonl file.": "The file to upload (max 512MB).For fine tuning purspose provide .jsonl file.",- "Purpose of the file.": "Purpose of the file.",- "Where the document or image to OCR comes from.": "Where the document or image to OCR comes from.",- "Optional zero-based page indices to process. Leave empty for all pages.": "Optional zero-based page indices to process. Leave empty for all pages.",- "Return embedded images encoded as base64 alongside the Markdown.": "Return embedded images encoded as base64 alongside the Markdown.",+ "The Mistral model that writes the reply.": "The Mistral model that writes the reply.",+ "What you want the model to answer or do.": "What you want the model to answer or do.",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "From 0 to 1.5. Lower is more focused, higher is more varied.",+ "From 0 to 1. Adjust this or Temperature, not both.": "From 0 to 1. Adjust this or Temperature, not both.",+ "Longest reply in tokens, about 4 characters each.": "Longest reply in tokens, about 4 characters each.",+ "Set a seed to make repeated calls return the same output.": "Set a seed to make repeated calls return the same output.",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "Milliseconds to wait for a response. Empty: 30 seconds.",+ "Each text gets its own vector from the mistral-embed model.": "Each text gets its own vector from the mistral-embed model.",+ "The file to send to Mistral, up to 512 MB.": "The file to send to Mistral, up to 512 MB.",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "What Mistral may use the file for. Fine-tuning needs a .jsonl file.",+ "Latest is recommended. Version 2505 never changes.": "Latest is recommended. Version 2505 never changes.",+ "Where the PDF or image to read comes from.": "Where the PDF or image to read comes from.",+ "Page numbers to read, starting at 0. Empty: every page.": "Page numbers to read, starting at 0. Empty: every page.",+ "Also return the images found in the document, as base64.": "Also return the images found in the document, as base64.",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "Milliseconds to wait for a response. Empty: 2 minutes.","Chat model id, e.g. mistral-large-latest or mistral-small-latest. Use List Models to see what your key can access.": "Chat model id, e.g. mistral-large-latest or mistral-small-latest. Use List Models to see what your key can access.","Optional instructions that set the model behaviour for the whole reply.": "Optional instructions that set the model behaviour for the whole reply.","The conversation so far, oldest first. The last message is usually from the user.": "The conversation so far, oldest first. The last message is usually from the user.","Choose JSON to force the model to return a valid JSON object. Also ask for JSON in the prompt.": "Choose JSON to force the model to return a valid JSON object. Also ask for JSON in the prompt.","Sampling temperature between 0 and 1.5. Mistral recommends 0 to 0.7.": "Sampling temperature between 0 and 1.5. Mistral recommends 0 to 0.7.","Maximum number of tokens to generate.": "Maximum number of tokens to generate.",- "Set a seed to make repeated calls return the same output.": "Set a seed to make repeated calls return the same output.","A Codestral model id. Fill-in-the-middle only works with Codestral models.": "A Codestral model id. Fill-in-the-middle only works with Codestral models.","The code that comes before the part to generate.": "The code that comes before the part to generate.","Optional code that comes after the part to generate.": "Optional code that comes after the part to generate.",@@ -247,13 +250,13 @@"On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.","Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).","Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.",- "fine-tune": "fine-tune",- "batch": "batch",- "ocr": "ocr",- "mistral-ocr-latest (Recommended)": "mistral-ocr-latest (Recommended)",- "mistral-ocr-2505": "mistral-ocr-2505",- "URL": "URL",- "Mistral file ID (uploaded earlier with purpose=ocr)": "Mistral file ID (uploaded earlier with purpose=ocr)",+ "OCR": "OCR",+ "Batch": "Batch",+ "Fine-Tuning": "Fine-Tuning",+ "Latest": "Latest",+ "Version 2505": "Version 2505",+ "Public URL": "Public URL",+ "Mistral File ID": "Mistral File ID","JSON object": "JSON object","voxtral-mini-latest": "voxtral-mini-latest","voxtral-mini-2507": "voxtral-mini-2507",@@ -264,8 +267,6 @@"FLAC": "FLAC","Opus": "Opus","PCM": "PCM",- "OCR": "OCR",- "Batch": "Batch","Fine-tune": "Fine-tune","Web Search": "Web Search","Web Search (Premium)": "Web Search (Premium)",@@ -295,6 +296,10 @@"PUT": "PUT","DELETE": "DELETE","HEAD": "HEAD",+ "Settings": "Settings",+ "Content": "Content",+ "Upload": "Upload",+ "Use for": "Use for","Request": "Request","Data to send": "Data to send"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/i18n/zh.json b/packages/pieces/community/mistral-ai/src/i18n/zh.jsonindex 68af984e3dd..97d043a39fb 100644--- a/packages/pieces/community/mistral-ai/src/i18n/zh.json+++ b/packages/pieces/community/mistral-ai/src/i18n/zh.json@@ -23,7 +23,7 @@"File": "文件","Purpose": "Purpose","Document Source": "Document Source",- "Document": "Document",+ "Document": "文档","Pages": "Pages","Include Image Base64": "Include Image Base64","Method": "方法",@@ -62,5 +62,41 @@"None": "无","JSON": "JSON","Form Data": "表单数据",- "Raw": "原始文件"+ "Raw": "原始文件",+ "Ask a Mistral model a question and get its answer.": "向 Mistral 模型提问并获取回答。",+ "Settings": "设置",+ "Message": "消息",+ "The Mistral model that writes the reply.": "撰写回复的 Mistral 模型。",+ "What you want the model to answer or do.": "希望模型回答或完成的内容。",+ "From 0 to 1.5. Lower is more focused, higher is more varied.": "范围 0 到 1.5。越低越集中,越高越多样。",+ "From 0 to 1. Adjust this or Temperature, not both.": "范围 0 到 1。请调整此项或 Temperature,不要同时调整。",+ "Longest reply in tokens, about 4 characters each.": "回复的最大长度(以 token 计),每个约 4 个字符。",+ "Set a seed to make repeated calls return the same output.": "设置种子后,重复调用会返回相同的输出。",+ "Timeout": "超时",+ "Milliseconds to wait for a response. Empty: 30 seconds.": "等待响应的毫秒数。留空:30 秒。",+ "Turn a list of texts into vectors with the mistral-embed model.": "使用 mistral-embed 模型将文本列表转换为向量。",+ "Content": "内容",+ "Texts": "文本",+ "Each text gets its own vector from the mistral-embed model.": "每段文本都会从 mistral-embed 模型获得自己的向量。",+ "Upload a file to Mistral for OCR, batch jobs or fine-tuning.": "将文件上传到 Mistral,用于 OCR、批处理任务或微调。",+ "Upload": "上传",+ "Use for": "用途",+ "The file to send to Mistral, up to 512 MB.": "要发送到 Mistral 的文件,最大 512 MB。",+ "What Mistral may use the file for. Fine-tuning needs a .jsonl file.": "Mistral 可将该文件用于何种用途。微调需要 .jsonl 文件。",+ "OCR": "OCR",+ "Batch": "批处理",+ "Fine-Tuning": "微调",+ "Extract the text of a PDF or image as Markdown.": "以 Markdown 格式提取 PDF 或图片中的文本。",+ "Latest is recommended. Version 2505 never changes.": "推荐使用最新版。版本 2505 不会变化。",+ "Latest": "最新版",+ "Version 2505": "版本 2505",+ "Where the PDF or image to read comes from.": "要读取的 PDF 或图片的来源。",+ "Public URL": "公开 URL",+ "Mistral File ID": "Mistral 文件 ID",+ "Page numbers to read, starting at 0. Empty: every page.": "要读取的页码,从 0 开始。留空:所有页面。",+ "Include Images": "包含图片",+ "Also return the images found in the document, as base64.": "同时以 base64 返回文档中找到的图片。",+ "Milliseconds to wait for a response. Empty: 2 minutes.": "等待响应的毫秒数。留空:2 分钟。",+ "Request": "请求",+ "Data to send": "要发送的数据"}\ No newline at end of filediff --git a/packages/pieces/community/mistral-ai/src/index.ts b/packages/pieces/community/mistral-ai/src/index.tsindex 0f62d924531..00f43e516bd 100644--- a/packages/pieces/community/mistral-ai/src/index.ts+++ b/packages/pieces/community/mistral-ai/src/index.ts@@ -48,14 +48,14 @@ import { createBatchJob } from "./lib/actions/create-batch-job";import { getBatchJob } from "./lib/actions/get-batch-job";import { cancelBatchJob } from "./lib/actions/cancel-batch-job";import { mistralAuth } from "./lib/common/auth";-import { mistralRequest } from "./lib/common/request";+import { mistralRequest, MISTRAL_API_BASE_URL } from "./lib/common/request";import { createCustomApiCallAction } from "@activepieces/pieces-common";export const mistralAi = createPiece({displayName: "Mistral AI",description: "Mistral AI provides state-of-the-art open-weight and hosted language models for text generation, embeddings, and reasoning tasks.",auth: mistralAuth,- minimumSupportedRelease: "0.87.0",+ minimumSupportedRelease: "0.88.2",logoUrl: "https://cdn.activepieces.com/pieces/mistral-ai.png",authors: ["sparkybug"],categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],@@ -109,8 +109,14 @@ export const mistralAi = createPiece({cancelBatchJob,createCustomApiCallAction({auth: mistralAuth,- baseUrl: (auth) => (auth ? mistralRequest.getConfig(auth).baseUrl : 'https://api.mistral.ai/v1'),+ baseUrl: (auth) => (auth ? mistralRequest.getConfig(auth).baseUrl : MISTRAL_API_BASE_URL),authMapping: async (auth) => mistralRequest.getConfig(auth).headers,+ props: {+ url: {+ description: `Full URL, or a path relative to ${MISTRAL_API_BASE_URL} or your Cloudflare gateway.`,+ placeholder: '/models',+ },+ },}),],triggers: [],diff --git a/packages/pieces/community/mistral-ai/src/lib/actions/create-chat-completion.ts b/packages/pieces/community/mistral-ai/src/lib/actions/create-chat-completion.tsindex 2d55d57dd40..92be6856833 100644--- a/packages/pieces/community/mistral-ai/src/lib/actions/create-chat-completion.ts+++ b/packages/pieces/community/mistral-ai/src/lib/actions/create-chat-completion.ts@@ -3,6 +3,7 @@ import { HttpMethod, httpClient } from '@activepieces/pieces-common';import { mistralAuth } from '../common/auth';import { modelDropdown, parseMistralError } from '../common/props';import { mistralRequest } from '../common/request';+import { mistralApi } from '../common/client';export const createChatCompletion = createAction({audience: 'human',@@ -10,37 +11,58 @@ export const createChatCompletion = createAction({name: 'create_chat_completion',classification: 'READ',displayName: 'Ask Mistral',- description: 'Ask Mistral anything you want!',+ description: 'Ask a Mistral model a question and get its answer.',aiMetadata: { description: 'Sends one user prompt to a Mistral chat model through the chat-completions endpoint and returns only the assistant text of the first choice, with optional temperature, top-p, max-token and random-seed controls; it is stateless, with no conversation memory or system message. This is the piece\'s only text-generation action - prefer Create Embeddings when you need vectors rather than prose, and Run OCR when the text must be pulled out of a PDF or image instead of generated. Requires a model id from the account\'s live model list and a question; not idempotent: each call bills a fresh completion and the wording varies unless a random seed is pinned.', idempotent: false },+ propertyGroups: [+ { key: 'settings', display: 'section', label: 'Settings', icon: 'sliders', props: ['model', 'max_tokens'] },+ { key: 'message', display: 'section', label: 'Message', icon: 'text', props: ['prompt'] },+ ],props: {model: modelDropdown,prompt: Property.LongText({displayName: 'Question',+ description: 'What you want the model to answer or do.',+ placeholder: 'e.g. Summarize this email in three bullet points',required: true,}),temperature: Property.Number({displayName: 'Temperature',required: false,defaultValue: 1,- description:- 'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',+ description: 'From 0 to 1.5. Lower is more focused, higher is more varied.',+ advanced: true,}),top_p: Property.Number({displayName: 'Top P',required: false,defaultValue: 1,- description:- 'An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.',+ description: 'From 0 to 1. Adjust this or Temperature, not both.',+ advanced: true,+ }),+ max_tokens: Property.Number({+ displayName: 'Max Tokens',+ description: 'Longest reply in tokens, about 4 characters each.',+ required: false,+ }),+ random_seed: Property.Number({+ displayName: 'Random Seed',+ description: 'Set a seed to make repeated calls return the same output.',+ required: false,+ advanced: true,+ }),+ timeout: Property.Number({+ displayName: 'Timeout',+ description: 'Milliseconds to wait for a response. Empty: 30 seconds.',+ required: false,+ defaultValue: 30000,+ advanced: true,}),- max_tokens: Property.Number({ displayName: 'Max Tokens', required: false }),- random_seed: Property.Number({ displayName: 'Random Seed', required: false }),- timeout: Property.Number({ displayName: 'Timeout (ms)', required: false, defaultValue: 30000 }),},async run(context) {const { model, temperature, top_p, max_tokens, random_seed, timeout, prompt } = context.propsValue;const { baseUrl, headers } = mistralRequest.getConfig(context.auth);- const body: Record<string, any> = {+ const body: Record<string, unknown> = {model,messages: [{@@ -56,7 +78,7 @@ export const createChatCompletion = createAction({let lastErr;for (let attempt = 0; attempt <= 3; ++attempt) {try {- const response = await httpClient.sendRequest<{ choices: { message: { content: string } }[] }>({+ const response = await httpClient.sendRequest<ChatCompletionResponse>({method: HttpMethod.POST,url: `${baseUrl}/chat/completions`,headers,@@ -64,9 +86,11 @@ export const createChatCompletion = createAction({timeout: timeout ?? 30000,});- const answer = response.body.choices[0].message.content;-- return answer;+ const choices = response.body.choices ?? [];+ if (choices.length === 0) {+ throw new Error('Mistral returned no answer.');+ }+ return mistralApi.contentToText(choices[0].message?.content) ?? '';} catch (e: any) {lastErr = e;const status = e.response?.status;@@ -76,9 +100,13 @@ export const createChatCompletion = createAction({continue;}}- throw new Error(parseMistralError(e));+ throw new Error(parseMistralError({ error: e, baseUrl }));}}- throw new Error(parseMistralError(lastErr));+ throw new Error(parseMistralError({ error: lastErr, baseUrl }));},});++type ChatCompletionResponse = {+ choices?: { message?: { content?: unknown } }[];+};diff --git a/packages/pieces/community/mistral-ai/src/lib/actions/create-embeddings.ts b/packages/pieces/community/mistral-ai/src/lib/actions/create-embeddings.tsindex 68327ba622e..6a11af4ae90 100644--- a/packages/pieces/community/mistral-ai/src/lib/actions/create-embeddings.ts+++ b/packages/pieces/community/mistral-ai/src/lib/actions/create-embeddings.ts@@ -1,4 +1,4 @@-import { createAction, Property } from '@activepieces/pieces-framework';+import { createAction, isNil, Property } from '@activepieces/pieces-framework';import { HttpMethod, httpClient } from '@activepieces/pieces-common';import { mistralAuth } from '../common/auth';import { parseMistralError } from '../common/props';@@ -11,32 +11,36 @@ export const createEmbeddings = createAction({name: 'create_embeddings',classification: 'READ',displayName: 'Create Embeddings',- description: 'Creates new embedding in Mistral AI.',+ description: 'Turn a list of texts into vectors with the mistral-embed model.',+ propertyGroups: [+ { key: 'content', display: 'section', label: 'Content', icon: 'text', props: ['input'] },+ ],aiMetadata: { description: 'Converts an array of text strings into numeric embedding vectors using Mistral\'s fixed mistral-embed model; the model is not selectable here, unlike the sibling Ask Mistral action, and a whole batch of strings is embedded in one call. Use it for semantic search, similarity, or clustering pipelines, and pick Ask Mistral when you need generated prose rather than numbers. Requires a non-empty array of input strings; idempotent: nothing is created server-side and the same input yields the same vectors.', idempotent: true },outputSchema: createEmbeddingsOutputSchema,props: {input: Property.Array({- displayName: 'Input',- description: 'The input text for which to create an embedding.',+ displayName: 'Texts',+ description: 'Each text gets its own vector from the mistral-embed model.',required: true,}),- timeout: Property.Number({ displayName: 'Timeout (ms)', required: false, defaultValue: 30000 }),+ timeout: Property.Number({+ displayName: 'Timeout',+ description: 'Milliseconds to wait for a response. Empty: 30 seconds.',+ required: false,+ defaultValue: 30000,+ advanced: true,+ }),},async run(context) {const { input, timeout } = context.propsValue;const { baseUrl, headers } = mistralRequest.getConfig(context.auth);- let inputArr: string[] = [];- try {- if (typeof input === 'string') {- try {- inputArr = JSON.parse(input);- } catch {- inputArr = input;- }- }- inputArr = input as string[];- } catch {- throw new Error('Input must be a non-empty string or a JSON array of non-empty strings');+ const inputArr = toTexts(input);+ if (inputArr.length === 0) {+ throw new Error('Add at least one text to embed.');+ }+ const blankIndex = inputArr.findIndex((text) => text.trim() === '');+ if (blankIndex !== -1) {+ throw new Error(`Text ${blankIndex + 1} is empty. Fill it in or remove it so each vector matches its text.`);}const body = {model: 'mistral-embed',@@ -63,9 +67,29 @@ export const createEmbeddings = createAction({continue;}}- throw new Error(parseMistralError(e));+ throw new Error(parseMistralError({ error: e, baseUrl }));}}- throw new Error(parseMistralError(lastErr));+ throw new Error(parseMistralError({ error: lastErr, baseUrl }));},});++function toTexts(value: unknown): string[] {+ const list = toInputList(value);+ if (!Array.isArray(list)) {+ return [];+ }+ return list.map((item) => (isNil(item) ? '' : String(item)));+}++function toInputList(value: unknown): unknown {+ if (typeof value !== 'string') {+ return value;+ }+ try {+ const parsed: unknown = JSON.parse(value);+ return Array.isArray(parsed) ? parsed : [value];+ } catch {+ return [value];+ }+}diff --git a/packages/pieces/community/mistral-ai/src/lib/actions/list-models.ts b/packages/pieces/community/mistral-ai/src/lib/actions/list-models.tsindex dc6f245c6f9..cf08fc9f827 100644--- a/packages/pieces/community/mistral-ai/src/lib/actions/list-models.ts+++ b/packages/pieces/community/mistral-ai/src/lib/actions/list-models.ts@@ -16,8 +16,8 @@ export const listModels = createAction({outputSchema: listModelsOutputSchema,props: {},async run({ auth }) {+ const { baseUrl, headers } = mistralRequest.getConfig(auth);try {- const { baseUrl, headers } = mistralRequest.getConfig(auth);const response = await httpClient.sendRequest({method: HttpMethod.GET,url: `${baseUrl}/models`,@@ -26,7 +26,7 @@ export const listModels = createAction({return response.body;} catch (e: any) {- throw new Error(parseMistralError(e));+ throw new Error(parseMistralError({ error: e, baseUrl }));}},});diff --git a/packages/pieces/community/mistral-ai/src/lib/actions/run-ocr.ts b/packages/pieces/community/mistral-ai/src/lib/actions/run-ocr.tsindex e0bb48bd1f0..c21f63e91ff 100644--- a/packages/pieces/community/mistral-ai/src/lib/actions/run-ocr.ts+++ b/packages/pieces/community/mistral-ai/src/lib/actions/run-ocr.ts@@ -5,8 +5,8 @@ import { parseMistralError } from '../common/props';import { mistralRequest, MistralRequestConfig } from '../common/request';const OCR_MODEL_OPTIONS = [- { label: 'mistral-ocr-latest (Recommended)', value: 'mistral-ocr-latest' },- { label: 'mistral-ocr-2505', value: 'mistral-ocr-2505' },+ { label: 'Latest', value: 'mistral-ocr-latest', icon: 'sliders' },+ { label: 'Version 2505', value: 'mistral-ocr-2505', icon: 'sliders' },];export const runOcr = createAction({@@ -15,24 +15,31 @@ export const runOcr = createAction({name: 'run_ocr',classification: 'READ',displayName: 'Run OCR',- description: 'Extract text from PDFs and images using mistral-ocr-latest. To OCR a file from a previous step, run Upload File first (with purpose=ocr) and pass the returned id here.',+ description: 'Extract the text of a PDF or image as Markdown.',+ propertyGroups: [+ { key: 'settings', display: 'section', label: 'Settings', icon: 'sliders', props: ['model'] },+ { key: 'document', display: 'section', label: 'Document', icon: 'file', props: ['documentSource', 'sourceFields', 'pages'] },+ ],aiMetadata: { description: 'Extracts the text of a PDF or image as Markdown with a Mistral OCR model, taking the document either from a public URL or from a Mistral file id (that mode first resolves a short-lived signed URL); optional zero-based page indices narrow the run and embedded images can come back as base64. Pick this to read text out of a document that already exists, and Ask Mistral when the answer has to be generated or reasoned about rather than transcribed. The file-id mode only works for a file that Upload File stored with purpose=ocr, and the document type must be set to PDF or image to match the source. Read-only extraction that stores nothing, so repeat calls are idempotent.', idempotent: true },props: {model: Property.StaticDropdown({displayName: 'Model',+ description: 'Latest is recommended. Version 2505 never changes.',required: true,defaultValue: 'mistral-ocr-latest',+ display: 'cards',options: { options: OCR_MODEL_OPTIONS },}),documentSource: Property.StaticDropdown<DocumentSource>({displayName: 'Document Source',- description: 'Where the document or image to OCR comes from.',+ description: 'Where the PDF or image to read comes from.',required: true,defaultValue: 'url',+ display: 'cards',options: {options: [- { label: 'URL', value: 'url' },- { label: 'Mistral file ID (uploaded earlier with purpose=ocr)', value: 'fileId' },+ { label: 'Public URL', value: 'url', icon: 'file' },+ { label: 'Mistral File ID', value: 'fileId', icon: 'paperclip' },],},}),@@ -47,7 +54,8 @@ export const runOcr = createAction({const fields: InputPropertyMap = {fileId: Property.ShortText({displayName: 'File ID',- description: 'A Mistral file ID returned from a prior Upload File step (purpose=ocr).',+ description: 'The ID from an Upload File step with purpose OCR.',+ placeholder: 'e.g. 00edaf84-95b0-45db-8f83-f71138491f23',required: true,}),documentType: documentTypeDropdown(),@@ -57,7 +65,8 @@ export const runOcr = createAction({const fields: InputPropertyMap = {documentUrl: Property.ShortText({displayName: 'URL',- description: 'Public URL of the PDF or image to OCR.',+ description: 'A public link to the PDF or image.',+ placeholder: 'https://example.com/invoice.pdf',required: true,}),documentType: documentTypeDropdown(),@@ -67,19 +76,22 @@ export const runOcr = createAction({}),pages: Property.Array({displayName: 'Pages',- description: 'Optional zero-based page indices to process. Leave empty for all pages.',+ description: 'Page numbers to read, starting at 0. Empty: every page.',required: false,}),includeImageBase64: Property.Checkbox({- displayName: 'Include Image Base64',- description: 'Return embedded images encoded as base64 alongside the Markdown.',+ displayName: 'Include Images',+ description: 'Also return the images found in the document, as base64.',required: false,defaultValue: false,+ advanced: true,}),timeout: Property.Number({- displayName: 'Timeout (ms)',+ displayName: 'Timeout',+ description: 'Milliseconds to wait for a response. Empty: 2 minutes.',required: false,defaultValue: 120000,+ advanced: true,}),},async run(context) {@@ -132,23 +144,24 @@ export const runOcr = createAction({continue;}}- throw new Error(parseMistralError(e));+ throw new Error(parseMistralError({ error: e, baseUrl: config.baseUrl }));}}- throw new Error(parseMistralError(lastErr));+ throw new Error(parseMistralError({ error: lastErr, baseUrl: config.baseUrl }));},});function documentTypeDropdown() {return Property.StaticDropdown<DocumentType>({displayName: 'Document Type',- description: 'Pick "Image" for PNG/JPG/WEBP, "Document" for PDFs.',+ description: 'Pick Image for PNG, JPG or WEBP, Document for PDFs.',required: true,defaultValue: 'document_url',+ display: 'cards',options: {options: [- { label: 'Document (PDF)', value: 'document_url' },- { label: 'Image', value: 'image_url' },+ { label: 'Document', value: 'document_url', icon: 'file' },+ { label: 'Image', value: 'image_url', icon: 'file' },],},});diff --git a/packages/pieces/community/mistral-ai/src/lib/actions/upload-file.ts b/packages/pieces/community/mistral-ai/src/lib/actions/upload-file.tsindex 6fe6824bde0..8e7df319069 100644--- a/packages/pieces/community/mistral-ai/src/lib/actions/upload-file.ts+++ b/packages/pieces/community/mistral-ai/src/lib/actions/upload-file.ts@@ -32,21 +32,30 @@ export const uploadFile = createAction({name: 'upload_file',classification: 'WRITE',displayName: 'Upload File',- description: 'Upload a file to Mistral AI (e.g., for fine-tuning or context storage).',+ description: 'Upload a file to Mistral for OCR, batch jobs or fine-tuning.',+ propertyGroups: [+ { key: 'upload', display: 'section', label: 'Upload', icon: 'paperclip', props: ['file'] },+ { key: 'use', display: 'section', label: 'Use for', icon: 'tag', props: ['purpose'] },+ ],aiMetadata: { description: 'Stores a file in the connected Mistral account and returns its file id, tagged with a purpose of fine-tune, batch, or ocr that decides what the id may later be used for. Run it before Run OCR whenever the document is a step attachment rather than a public URL: upload with purpose=ocr and feed the returned id into that action. Rejects files above 512MB or with an extension outside jsonl, txt, csv, pdf, docx, png, jpg, jpeg, mp3, mp4; not idempotent: each call stores another copy and returns a new id.', idempotent: false },outputSchema: uploadFileOutputSchema,props: {file: Property.File({displayName: 'File',- description: 'The file to upload (max 512MB).For fine tuning purspose provide .jsonl file.',+ description: 'The file to send to Mistral, up to 512 MB.',required: true,}),purpose: Property.StaticDropdown({displayName: 'Purpose',- description: 'Purpose of the file.',+ description: 'What Mistral may use the file for. Fine-tuning needs a .jsonl file.',required: true,+ display: 'cards',options: {- options: SUPPORTED_PURPOSES.map((p) => ({ label: p, value: p })),+ options: [+ { label: 'OCR', value: 'ocr', icon: 'file' },+ { label: 'Batch', value: 'batch', icon: 'file' },+ { label: 'Fine-Tuning', value: 'fine-tune', icon: 'file' },+ ],},}),},@@ -80,7 +89,7 @@ export const uploadFile = createAction({});return response.body;} catch (e: any) {- throw new Error(parseMistralError(e));+ throw new Error(parseMistralError({ error: e, baseUrl }));}},});diff --git a/packages/pieces/community/mistral-ai/src/lib/common/client.ts b/packages/pieces/community/mistral-ai/src/lib/common/client.tsindex 9f70586375e..b181f2bda70 100644--- a/packages/pieces/community/mistral-ai/src/lib/common/client.ts+++ b/packages/pieces/community/mistral-ai/src/lib/common/client.ts@@ -69,7 +69,11 @@ function isRecord(value: unknown): value is Record<string, unknown> {return typeof value === 'object' && value !== null && !Array.isArray(value);}-export const mistralApi = { call, parseJsonInput, toStringArray, contentToText, compact, isRecord };+function isGatewayBaseUrl(baseUrl: string): boolean {+ return baseUrl.includes(GATEWAY_HOST);+}++export const mistralApi = { call, parseJsonInput, toStringArray, contentToText, compact, isRecord, describeError, isGatewayBaseUrl };function toQueryParams(params: MistralCallParams['queryParams']): Record<string, string> | undefined {if (isNil(params)) {diff --git a/packages/pieces/community/mistral-ai/src/lib/common/props.ts b/packages/pieces/community/mistral-ai/src/lib/common/props.tsindex e49aa228a9d..6837a45169e 100644--- a/packages/pieces/community/mistral-ai/src/lib/common/props.ts+++ b/packages/pieces/community/mistral-ai/src/lib/common/props.ts@@ -2,10 +2,11 @@ import { Property, DropdownOption } from '@activepieces/pieces-framework';import { HttpMethod, httpClient } from '@activepieces/pieces-common';import { mistralAuth } from './auth';import { mistralRequest } from './request';+import { mistralApi } from './client';export const modelDropdown = Property.Dropdown({displayName: 'Model',- description: 'Select a Mistral model. List is fetched live from your account.',+ description: 'The Mistral model that writes the reply.',required: true,refreshers: [],auth: mistralAuth,@@ -50,9 +51,6 @@ export const modelDropdown = Property.Dropdown({},});-export function parseMistralError(e: any): string {- if (e.response?.data?.error) return e.response.data.error;- if (e.response?.data?.message) return e.response.data.message;- if (e.message) return e.message;- return 'Unknown error';+export function parseMistralError({ error, baseUrl }: { error: unknown; baseUrl: string }): string {+ return mistralApi.describeError({ error, isGateway: mistralApi.isGatewayBaseUrl(baseUrl) });}diff --git a/packages/pieces/community/mistral-ai/src/lib/common/request.ts b/packages/pieces/community/mistral-ai/src/lib/common/request.tsindex 43b4c4de389..955f077f2fc 100644--- a/packages/pieces/community/mistral-ai/src/lib/common/request.ts+++ b/packages/pieces/community/mistral-ai/src/lib/common/request.ts@@ -25,7 +25,7 @@ function getConfig(auth: MistralAuthValue): MistralRequestConfig {};}return {- baseUrl: 'https://api.mistral.ai/v1',+ baseUrl: MISTRAL_API_BASE_URL,headers: { Authorization: `Bearer ${a.secret_text}` },};}@@ -53,3 +53,5 @@ export type MistralRequestConfig = {baseUrl: string;headers: Record<string, string>;};++export const MISTRAL_API_BASE_URL = 'https://api.mistral.ai/v1';