mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 05:43:55 +00:00
docs: fix docstring examples (#16889)
This commit is contained in:
parent
c2d09fb151
commit
7d03d8f586
@ -34,16 +34,16 @@ def create_csv_agent(
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_experimental.agents import create_csv_agent
|
from langchain_experimental.agents import create_csv_agent
|
||||||
|
|
||||||
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
||||||
agent_executor = create_pandas_dataframe_agent(
|
agent_executor = create_pandas_dataframe_agent(
|
||||||
llm,
|
llm,
|
||||||
"titanic.csv",
|
"titanic.csv",
|
||||||
agent_type="openai-tools",
|
agent_type="openai-tools",
|
||||||
verbose=True
|
verbose=True
|
||||||
)
|
)
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
try:
|
try:
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
@ -200,21 +200,20 @@ def create_pandas_dataframe_agent(
|
|||||||
a PythonAstREPLTool with the DataFrame(s) and any user-provided extra_tools.
|
a PythonAstREPLTool with the DataFrame(s) and any user-provided extra_tools.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_experimental.agents import create_pandas_dataframe_agent
|
from langchain_experimental.agents import create_pandas_dataframe_agent
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
df = pd.read_csv("titanic.csv")
|
df = pd.read_csv("titanic.csv")
|
||||||
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
|
||||||
agent_executor = create_pandas_dataframe_agent(
|
agent_executor = create_pandas_dataframe_agent(
|
||||||
llm,
|
llm,
|
||||||
df,
|
df,
|
||||||
agent_type="openai-tools",
|
agent_type="openai-tools",
|
||||||
verbose=True
|
verbose=True
|
||||||
)
|
)
|
||||||
|
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user