<?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>openai-classify</id> <!-- Id of the definition -->
    <version>1.0.0</version> <!-- Version of the definition -->
    <icon>openai.png</icon> <!-- The icon used in the Studio for this definition -->
    <category icon="openai.png" id="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="modelTemperature" type="java.lang.Double"/>
    <input name="requestTimeout" type="java.lang.Integer"/>

    <input name="sourceDocumentRef" type="java.lang.String" mandatory="true"/>
    <input name="categories" type="java.util.List" mandatory="true"/>

    <!-- 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:Text" id="sourceDocumentRefWidget" inputName="sourceDocumentRef" showDocuments="true"/>
        <widget xsi:type="definition:List" id="categoriesWidget" inputName="categories"/>
    </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>