Skip to content

Commit

Permalink
Add disclaimer display, adjust prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Oct 23, 2024
1 parent e10db93 commit 764e420
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
25 changes: 16 additions & 9 deletions client/src/components/GalaxyWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,8 @@ function submitQuery() {
style="width: 100%"
placeholder="What's the difference in fasta and fastq files?"
@keyup.enter="submitQuery" />
<b-button
v-else-if="!queryResponse"
variant="info"
:disabled="busy"
@click="submitQuery">
<span v-if="!busy">
Let our Help Wizard Figure it out!
</span>
<b-button v-else-if="!queryResponse" variant="info" :disabled="busy" @click="submitQuery">
<span v-if="!busy"> Let our Help Wizard Figure it out! </span>
<LoadingSpan v-else message="Thinking..." />
</b-button>
</div>
Expand All @@ -76,12 +70,25 @@ function submitQuery() {
<b-skeleton animation="wave" width="55%"></b-skeleton>
<b-skeleton animation="wave" width="70%"></b-skeleton>
</div>
<div v-else class="chatResponse">{{ queryResponse }}</div>
<template v-else>
<div class="chatResponse">{{ queryResponse }}</div>
<template v-if="queryResponse != '' && !busy">
<hr />
<p class="disclaimer">
The text above is generated by an AI model. It's based on the input provided and may not always
be accurate. Please don't hesitate to ask on the usual channels if you need more help.
</p>
</template>
</template>
</div>
</div>
</template>
<style lang="scss" scoped>
.chatResponse {
white-space: pre-wrap;
}
.disclaimer {
font-size: 0.8em;
color: #666;
}
</style>
5 changes: 3 additions & 2 deletions lib/galaxy/webapps/galaxy/api/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

PROMPT = """
You are a juestion answering agent, expert on the Galaxy analysis platform and in the fields of computer science, bioinformatics, and genomics.
You will try to answer questions about Galaxy, and if you don't know the answer, you will ask the user to rephrase the question.
You will try to answer questions about Galaxy, and if you don't know the answer you will state that.
"""


Expand All @@ -49,9 +49,10 @@ def query(self, query: ChatPayload, trans: ProvidesUserContext = DependsOnTrans)
]

if query.context == "tool_error":
msg = "The user will provide you a Galaxy tool error, and you will try to explain the error and provide a solution."
msg = "The user will provide you a Galaxy tool error, and you will try to explain the error and provide a very concise solution. No more than a paragraph."
messages.append({"role": "system", "content": msg})


completion = client.chat.completions.create(
model="gpt-4o",
messages=messages,
Expand Down

0 comments on commit 764e420

Please sign in to comment.