Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaancayli committed Feb 21, 2024
1 parent bfa3da5 commit 9d82946
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/pipeline/chat/tutor_chat_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def __call__(self, query: IrisMessage, **kwargs) -> IrisMessage:
"""
if query is None:
raise ValueError("IrisMessage must not be None")
message = query.text
logger.debug("Running tutor chat pipeline...")
message = query.text
response = self.pipeline.invoke({"question": message})
logger.debug(f"Response from tutor chat pipeline: {response}")
return IrisMessage(role=IrisMessageRole.ASSISTANT, text=response)
6 changes: 3 additions & 3 deletions app/pipeline/shared/summary_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def __call__(self, query: str, **kwargs) -> str:
:param kwargs: keyword arguments
:return: summary text as string
"""
if _cache := self._cache.get(query):
logger.debug(f"Returning cached summary for query: {query[:20]}...")
return _cache
if query is None:
raise ValueError("Query must not be None")
logger.debug("Running summary pipeline...")
if _cache := self._cache.get(query):
logger.debug(f"Returning cached summary for query: {query[:20]}...")
return _cache
response = self.pipeline.invoke({"text": query})
logger.debug(f"Response from summary pipeline: {response[:20]}...")
self._cache[query] = response
Expand Down

0 comments on commit 9d82946

Please sign in to comment.