Skip to content

Commit 9636fa0

Browse files
authored
Update converse_conversation_sample.py
1 parent d776f65 commit 9636fa0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎discoveryengine/converse_conversation_sample.py‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,12 @@ def multi_turn_conversational_search(
9595
response = client.converse_conversation(request=request)
9696

9797
reply_text = ""
98+
9899
if response.reply:
99-
if (
100-
hasattr(response.reply, "summary")
101-
and response.reply.summary
102-
and response.reply.summary.summary_text
103-
):
104-
reply_text = response.reply.summary.summary_text
105-
elif hasattr(response.reply, "reply") and response.reply.reply:
106-
reply_text = response.reply.reply
100+
if response.reply.summary and response.reply.summary.summary_text:
101+
reply_text = response.reply.summary.summary_text
102+
elif response.reply.reply:
103+
reply_text = response.reply.reply
107104

108105
print(f"\nUser Query: {query_text}")
109106
print(f"AI Generated Reply: {reply_text}")

0 commit comments

Comments
 (0)