Skip to content

Commit

Permalink
changing nullable status
Browse files Browse the repository at this point in the history
tcollins2011 committed Oct 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 392a255 commit 8ae017f
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
@@ -11543,8 +11543,8 @@ class ChatGXYResponses(Base):
__tablename__ = "chatgxy_responses"

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


Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ def upgrade():
create_table(
table_name,
Column('id', Integer, primary_key=True),
Column('job_id', Integer, ForeignKey('job.id'), nullable=True),
Column('job_id', Integer, ForeignKey('job.id'), index=True),
Column('response', Text, nullable=False),
Column('feedback', Integer, nullable=True),
)
3 changes: 3 additions & 0 deletions lib/galaxy/webapps/galaxy/api/chat.py
Original file line number Diff line number Diff line change
@@ -42,6 +42,9 @@ def query(self, query: ChatPayload, trans: ProvidesUserContext = DependsOnTrans)
response = self._call_openai(messages)

answer = response.choices[0].message.content

# save the answer to the database under chatgxy_responses table

return answer

def _ensure_openai_configured(self):

0 comments on commit 8ae017f

Please sign in to comment.