Skip to content

Commit

Permalink
added tool id to chatgxy_response table
Browse files Browse the repository at this point in the history
  • Loading branch information
tcollins2011 committed Oct 29, 2024
1 parent 8ae017f commit 608c8df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/src/components/GalaxyWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ function submitQuery() {
<div>
<!-- input text, full width top of page -->
<Heading v-if="props.view == 'wizard'" inline h2>Ask the wizard</Heading>
<div :class="props.view == 'wizard' && 'mt-2'">
<!-- <div :class="props.view == 'wizard' && 'mt-2'">
<b-input
v-if="props.query == ''"
id="wizardinput"
v-model="query"
style="width: 100%"
placeholder="What's the difference in fasta and fastq files?"
@keyup.enter="submitQuery" />
@keyup.enter="submitQuery" /> -->
<b-button
v-else-if="!queryResponse"
class="w-100"
variant="info"
:disabled="busy"
@click="submitQuery">
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11544,6 +11544,7 @@ class ChatGXYResponses(Base):

id: Mapped[int] = mapped_column(primary_key=True)
job_id: Mapped[Optional[int]] = mapped_column(ForeignKey("job.id"), index=True)
tool_id: Mapped[Optional[int]] = mapped_column(ForeignKey("tool.id"), index=True)
response: Mapped[str] = mapped_column(TEXT, nullable=False)
feedback: Mapped[int] = mapped_column(Integer, nullable=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def upgrade():
table_name,
Column('id', Integer, primary_key=True),
Column('job_id', Integer, ForeignKey('job.id'), index=True),
Column('tool_id', Integer, ForeignKey('tool.id'), index=True),
Column('response', Text, nullable=False),
Column('feedback', Integer, nullable=True),
)
Expand Down
3 changes: 3 additions & 0 deletions lib/galaxy/webapps/galaxy/api/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class ChatAPI:
@router.post("/api/chat")
def query(self, query: ChatPayload, trans: ProvidesUserContext = DependsOnTrans) -> str:
"""We're off to ask the wizard"""

# Add logic to check if the job id is in the chatgxy_responses table, if it is return the response

self._ensure_openai_configured()

messages = self._build_messages(query, trans)
Expand Down

0 comments on commit 608c8df

Please sign in to comment.