Mercurial > repos > bgruening > chatgpt_openai_api
comparison chatgpt.xml @ 2:329bdb05dd90 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/chatgpt commit d2d08c3866c0f4a2f10372ae15c5dac5ea2d0bf0
| author | bgruening |
|---|---|
| date | Fri, 23 Aug 2024 10:21:12 +0000 |
| parents | db316ead4bda |
| children | 430ece17fc20 |
comparison
equal
deleted
inserted
replaced
| 1:db316ead4bda | 2:329bdb05dd90 |
|---|---|
| 1 <tool id="chatgpt_openai_api" name="chatGPT" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0"> | 1 <tool id="chatgpt_openai_api" name="chatGPT" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0"> |
| 2 <description>Integrating OpenAI's ChatGPT into Galaxy</description> | 2 <description>Integrating OpenAI's ChatGPT into Galaxy</description> |
| 3 <macros> | 3 <macros> |
| 4 <token name="@TOOL_VERSION@">2024</token> | 4 <token name="@TOOL_VERSION@">2024</token> |
| 5 <token name="@VERSION_SUFFIX@">0</token> | 5 <token name="@VERSION_SUFFIX@">1</token> |
| 6 </macros> | 6 </macros> |
| 7 <requirements> | 7 <requirements> |
| 8 <requirement type="package" version="3.12">python</requirement> | 8 <requirement type="package" version="3.12">python</requirement> |
| 9 <requirement type="package" version="1.35.13">openai</requirement> | 9 <requirement type="package" version="1.35.13">openai</requirement> |
| 10 </requirements> | 10 </requirements> |
| 11 <command detect_errors="exit_code"><![CDATA[ | 11 <command detect_errors="exit_code"><![CDATA[ |
| 12 #set LINK_LIST = '' | 12 #import os |
| 13 #for $count, $input in enumerate($context): | 13 #import re |
| 14 #set LINK = 'input' + str($count) + '.' + $input.ext | 14 #set $LINK_LIST = [] |
| 15 ln -s '$input' '$LINK' && | 15 #for $input in $context: |
| 16 #if count == 0 | 16 #set file_name, ext = os.path.splitext($input.element_identifier) |
| 17 #set LINK_LIST = $LINK | 17 #if ext == '' |
| 18 #else | 18 #set ext = '.'+$input.ext |
| 19 #set LINK_LIST = $LINK_LIST + ',' + $LINK | 19 #end if |
| 20 #end if | 20 #set LINK = re.sub('[^\w\-]', '_', str($file_name))+$ext |
| 21 #end for | 21 ln -s '$input' '$LINK' && |
| 22 $LINK_LIST.append($LINK) | |
| 23 #end for | |
| 22 | 24 |
| 23 python '$__tool_directory__/chatgpt.py' | 25 python '$__tool_directory__/chatgpt.py' |
| 24 '$LINK_LIST' | 26 '$str(",".join($LINK_LIST))' |
| 25 '$question' | 27 '$question' |
| 26 '$model' | 28 '$model' |
| 27 '$openai_api_key_file' | 29 '$openai_api_key_file' |
| 28 ]]></command> | 30 ]]></command> |
| 29 <configfiles> | 31 <configfiles> |
| 30 <configfile name="openai_api_key_file"><![CDATA[ | 32 <configfile name="openai_api_key_file"><![CDATA[ |
| 31 $__user__.extra_preferences.get('chatgpt|api_key', "") | 33 $__user__.extra_preferences.get('chatgpt|api_key', "") |
| 32 ]]></configfile> | 34 ]]></configfile> |
| 33 </configfiles> | 35 </configfiles> |
| 34 <inputs> | 36 <inputs> |
| 35 <param name="context" type="data" multiple="true" optional="false" format="doc,docx,html,json,pdf,txt,jpg,jpeg,png,webp,gif" label="Context" max="500" help="This data will be uploaded to OpenAI's servers for processing."/> | 37 <conditional name="input_type"> |
| 36 <param name="question" type="text" optional="false" label="Question" help="Question about the text provided" area="true"> | 38 <param name="input_type_selector" type="select" label="Choose the model" help="Vision models are capable to have image as input."> |
| 39 <option value="vision" selected="true">Vision models</option> | |
| 40 <option value="all">All models</option> | |
| 41 </param> | |
| 42 <when value="vision"> | |
| 43 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use"> | |
| 44 <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option> | |
| 45 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option> | |
| 46 <option value="gpt-4-turbo">The previous set of high-intelligence model with vision capabilities (gpt-4-turbo)</option> | |
| 47 </param> | |
| 48 <param name="context" type="data" multiple="true" optional="false" format="doc,docx,html,json,pdf,txt,jpg,jpeg,png,webp,gif" label="Context" max="500" help="This data will be uploaded to OpenAI's servers for processing."/> | |
| 49 </when> | |
| 50 <when value="all"> | |
| 51 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use"> | |
| 52 <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option> | |
| 53 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option> | |
| 54 <option value="gpt-4-turbo">The previous set of high-intelligence model with vision capabilities (gpt-4-turbo)</option> | |
| 55 <option value="gpt-4" selected="true">The previous set of high-intelligence model (gpt-4)</option> | |
| 56 <option value="gpt-3.5-turbo">A fast, inexpensive model for simple tasks (GPT-3.5-turbo)</option> | |
| 57 </param> | |
| 58 <param name="context" type="data" multiple="true" optional="false" format="doc,docx,html,json,pdf,txt" label="Context" max="500" help="This data will be uploaded to OpenAI's servers for processing."/> | |
| 59 </when> | |
| 60 </conditional> | |
| 61 <param name="question" type="text" optional="false" label="Question" help="Question about the text provided." area="true"> | |
| 37 <validator type="empty_field"/> | 62 <validator type="empty_field"/> |
| 38 </param> | |
| 39 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use"> | |
| 40 <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option> | |
| 41 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option> | |
| 42 <option value="gpt-4-turbo">The previous set of high-intelligence model with vision capabilities (gpt-4-turbo)</option> | |
| 43 <option value="gpt-4">The previous set of high-intelligence model (gpt-4) (not supporting images)</option> | |
| 44 <option value="gpt-3.5-turbo">A fast, inexpensive model for simple tasks (GPT-3.5-turbo) (not supporting images)</option> | |
| 45 </param> | 63 </param> |
| 46 </inputs> | 64 </inputs> |
| 47 <outputs> | 65 <outputs> |
| 48 <data name="output" format="txt" label="${tool.name} on ${on_string}" from_work_dir="./output.txt"/> | 66 <data name="output" format="txt" label="${tool.name} on ${on_string}" from_work_dir="./output.txt"/> |
| 49 </outputs> | 67 </outputs> |
