Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Set result to none after sending the result #132

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions app/pipeline/chat/course_chat_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,25 +416,26 @@ def lecture_content_retrieval(prompt: str) -> str:

self.callback.done("Response created", final_result=out)

# try:
# # if out:
# # suggestion_dto = InteractionSuggestionPipelineExecutionDTO()
# # suggestion_dto.chat_history = dto.chat_history
# # suggestion_dto.last_message = out
# # suggestions = self.suggestion_pipeline(suggestion_dto)
# # self.callback.done(final_result=None, suggestions=suggestions)
# # else:
# # # This should never happen but whatever
# # self.callback.skip(
# # "Skipping suggestion generation as no output was generated."
# # )
# except Exception as e:
# logger.error(
# "An error occurred while running the course chat interaction suggestion pipeline",
# exc_info=e,
# )
# traceback.print_exc()
# self.callback.error("Generating interaction suggestions failed.")
try:
self.callback.skip("Skipping suggestion generation.")
# if out:
# suggestion_dto = InteractionSuggestionPipelineExecutionDTO()
# suggestion_dto.chat_history = dto.chat_history
# suggestion_dto.last_message = out
# suggestions = self.suggestion_pipeline(suggestion_dto)
# self.callback.done(final_result=None, suggestions=suggestions)
# else:
# # This should never happen but whatever
# self.callback.skip(
# "Skipping suggestion generation as no output was generated."
# )
except Exception as e:
logger.error(
"An error occurred while running the course chat interaction suggestion pipeline",
exc_info=e,
)
traceback.print_exc()
self.callback.error("Generating interaction suggestions failed.")
except Exception as e:
logger.error(
"An error occurred while running the course chat pipeline", exc_info=e
Expand Down
2 changes: 2 additions & 0 deletions app/web/status/status_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def done(
raise ValueError(
"Invalid state transition to done. current state is ", self.stage.state
)
# Reset the result after sending a final response
self.status.result = None

def error(self, message: str, exception=None):
"""
Expand Down
Loading