Skip to content

Commit

Permalink
Close out issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Nov 30, 2023
1 parent 25974de commit f6ae96d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/examples/langchain/langchain_chat_pandas_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,28 +139,24 @@ async def callback(self, contents, user, instance):
species are there?'"""
)
)
# We `send` instead of just `return` due to the bug
# https://github.com/holoviz/panel/issues/5708
instance.send(message, respond=False)
return # message
return message

if self.error_message:
message = self.config._get_agent_message(self.error_message)
instance.send(message, respond=False)
return # message
return message

if self.config.show_chain_of_thought:
langchain_callbacks = [
pn.chat.langchain.PanelCallbackHandler(instance=instance)
]
else:
langchain_callbacks = []

response = await self.pandas_df_agent.arun(
contents, callbacks=langchain_callbacks
)
message = self.config._get_agent_message(response)
instance.send(message, respond=False)
return
return message


state = AppState()
Expand Down

0 comments on commit f6ae96d

Please sign in to comment.