Skip to content

Commit

Permalink
Checks if the message is a dict before saving it to the genai analysi…
Browse files Browse the repository at this point in the history
…s field in the case model (#5357)
  • Loading branch information
mvilanova authored Oct 17, 2024
1 parent 8efea5c commit e08bb05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dispatch/plugins/dispatch_slack/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def create_threaded(self, case: Case, conversation_id: str, db_session: Session)
client=client,
config=self.configuration,
)
if message:
if message and isinstance(message, dict):
# we update the genai_analysis field in the case model with the message if it's a dict
# if the message is a string, it means there was an error generating the analysis
case.genai_analysis = message

if message_blocks:
Expand Down

0 comments on commit e08bb05

Please sign in to comment.