<?xml version="1.0" encoding="UTF-8"?>
<definition:ConnectorDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:definition="http://www.bonitasoft.org/ns/connector/definition/6.1">
    <id>mistral-ask</id> <!-- Id of the definition -->
    <version>1.0.0</version> <!-- Version of the definition -->
    <icon>mistral.png</icon> <!-- The icon used in the Studio for this definition -->
    <category id="AI" icon="AI.png" /> <!-- Parent category -->
    <category id="MistralAI" icon="mistral.png" parentCategoryId="AI"/> <!-- The category of this definition, used in the Studio (e.g: http, script ...) -->

    <!-- Connector inputs -->
    <input name="url" type="java.lang.String"/>
    <input name="apiKey" type="java.lang.String"/>

    <input name="chatModelName" type="java.lang.String"/>
    <input name="userPrompt" type="java.lang.String" mandatory="true"/>
    <input name="systemPrompt" type="java.lang.String" defaultValue="You are a polite assistant."/>

    <input name="modelTemperature" type="java.lang.Double"/>
    <input name="requestTimeout" type="java.lang.Integer"/>

    <input name="sourceDocumentRef" type="java.lang.String"/>

    <input name="outputJsonSchema" type="java.lang.String"/>
    <input name="fieldsToExtract" type="java.lang.String"/>

    <!-- Connector outputs -->
    <output name="output" type="java.lang.String"/>

    <!--
       Pages and widgets to use the connector in the Bonita Studio.
       - Each widget must be bound to an input
       - Page titles must be defined in the properties files
       - Widget labels must be defined in the properties files
       - Page and widget descriptions can be defined in the properties files (optional)
    -->
    <page id="defaultPage">
        <widget xsi:type="definition:TextArea" id="systemPromptWidget" inputName="systemPrompt"/>
        <widget xsi:type="definition:TextArea" id="userPromptWidget" inputName="userPrompt"/>
        <widget xsi:type="definition:TextArea" id="outputJsonSchemaWidget" inputName="outputJsonSchema"/>
        <widget xsi:type="definition:Text" id="sourceDocumentRefWidget" inputName="sourceDocumentRef" showDocuments="true"/>
    </page>
    <page id="advancedPage">
        <widget xsi:type="definition:Text" id="apiKeyWidget" inputName="apiKey"/>
        <widget xsi:type="definition:Text" id="urlWidget" inputName="url"/>
        <widget xsi:type="definition:Text" id="requestTimeoutWidget" inputName="requestTimeout"/>
        <widget xsi:type="definition:Text" id="chatModelNameWidget" inputName="chatModelName"/>
        <widget xsi:type="definition:Text" id="modelTemperatureWidget" inputName="modelTemperature"/>
    </page>
</definition:ConnectorDefinition>