comparison chatgpt.xml @ 4:3803ed45745c draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/chatgpt commit 81bb45731241a082de7b44430afc97a8491a9e47
author bgruening
date Wed, 07 Jan 2026 13:00:53 +0000
parents 430ece17fc20
children
comparison
equal deleted inserted replaced
3:430ece17fc20 4:3803ed45745c
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="25.1">
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@">2025</token>
5 <token name="@VERSION_SUFFIX@">2</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.13">python</requirement>
9 <requirement type="package" version="1.35.13">openai</requirement> 9 <requirement type="package" version="2.7.1">openai</requirement>
10 <credentials name="openai_credentials" version="1.0" label="OpenAI Credentials" description="Credentials for accessing OpenAI's API.">
11 <secret name="openai_api_key" inject_as_env="OPENAI_API_KEY" optional="false" label="OpenAI API Key" description="Your OpenAI API key is required to use this tool. You can obtain it from your OpenAI account dashboard."/>
12 </credentials>
10 </requirements> 13 </requirements>
11 <command detect_errors="exit_code"><![CDATA[ 14 <command detect_errors="exit_code"><![CDATA[
12 #import json 15 #import json
13 #import os 16 #import os
14 #import re 17 #import re
15 #set LINK_LIST = [] 18 #set LINK_LIST = []
16 #for $input in $context 19 #if $context
17 #set file_name = os.path.splitext($input.element_identifier)[0] 20 #for $input in $context
18 ## list of supported filetypes in OpenAI. If Galaxy has a filetype that is not in this list, just use the generic `txt`. 21 #set file_name = os.path.splitext($input.element_identifier)[0]
19 #set ext = $input.ext if $input.ext in ['c', 'cpp', 'css', 'csv', 'docx', 'gif', 'html', 'java', 'jpeg', 'jpg', 'js', 'json', 'md', 'pdf', 'php', 'pkl', 'png', 'pptx', 'py', 'rb', 'tar', 'tex', 'ts', 'txt', 'webp', 'xlsx', 'xml', 'zip'] else 'txt' 22 ## list of supported filetypes in OpenAI. If Galaxy has a filetype that is not in this list, just use the generic `txt`.
20 #set LINK = re.sub('[^\w\-]', '_', $file_name)+'.'+$ext 23 #set ext = $input.ext if $input.ext in ['c', 'cpp', 'css', 'csv', 'docx', 'gif', 'html', 'java', 'jpeg', 'jpg', 'js', 'json', 'md', 'pdf', 'php', 'pkl', 'png', 'pptx', 'py', 'rb', 'tar', 'tex', 'ts', 'txt', 'webp', 'xlsx', 'xml', 'zip'] else 'txt'
21 ln -s '$input' '$LINK' && 24 #set LINK = re.sub('[^\w\-]', '_', $file_name)+'.'+$ext
22 ## OpenAI has some special handling of "images", so let's annotate this here and pass it to the script 25 ln -s '$input' '$LINK' &&
23 #set type = 'image' if $input.ext in ['jpg', 'jpeg', 'png', 'webp', 'gif'] else 'text' 26 ## OpenAI has some special handling of "images", so let's annotate this here and pass it to the script
24 $LINK_LIST.append([$LINK, $type]) 27 #set type = 'image' if $input.ext in ['jpg', 'jpeg', 'png', 'webp', 'gif'] else 'text'
25 #end for 28 $LINK_LIST.append([$LINK, $type])
29 #end for
30 #end if
26 #set context_files = json.dumps($LINK_LIST) 31 #set context_files = json.dumps($LINK_LIST)
27 32
28 python '$__tool_directory__/chatgpt.py' 33 python '$__tool_directory__/chatgpt.py'
29 '$context_files' 34 '$context_files'
30 '$prompt' 35 '$prompt'
31 '$model' 36 '$model'
32 '$openai_api_key_file'
33 ]]></command> 37 ]]></command>
34 <configfiles>
35 <configfile name="openai_api_key_file"><![CDATA[
36 $__user__.extra_preferences.get('chatgpt|api_key', "")
37 ]]></configfile>
38 </configfiles>
39 <inputs> 38 <inputs>
40 <conditional name="input_type"> 39 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use.">
41 <param name="input_type_selector" type="select" label="Choose the model" help="Vision models are capable to have image as input."> 40 <option value="gpt-5" selected="true">Flagship model for coding, reasoning, and agentic tasks across domains. (gpt-5)</option>
42 <option value="vision" selected="true">Vision models</option> 41 <option value="gpt-5-mini">Faster, more cost-efficient version of GPT-5. It's great for well-defined tasks and precise prompts. (gpt-5-mini)</option>
43 <option value="all">All models</option> 42 <option value="gpt-5-nano">Fastest, cheapest version of GPT-5. It's great for summarization and classification tasks. (gpt-5-nano)</option>
44 </param> 43 <option value="gpt-4.1">Excels at instruction following and tool calling, with broad knowledge across domains (gpt-4.1)</option>
45 <when value="vision"> 44 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option>
46 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use."> 45 </param>
47 <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option> 46 <param name="context" type="data" multiple="true" optional="true" format="docx,html,json,pdf,txt,jpg,png,gif" label="Context" max="500" help="Optional context data that will be uploaded to OpenAI's servers for processing."/>
48 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option>
49 <option value="gpt-4-turbo">The previous set of high-intelligence model with vision capabilities (gpt-4-turbo)</option>
50 </param>
51 <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."/>
52 </when>
53 <when value="all">
54 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use.">
55 <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option>
56 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option>
57 <option value="gpt-4-turbo">The previous set of high-intelligence model with vision capabilities (gpt-4-turbo)</option>
58 <option value="gpt-4" selected="true">The previous set of high-intelligence model (gpt-4)</option>
59 <option value="gpt-3.5-turbo">A fast, inexpensive model for simple tasks (GPT-3.5-turbo)</option>
60 </param>
61 <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."/>
62 </when>
63 </conditional>
64 <param name="prompt" type="text" optional="false" label="Prompt" help="Prompts or tasks you want ChatGPT to perform." area="true"> 47 <param name="prompt" type="text" optional="false" label="Prompt" help="Prompts or tasks you want ChatGPT to perform." area="true">
65 <validator type="empty_field"/> 48 <validator type="empty_field"/>
66 </param> 49 </param>
67 </inputs> 50 </inputs>
68 <outputs> 51 <outputs>
69 <data name="output" format="txt" label="${tool.name} on ${on_string}" from_work_dir="./output.txt"/> 52 <data name="output" format="markdown" label="${tool.name} (${model}) #if $on_string then ' on ' + $on_string else ''#" from_work_dir="./output.md"/>
70 </outputs> 53 </outputs>
71 <tests> 54 <tests>
72 <test expect_failure="true" expect_exit_code="1"> 55 <test expect_failure="true" expect_exit_code="1">
56 <param name="model" value="gpt-5"/>
73 <param name="context" value="chatgpt_test.txt" ftype="txt"/> 57 <param name="context" value="chatgpt_test.txt" ftype="txt"/>
74 <param name="prompt" value="What is this?"/> 58 <param name="prompt" value="What is this?"/>
75 <param name="model" value="gpt-4o-mini"/>
76 <assert_stdout> 59 <assert_stdout>
77 <has_text text="OpenAI API key is not provided in user preferences!"/> 60 <has_text text="OpenAI API key is not provided in credentials!"/>
78 </assert_stdout> 61 </assert_stdout>
79 </test> 62 </test>
80 </tests> 63 </tests>
81 <help><![CDATA[ 64 <help><![CDATA[
82 65
86 69
87 This tool leverages OpenAI's ChatGPT API to generate responses based on user-provided context and prompt. 70 This tool leverages OpenAI's ChatGPT API to generate responses based on user-provided context and prompt.
88 Users can upload context data in various formats and ask questions or execute prompts related to that data. 71 Users can upload context data in various formats and ask questions or execute prompts related to that data.
89 The tool then uploads the data to a OpenAI server and processes them using the selected ChatGPT model, returning an AI-generated response tailored to the context provided. 72 The tool then uploads the data to a OpenAI server and processes them using the selected ChatGPT model, returning an AI-generated response tailored to the context provided.
90 73
91 To utilize this tool, users need to input their OpenAI API key in the user preferences. To obtain an API key, visit API keys page in your OpenAI Dashboard. 74 To utilize this tool, users need to input their OpenAI API key in the credentials section. To obtain an API key, visit API keys page in your OpenAI Dashboard.
92 Make sure to setup the payment method in your OpenAI account to use the API key. 75 Make sure to setup the payment method in your OpenAI account to use the API key.
93 76
94 When you run this tool, your input data is sent to OpenAI's servers using your API-key. 77 When you run this tool, your input data is sent to OpenAI's servers using your API-key.
95 OpenAI's models process the data and generate a response based on the context and prompt provided. 78 OpenAI's models process the data and generate a response based on the context and prompt provided.
96 After receiving the response from the OpenAI server, the tool returns it to Galaxy and puts it in your history. 79 After receiving the response from the OpenAI server, the tool returns it to Galaxy and puts it in your history.
104 Usage 87 Usage
105 ..... 88 .....
106 89
107 **Input** 90 **Input**
108 91
109 1. **Upload Context Data**: Users can upload up to 500 files in formats such as DOC, DOCX, HTML, JSON, PDF, TXT, JPG, JPEG, PNG, WEBP, or GIF. 92 1. **Upload Context Data** (Optional): You can optionally upload up to 500 files in formats such as DOC, DOCX, HTML, JSON, PDF, TXT, JPG, JPEG, PNG, WEBP, or GIF.
110 This context data serves as the input for the prompt you wish to execute. 93 This context data serves as the input for the prompt you wish to execute. If no context is provided, ChatGPT will respond based solely on the prompt.
111 94
112 2. **Provide a Prompt**: Once the context data is added, users can provide a prompt for a task ChatGPT should execute. 95 2. **Provide a Prompt**: Provide a prompt or task for ChatGPT to execute.
113 The more specific the prompt, the more tailored the response will be. 96 The more specific the prompt, the more tailored the response will be.
114 97
115 3. **Select a Model**: Choose the ChatGPT model that best fits your needs. 98 3. **Select a Model**: Choose the ChatGPT model that best fits your needs.
116 Information about different models and their pricing can be found on the OpenAI website. 99 Information about different models and their pricing can be found on the OpenAI website.
117 100