Skip to content

Commit

Permalink
Merge pull request #102 from holoviz-topics/fix/pandas-chat
Browse files Browse the repository at this point in the history
Move Pandas app to langchain-experimental
  • Loading branch information
ahuang11 authored Nov 27, 2023
2 parents 1d2c0bb + c3ab3b4 commit c342af2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
// "git": "latest",
// "github-cli": "latest"
}
}
}
5 changes: 3 additions & 2 deletions docs/examples/langchain/langchain_chat_pandas_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import panel as pn
import param
import requests
from langchain.agents import AgentType, create_pandas_dataframe_agent
from langchain.agents import AgentType
from langchain.chat_models import ChatOpenAI
from langchain_experimental.agents.agent_toolkits import create_pandas_dataframe_agent

from panel_chat_examples import EnvironmentWidgetBase

Expand Down Expand Up @@ -154,7 +155,7 @@ async def callback(self, contents, user, instance):
]
else:
langchain_callbacks = []
response = await state.pandas_df_agent.arun(
response = await self.pandas_df_agent.arun(
contents, callbacks=langchain_callbacks
)
message = self.config._get_agent_message(response)
Expand Down
2 changes: 1 addition & 1 deletion panel_chat_examples/_environment_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class EnvironmentWidgetBase(pn.viewable.Viewer):
"the publisher of this app before entering your secrets."
),
doc="""An Alert message to display to the user to make them handle their secrets
securely. If not set, then no Alert is diplayed""",
securely. If not set, then no Alert is displayed""",
)

variables_not_set = param.List(
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ dependencies = [
"ctransformers",
"hvplot",
"langchain",
"langchain-experimental",
"numexpr",
"openai",
"panel>=1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/example.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ date,category,quantity,price
2021-01-07,home goods,3,150
2021-01-08,electronics,4,2000
2021-01-09,groceries,2,50
2021-01-10,electronics,3,1500
2021-01-10,electronics,3,1500

0 comments on commit c342af2

Please sign in to comment.