Skip to content

Commit 5c794fd

Browse files
authored
refs(py): updates (#1350)
* Better Middleware TOC & fix entries * Fix deepagents cards (js) * Fix fields for middleware & x-ref to model string info * LangGraph pass * Fix GenAI multimodal example * Fix titles *
1 parent 53cc24b commit 5c794fd

File tree

22 files changed

+409
-328
lines changed

22 files changed

+409
-328
lines changed

pipeline/preprocessors/link_map.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class LinkMap(TypedDict):
104104
"system_prompt": "langchain/agents/#langchain.agents.create_agent(system_prompt)",
105105
"AgentState": "langchain/agents/#langchain.agents.AgentState",
106106
"ModelRequest": "langchain/middleware/#langchain.agents.middleware.ModelRequest",
107-
"ModelRequest(response_format)": "langchain/middleware/#langchain.agents.middleware.ModelRequest(response_format)",
108107
"@dynamic_prompt": "langchain/middleware/#langchain.agents.middleware.dynamic_prompt",
109108
"@before_model": "langchain/middleware/#langchain.agents.middleware.before_model",
110109
"@after_model": "langchain/middleware/#langchain.agents.middleware.after_model",
@@ -161,7 +160,7 @@ class LinkMap(TypedDict):
161160
"AnthropicLLM": "integrations/langchain_anthropic/AnthropicLLM/",
162161
# Models
163162
"init_chat_model": "langchain/models/#langchain.chat_models.init_chat_model",
164-
"init_chat_model(model_provider)": "langchain/models/#langchain.chat_models.init_chat_model(model_provider)",
163+
"init_chat_model(model)": "langchain/models/#langchain.chat_models.init_chat_model(model)",
165164
"BaseChatModel": "langchain_core/language_models/#langchain_core.language_models.chat_models.BaseChatModel",
166165
"BaseChatModel.invoke": "langchain_core/language_models/#langchain_core.language_models.chat_models.BaseChatModel.invoke",
167166
"BaseChatModel.stream": "langchain_core/language_models/#langchain_core.language_models.chat_models.BaseChatModel.stream",

reference/python/docs/langchain/agents.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
!!! warning "Reference docs"
2+
3+
This page contains **reference documentation** for Agents. See [the docs](https://docs.langchain.com/oss/python/langchain/agents) for conceptual guides, tutorials, and examples on using Agents.
4+
15
<!-- Intentionally want to highlight `create_agent` on this page first -->
26
<!-- (`group_by_category orders `AgentState` (a class) before functions) -->
37
::: langchain.agents

reference/python/docs/langchain/embeddings.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
!!! warning "Reference docs"
2+
3+
This page contains **reference documentation** for Embeddings. See [the docs](https://docs.langchain.com/oss/python/langchain/retrieval#embedding-models) for conceptual guides, tutorials, and examples on using Embeddings.
4+
15
<!-- Intentionally want to highlight `init_embedding` on this page first -->
26
<!-- (`group_by_category orders `Embeddings` (a class) before functions) -->
37
::: langchain.embeddings

reference/python/docs/langchain/messages.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
!!! warning "Reference docs"
2+
3+
This page contains **reference documentation** for Messages. See [the docs](https://docs.langchain.com/oss/python/langchain/messages) for conceptual guides, tutorials, and examples on using Messages.
4+
15
::: langchain.messages
26
options:
37
summary: true

reference/python/docs/langchain/middleware.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,44 @@
1+
!!! warning "Reference docs"
2+
3+
This page contains **reference documentation** for Middleware. See [the docs](https://docs.langchain.com/oss/python/langchain/middleware) for conceptual guides, tutorials, and examples on using Middleware.
4+
5+
## Middleware classes
6+
7+
| CLASS | DESCRIPTION |
8+
| -------------- | ----------- |
9+
| [`ContextEditingMiddleware`](./#langchain.agents.middleware.ContextEditingMiddleware) | Edit context in agent workflows |
10+
| [`HumanInTheLoopMiddleware`](./#langchain.agents.middleware.HumanInTheLoopMiddleware) | Enable human intervention in agent processes |
11+
| [`LLMToolSelectorMiddleware`](./#langchain.agents.middleware.LLMToolSelectorMiddleware) | Select tools using LLM-based logic |
12+
| [`LLMToolEmulator`](./#langchain.agents.middleware.LLMToolEmulator) | Emulate tool execution using LLM |
13+
| [`ModelCallLimitMiddleware`](./#langchain.agents.middleware.ModelCallLimitMiddleware) | Limit the number of model calls |
14+
| [`ModelFallbackMiddleware`](./#langchain.agents.middleware.ModelFallbackMiddleware) | Provide fallback model options |
15+
| [`PIIMiddleware`](./#langchain.agents.middleware.PIIMiddleware) | Handle personally identifiable information |
16+
| [`SummarizationMiddleware`](./#langchain.agents.middleware.SummarizationMiddleware) | Summarize content in agent workflows |
17+
| [`TodoListMiddleware`](./#langchain.agents.middleware.TodoListMiddleware) | Manage TODO lists in agent processes |
18+
| [`ToolCallLimitMiddleware`](./#langchain.agents.middleware.ToolCallLimitMiddleware) | Limit the number of tool calls |
19+
| [`AgentMiddleware`](./#langchain.agents.middleware.AgentMiddleware) | Base middleware class for agent operations |
20+
21+
## Components and utilities
22+
23+
The following classes and functions provide the foundation for building and managing agent middleware:
24+
25+
| COMPONENT | DESCRIPTION |
26+
| -------------- | ----------- |
27+
| [`AgentState`](./#langchain.agents.middleware.AgentState) | Represent the state of an agent |
28+
| [`ClearToolUsesEdit`](./#langchain.agents.middleware.ClearToolUsesEdit) | Function to clear tool usage edits |
29+
| [`InterruptOnConfig`](./#langchain.agents.middleware.InterruptOnConfig) | Configuration class for interruption handling |
30+
| [`ModelRequest`](./#langchain.agents.middleware.ModelRequest) | Represent a request to a model |
31+
| [`ModelResponse`](./#langchain.agents.middleware.ModelResponse) | Represent a response from a model |
32+
| [`before_model`](./#langchain.agents.middleware.before_model) | Function executed before model calls |
33+
| [`after_model`](./#langchain.agents.middleware.after_model) | Function executed after model calls |
34+
| [`wrap_model_call`](./#langchain.agents.middleware.wrap_model_call) | Function wrapper for model calls |
35+
| [`wrap_tool_call`](./#langchain.agents.middleware.wrap_tool_call) | Function wrapper for tool calls |
36+
137
<!-- `group_by_category false to allow custom ordering -->
38+
<!-- `summary false since overriding above -->
239
::: langchain.agents.middleware
340
options:
4-
summary:
5-
# <https://mkdocstrings.github.io/python/usage/configuration/members/#summary>
6-
classes: true
41+
summary: false
742
group_by_category: false
843
members:
944
- ContextEditingMiddleware
@@ -15,7 +50,7 @@
1550
- PIIMiddleware
1651
- PIIDetectionError
1752
- SummarizationMiddleware
18-
- TodoListMiddleWare
53+
- TodoListMiddleware
1954
- ToolCallLimitMiddleware
2055
- AgentMiddleware
2156
- AgentState
@@ -27,5 +62,4 @@
2762
- after_model
2863
- wrap_model_call
2964
- wrap_tool_call
30-
- dynamic-prompt
3165
- ModelRequest

reference/python/docs/langchain/models.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Chat models
22

3+
!!! warning "Reference docs"
4+
5+
This page contains **reference documentation** for chat models. See [the docs](https://docs.langchain.com/oss/python/langchain/models) for conceptual guides, tutorials, and examples on using chat models.
6+
37
::: langchain.chat_models
48
options:
59
parameter_headings: true

reference/python/docs/langchain/tools.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
!!! warning "Reference docs"
2+
3+
This page contains **reference documentation** for Tools. See [the docs](https://docs.langchain.com/oss/python/langchain/tools) for conceptual guides, tutorials, and examples on using Tools.
4+
15
::: langchain.tools.tool
26
::: langchain.tools.BaseTool
37
options:

0 commit comments

Comments
 (0)