Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/oss/langchain/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def dynamic_prompt(state):
else "Provide simple, clear explanations."
)
return [system_msg] + state["messages"]
agent = create_agent(model, tools, prompt=dynamic_prompt)
agent = create_agent(model, tools, system_prompt=dynamic_prompt)
```
</CodeGroup>
:::
Expand Down
6 changes: 3 additions & 3 deletions src/oss/langchain/rag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ prompt = (
"You have access to a tool that retrieves context from a blog post. "
"Use the tool to help answer user queries."
)
agent = create_agent(llm, tools, prompt=prompt)
agent = create_agent(llm, tools, system_prompt=prompt)
```

```python
Expand Down Expand Up @@ -608,7 +608,7 @@ prompt = (
"You have access to a tool that retrieves context from a blog post. "
"Use the tool to help answer user queries."
)
agent = create_agent(llm, tools, prompt=prompt)
agent = create_agent(llm, tools, system_prompt=prompt)
```
:::
:::js
Expand Down Expand Up @@ -782,7 +782,7 @@ def prompt_with_context(state: AgentState) -> list[MessageLikeRepresentation]:
return [{"role": "system", "content": system_message}, *list(state["messages"])]


agent = create_agent(llm, tools=[], prompt=prompt_with_context)
agent = create_agent(llm, tools=[], system_prompt=prompt_with_context)
```
:::
:::js
Expand Down
4 changes: 2 additions & 2 deletions src/oss/python/integrations/tools/requests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ Here is documentation on the API:
{api_spec}
""".format(api_spec=api_spec)

agent_executor = create_agent(llm, tools, prompt=system_message)
agent = create_agent(llm, tools, system_prompt=system_message)
```

```python
example_query = "Fetch the top two posts. What are their titles?"

events = agent_executor.stream(
events = agent.stream(
{"messages": [("user", example_query)]},
stream_mode="values",
)
Expand Down
6 changes: 3 additions & 3 deletions src/oss/python/integrations/tools/sql_database.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ We then instantiate the agent:
```python
from langchain.agents import create_agent

agent_executor = create_agent(llm, toolkit.get_tools(), prompt=system_message)
agent = create_agent(llm, toolkit.get_tools(), system_prompt=system_message)
```

And issue it a query:

```python
example_query = "Which country's customers spent the most?"

events = agent_executor.stream(
events = agent.stream(
{"messages": [("user", example_query)]},
stream_mode="values",
)
Expand Down Expand Up @@ -278,7 +278,7 @@ We can also observe the agent recover from an error:
```python
example_query = "Who are the top 3 best selling artists?"

events = agent_executor.stream(
events = agent.stream(
{"messages": [("user", example_query)]},
stream_mode="values",
)
Expand Down