diff --git a/lib/galaxy/managers/chat.py b/lib/galaxy/managers/chat.py index f3447e9aca72..366152460ee1 100644 --- a/lib/galaxy/managers/chat.py +++ b/lib/galaxy/managers/chat.py @@ -1,4 +1,7 @@ -from typing import Optional +from typing import ( + Optional, + Union, +) from fastapi import Path from sqlalchemy import ( @@ -59,7 +62,7 @@ def create(self, trans: ProvidesUserContext, job_id: JobIdPathParam, message: st trans.sa_session.commit() return chat_exchange - def get(self, trans: ProvidesUserContext, job_id: JobIdPathParam) -> ChatExchange | None: + def get(self, trans: ProvidesUserContext, job_id: JobIdPathParam) -> Union[ChatExchange, None]: """ Returns the chat response from the DB based on the given job id. :param job_id: id of the job to load a response for from the DB diff --git a/lib/galaxy/webapps/galaxy/api/chat.py b/lib/galaxy/webapps/galaxy/api/chat.py index 5723fbf4815c..7a48cc4fae36 100644 --- a/lib/galaxy/webapps/galaxy/api/chat.py +++ b/lib/galaxy/webapps/galaxy/api/chat.py @@ -3,6 +3,7 @@ """ import logging +from typing import Union from galaxy.config import GalaxyAppConfiguration from galaxy.exceptions import ConfigurationError @@ -75,7 +76,7 @@ def feedback( job_id: JobIdPathParam, feedback: int, trans: ProvidesUserContext = DependsOnTrans, - ) -> int | None: + ) -> Union[int, None]: """Provide feedback on the chatbot response.""" job = self.job_manager.get_accessible_job(trans, job_id) chat_response = self.chat_manager.set_feedback_for_job(trans, job.id, feedback)