comparison chatgpt.xml @ 0:f256dc85e1a0 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/chatgpt commit 840e66e7f23cf775ebd3083c6e07d1819b17f74c
author bgruening
date Tue, 13 Aug 2024 14:25:19 +0000
parents
children 08c658e9aa9e
comparison
equal deleted inserted replaced
-1:000000000000 0:f256dc85e1a0
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>
3 <macros>
4 <token name="@TOOL_VERSION@">2024</token>
5 <token name="@VERSION_SUFFIX@">0</token>
6 </macros>
7 <requirements>
8 <requirement type="package" version="3.12">python</requirement>
9 <requirement type="package" version="1.35.13">openai</requirement>
10 </requirements>
11 <command detect_errors="exit_code"><![CDATA[
12 #set LINK_LIST = ''
13 #for $count, $input in enumerate($context):
14 #set LINK = 'input' + str($count) + '.' + $input.ext
15 ln -s '$input' '$LINK' &&
16 #if count == 0
17 #set LINK_LIST = $LINK
18 #else
19 #set LINK_LIST = $LINK_LIST + ',' + $LINK
20 #end if
21 #end for
22
23 python '$__tool_directory__/chatgpt.py'
24 '$LINK_LIST'
25 '$question'
26 '$model'
27 '$openai_api_key_file'
28 ]]></command>
29 <configfiles>
30 <configfile name="openai_api_key_file"><![CDATA[
31 $__user__.extra_preferences.get('chatgpt|api_key', "")
32 ]]></configfile>
33 </configfiles>
34 <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"/>
36 <param name="question" type="text" optional="false" label="Question" help="Question about the text provided" area="true"/>
37 <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use">
38 <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option>
39 <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option>
40 <option value="gpt-4-turbo">The previous set of high-intelligence model with vision capabilities (gpt-4-turbo)</option>
41 <option value="gpt-4">The previous set of high-intelligence model (gpt-4) (not supporting images)</option>
42 <option value="gpt-3.5-turbo">A fast, inexpensive model for simple tasks (GPT-3.5-turbo) (not supporting images)</option>
43 </param>
44 </inputs>
45 <outputs>
46 <data name="output" format="txt" label="${tool.name} on ${on_string}" from_work_dir="./output.txt"/>
47 </outputs>
48 <tests>
49 <test expect_failure="true" expect_exit_code="1">
50 <param name="context" value="chatgpt_test.txt" ftype="txt"/>
51 <param name="question" value="What is this?"/>
52 <param name="model" value="gpt-4o-mini"/>
53 <assert_stderr>
54 <has_text text="Exception: OpenAI API key is not provided in user preferences!"/>
55 </assert_stderr>
56 </test>
57 </tests>
58 <help><![CDATA[
59
60 .. class:: infomark
61
62 **What it does**
63
64 This tool leverages OpenAI's ChatGPT API to generate responses based on user-provided context and questions.
65 Users can upload context data in various formats and ask questions related to that data.
66 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.
67
68 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.
69
70 When you run this tool, your input data is sent to OpenAI's servers using your API-key.
71 OpenAI's models process the data and generate a response based on the context and question provided.
72 After receiving the response from the OpenAI server, the tool returns it to Galaxy and puts it in your history.
73 The files that have been uploaded are then deleted from the OpenAI's server, so they are not stored beyond their necessary use.
74 If the tool fails to delete your uploaded files automatically, you can manually delete them in your openai account page. You might want to check your OpenAI storage from time to time as they also have a quota.
75
76 For more information on the tool refer to GitHub README_ file.
77
78 .. _README: https://github.com/bgruening/galaxytools/blob/master/tools/chatgpt/README.md
79
80 Usage
81 .....
82
83 **Input**
84
85 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.
86 This context data serves as the background information for the question you wish to ask.
87
88 2. **Ask a Question**: Once the context data is added, users can pose a question related to the content.
89 The more specific the question, the more tailored the response will be.
90
91 3. **Select a Model**: Choose the ChatGPT model that best fits your needs.
92 Information about different models and their pricing can be found on the OpenAI website.
93
94
95 **Output**
96
97 The output is a response generated by ChatGPT, crafted based on the provided context data and the question posed.
98 This response is saved in the `output.txt` file.
99
100
101 ]]></help>
102 <citations>
103 <citation type="bibtex">
104 @misc{openai,
105 author = {OpenAI},
106 title = {OpenAI's ChatGPT},
107 howpublished = {\url{https://openai.com/chatgpt}},
108 year = {2024},
109 note = {Accessed: 2024-07-26}
110 }
111 </citation>
112 </citations>
113 </tool>