Skip to content

Commit

Permalink
added json.loads() to convert user_metadata to json
Browse files Browse the repository at this point in the history
  • Loading branch information
jkshj21 authored and kmaphoenix committed Jul 18, 2024
1 parent aaaf073 commit 8eaa71c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,13 @@
" ) -> VertexConversationResponse:\n",
" if session_id is None:\n",
" session_id = self.sessions.build_session_id(self.agent_id)\n",
"\n",
" if user_metadata:\n",
" try:\n",
" user_metadata = json.loads(user_metadata)\n",
" except ValueError as err:\n",
" raise UserWarning(\"Invalid user metadata\") from err\n",
" \n",
" response = self.detect_intent(\n",
" agent_id=self.agent_id,\n",
" session_id=session_id,\n",
Expand Down

0 comments on commit 8eaa71c

Please sign in to comment.