Repository 'chatgpt_openai_api'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/chatgpt_openai_api

Changeset 1:08c658e9aa9e (2024-08-14)
Previous changeset 0:f256dc85e1a0 (2024-08-13) Next changeset 2:dab494dce303 (2024-08-23)
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/chatgpt commit 13c168a7d6a2d5050c04253754fb86321ad57d54
modified:
chatgpt.py
chatgpt.xml
b
diff -r f256dc85e1a0 -r 08c658e9aa9e chatgpt.py
--- a/chatgpt.py Tue Aug 13 14:25:19 2024 +0000
+++ b/chatgpt.py Wed Aug 14 11:33:44 2024 +0000
[
@@ -9,7 +9,8 @@
 with open(sys.argv[4], "r") as f:
     openai_api_key = f.read().strip()
 if not openai_api_key:
-    raise Exception("OpenAI API key is not provided in user preferences!")
+    print("OpenAI API key is not provided in user preferences!")
+    sys.exit(1)
 
 client = OpenAI(api_key=openai_api_key)
 
b
diff -r f256dc85e1a0 -r 08c658e9aa9e chatgpt.xml
--- a/chatgpt.xml Tue Aug 13 14:25:19 2024 +0000
+++ b/chatgpt.xml Wed Aug 14 11:33:44 2024 +0000
[
@@ -32,8 +32,10 @@
         ]]></configfile>
     </configfiles>
     <inputs>
-        <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"/>
-        <param name="question" type="text" optional="false" label="Question" help="Question about the text provided" area="true"/>
+        <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."/>
+        <param name="question" type="text" optional="false" label="Question" help="Question about the text provided" area="true">
+            <validator type="empty_field"/>
+        </param>
         <param name="model" type="select" optional="false" label="Model" help="Select the model you want to use">
             <option value="gpt-4o-mini" selected="true">Affordable and intelligent small model for fast, lightweight tasks (gpt-4o-mini)</option>
             <option value="gpt-4o">High-intelligence flagship model for complex, multi-step tasks (gpt-4o)</option>
@@ -50,9 +52,9 @@
             <param name="context" value="chatgpt_test.txt" ftype="txt"/>
             <param name="question" value="What is this?"/>
             <param name="model" value="gpt-4o-mini"/>
-            <assert_stderr>
-                <has_text text="Exception: OpenAI API key is not provided in user preferences!"/>
-            </assert_stderr>
+            <assert_stdout>
+                <has_text text="OpenAI API key is not provided in user preferences!"/>
+            </assert_stdout>
         </test>
     </tests>
     <help><![CDATA[