Aarshay Jain commited on
Commit
00ba8c2
1 Parent(s): 0ec1ea6

hide chat bar at the end of interview

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. client.py +2 -1
app.py CHANGED
@@ -82,6 +82,8 @@ with gr.Blocks() as demo:
82
  if response.agent_message is not None:
83
  bot_message = response.agent_message
84
  history[-1][1] = bot_message
 
 
85
  return {chatbot: history}
86
  if response.error_message is not None:
87
  return {
@@ -89,7 +91,6 @@ with gr.Blocks() as demo:
89
  user_input: gr.update(visible=False)
90
  }
91
 
92
-
93
  user_input.submit(user, [user_input, chatbot], [user_input, chatbot], queue=False).then(
94
  bot, [chat_id, chatbot], [user_input, chatbot, error_bar]
95
  )
 
82
  if response.agent_message is not None:
83
  bot_message = response.agent_message
84
  history[-1][1] = bot_message
85
+ if response.end_interview:
86
+ return {user_input: make_invisible(), chatbot: history}
87
  return {chatbot: history}
88
  if response.error_message is not None:
89
  return {
 
91
  user_input: gr.update(visible=False)
92
  }
93
 
 
94
  user_input.submit(user, [user_input, chatbot], [user_input, chatbot], queue=False).then(
95
  bot, [chat_id, chatbot], [user_input, chatbot, error_bar]
96
  )
client.py CHANGED
@@ -37,7 +37,8 @@ class GetChatRequest(BaseModel):
37
  class GetChatResponse(BaseModel):
38
  chat_id: UUID
39
  agent_message: str | None
40
- error_message: str | None = None
 
41
 
42
 
43
  class AppClient:
 
37
  class GetChatResponse(BaseModel):
38
  chat_id: UUID
39
  agent_message: str | None
40
+ error_message: str | None
41
+ end_interview: bool
42
 
43
 
44
  class AppClient: