view chat_analysis.xml @ 9:ebff1089e004 draft

planemo upload for repository https://github.com/goeckslab/ChatAnalysis commit 296af594d47c6d4f35f356a7ef9e0f0699fa8328
author goeckslab
date Fri, 20 Jun 2025 18:46:25 +0000
parents 13cf52df8751
children e8cdf238cc02
line wrap: on
line source

<tool id="interactive_tool_chat_analysis" tool_type="interactive" name="Data Analysis Agent" version="0.3.0">
    <icon src="datachat.png" />
    <description>Interactively chats using natural language to explore, visualize, and analyze your data</description>
    <requirements>
        <container type="docker">
            quay.io/goeckslab/chatanalysis:0.3.0
        </container>
    </requirements>
    <entry_points>
        <entry_point name="Chat with $input_dataset.element_identifier" requires_domain="True">
            <port>
                9090
            </port>
            <url>
                /
            </url>
        </entry_point>
    </entry_points>
    <command>
        <![CDATA[
        #import re
        echo "Starting Streamlit" &&
        echo "working dir now: `pwd`" &&
        mkdir -p outputs_dir &&
        #set $sanitized_input_dataset = re.sub('[^\w\-_\.]', '_', $input_dataset.element_identifier.strip())
        ln -sf '$input_dataset' "./${sanitized_input_dataset}";
        echo "sanitized input dataset: $sanitized_input_dataset" &&
        echo "input dataset: $input_dataset" &&
        echo "$input_dataset.ext" &&
        ln -sf $__tool_directory__/.env /ChatAnalysis/.env &&
        python /ChatAnalysis/chat_dspy.py
            --user_id "$__user_email__"
            --openai_key_file "$openai_api_key_file"
            --groq_key_file "$groq_api_key_file"
            --chat_history "$chat_history"
            --outputs_dir "./outputs_dir"
            --input_file "$input_dataset"
            --input_type "$input_dataset.ext" &&
        echo "finished" &&
        echo "working dir now: '.' "

        ]]>
    </command>
    <configfiles>
        <configfile name="openai_api_key_file"><![CDATA[
            $__user__.extra_preferences.get('chatgpt|api_key')
        ]]></configfile>
        <configfile name="groq_api_key_file"><![CDATA[
            $__user__.extra_preferences.get('groq|api_key')
            ]]>
        </configfile>
    </configfiles>
    <stdio>
        <exit_code range="0:0" level="log"/>
    </stdio>
    <inputs>
        <param name="input_dataset"  type="data" format="csv,tsv,h5ad,xlsx,xls,json,parquet,h5,fa,fasta,vcf,gtf,gff,bed" label="Data you want to chat with" optional="false"/>
    </inputs>
    <outputs>
        <data name="chat_history" format="json" label="${tool.name} -- chat history json on ${on_string} -- use to restore chat history next time"/>
        <collection name="generated_files" type="list" label="${tool.name} -- generated files">
            <discover_datasets pattern="__name_and_ext__" directory="generated_files" />
        </collection>
    </outputs>
    <tests>
        <test>
        </test>
    </tests>
    <help>
        Analyze and visualize a dataset with a Data Analysis Agent.

        If you wish to set the OpenAI API key beforehand, go to **User → Preferences → Manage Information → ChatGPT → OpenAI API Key**. This way, you won’t need to set the OpenAI API key each time you use the app.

        Similarly, to set the Groq API key beforehand, navigate to **User → Preferences → Manage Information → Groq → API Key**.

        Alternatively, you can set the API key directly in the ChatAnalysis instance after it has started.
    </help>
</tool>