Skip to content

The agent engineering platform.

docs: update OpenWiki (#40318)

github-actions[bot]a7b0f0ae50ac
diff --git a/CLAUDE.md b/CLAUDE.md
index 1f51f9b4e0..153dbaa793 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -375,11 +375,6 @@ This repository require actions to be pinned to a full-length commit SHA. Attemp
## OpenWiki
-This repository has a generated `openwiki/` evidence index. It is optional just-in-time context, not required startup reading.
-
-- Treat source code and tests as authoritative. A brief's unknowns and review items are verification gaps, not automatic requirements.
-- Prefer the narrowest quiet validation that proves the changed behavior. Preserve complete failure output.
-
-The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki. Do not hand-edit generated OpenWiki pages unless explicitly asked; prefer updating source code/docs and letting OpenWiki regenerate.
+See [AGENTS.md](AGENTS.md) for OpenWiki agent instructions.
<!-- OPENWIKI:END -->
diff --git a/openwiki/.claims/partner-pattern.json b/openwiki/.claims/partner-pattern.json
index bb88fd0c28..47b5ee8b92 100644
--- a/openwiki/.claims/partner-pattern.json
+++ b/openwiki/.claims/partner-pattern.json
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
- "pageVersion": "sha256:989b7aec4a438448775477cdd98e554b1cc64e2e0ec441dc7eb1e2ea3e406d1d",
+ "pageVersion": "sha256:91706aa194d34ce5f993646f2d7f280fff4b4ac0424ec2e7a1da4f8e3b132469",
"claims": [
{
"id": "claim_7c2a1600fd294471a122d693305b38f8",
@@ -88,7 +88,7 @@
},
{
"id": "claim_a7fa4aec0f874ffaa86e9395f1870be7",
- "statement": "Provider packages reside in /libs/partners/provider_name/ with a langchain_provider_name module containing chat_models/base.py, data/ with profiles and augmentations, tests/ for unit and integration tests, and standard files: pyproject.toml, Makefile, README, LICENSE, uv.lock.",
+ "statement": "Provider packages reside in /libs/partners/provider_name/ with a langchain_provider_name module containing chat_models/base.py, data/ with profiles and augmentations, tests/ for unit and integration tests, and standard files: pyproject.toml, Makefile, README, LICENSE, uv.lock. The pyproject.toml specifies langchain-core>=1.6.0,<2.0.0, provider SDK dependencies with pinned versions (e.g., openai>=2.45.0,<4.0.0), and test dependencies including langchain-tests>=1.1.9,<2.0.0 with version constraints. Local packages are referenced via [tool.uv.sources].",
"evidence": [
{
"resource": "repo://libs/partners/anthropic/langchain_anthropic/chat_models.py",
@@ -99,8 +99,8 @@
"version": "repo-file-v1:sha256:b69d77fd9aa09cdc548568ae5103af5800deaaf4e2742b2ca8516e99e9a3b4bb"
},
{
- "resource": "repo://libs/partners/openai/pyproject.toml#L1-L72",
- "version": "repo-lines-v1:sha256:43bf650f1e56f4b3a04864c4f2739fa15737ce7403e09f4f5d7943fef7dc647b:eyJzZWxlY3RlZExpbmVDb3VudCI6NzIsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjA0NTY5OTQ2YWM5YmJlN2NiMmNkZWMzZjhiZWNmMzQzNzUwYzU4YjliMzIxZWMyMTk1YmZiYWFiMmFhOGM0YmEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjczOTU1MmZkOTY2ODc4ZTE0MzcyNjAzODUzMjhlZTZlMTY1ODBiNmEyMTQ5NTI2ZjhlOGM3ZmM3MDA4NDU5NTYifQ"
+ "resource": "repo://libs/partners/openai/pyproject.toml#L1-L76",
+ "version": "repo-lines-v1:sha256:617ae86c97bfd7aaef35b7606632f412df8392c530d1baa48df1e71d67e1fc86:eyJzZWxlY3RlZExpbmVDb3VudCI6NzYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjA0NTY5OTQ2YWM5YmJlN2NiMmNkZWMzZjhiZWNmMzQzNzUwYzU4YjliMzIxZWMyMTk1YmZiYWFiMmFhOGM0YmEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImM3ZmUwMjFkZWU4YWRkY2MzZjFmNWUyOTdmM2FlNjhlZjM2MTg0MTg2ZTZkNDA4OTFlMTExZmFhYTMzMzUyMjkiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU3OGYwNmRkZWNjMGE3NzdiODYzNTZmMTE4OTQ1ZjdjMWM4YWM2MWEwMTk4MTEyMTZkNWNjOWJjYmE1ZmNjMjcifQ"
}
]
},
@@ -113,10 +113,50 @@
"version": "repo-lines-v1:sha256:6b4cb2faf8b3c8ee096a2f1042c095b1afd407cb1493932ec8c691fe4406efa6:eyJzZWxlY3RlZExpbmVDb3VudCI6MTEsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6Ijc2N2I4NTExMGM4ZDYwZDRmZTBhMTFlYWI2NjUwZWNlZjQ0ZTc2ZTdlMTU3ZWY0MzY0ZmQ4NzQ1YjMxODJhZDAiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImZhZmJhMDUyN2MzOTUzYzRiNmUwZTViNTczOWJhODM2MTJmODA1M2JjZGM5NDY2NzMwMTkzY2QxZDU5MGI0MDgiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImE2NDcxNTMyNmUwZDYxNDlkYWE3YTYzZDFkMDE3MmVlMWM1Yjk1NzlkZTliOTQ0NDBjZGM4MjFiNzVhYmNjMWEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjM5MzM1ZDEyMWJmMDg0ZjNkZDMzMzEzYTIzYjJkNzUzZmYzN2Q4YjRiZDdhMTgzNmVkNzAzMDE4YTQzOGIwZGQifQ"
}
]
+ },
+ {
+ "id": "claim_444b9ff37e5d45af9ce30bedd6042b17",
+ "statement": "Providers may optionally support advanced response APIs (e.g., OpenAI Responses API) alongside standard chat completions. These APIs enable streaming tool execution, reasoning outputs, and structured response formats. Implementation requires converting provider-specific response structures (content blocks with type/id/metadata) back to unified AIMessage format via provider-specific conversion functions (e.g., _convert_from_v1_to_responses). Responses API support is optional, configurable via provider-specific parameters (use_responses_api=True), and tested via dedicated test variants (test_responses_standard.py).",
+ "evidence": [
+ {
+ "resource": "repo://libs/partners/openai/langchain_openai/chat_models/_compat.py#L1-L66",
+ "version": "repo-lines-v1:sha256:3ebe187dbd9c60e3c578b49557371974d467265f4d41cbf9b9815b27c0892186:eyJzZWxlY3RlZExpbmVDb3VudCI6NjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6Ijc1MDk3Yjg4NTEwNzY5NjdiMDQ0Y2VjNGY5MDEzZmNkMzI0YTBjNmJlOWUzYjY3MGJjNWY0ZjY5MzE5MGFmNWQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImEzMDNlY2RkNGE0ZDEwZjE5YzczZmQ0MmZkMTI0MzdmZDMzNTRhODI2ODE2MDVkYTUyNTVhOTdhMzkwNjhkYmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjU1YjZlODcwNmI0MzA0N2YyYTZkYjY3ZjEzMjYzODU5NTYwNGU2N2YzNjk2Njg3NmNlMDE1OGYwMDUzZTZiZDEifQ"
+ },
+ {
+ "resource": "repo://libs/partners/openai/langchain_openai/chat_models/_compat.py#L420-L514",
+ "version": "repo-lines-v1:sha256:5edbafd2e91e0721eeb67a4ec784e0c9626394f5ef96220b12fb0c8d32b8189f:eyJzZWxlY3RlZExpbmVDb3VudCI6OTUsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjY3ODY2MjIwMzM5N2EzNmQ5YTI0ZDc2NDNiZWJlZDQ1MGQyMjhkYWI3OGU3ZmZiZDZiZTdjYzM3NWY3ODdiMjYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImRiNmI0YjE3YjY4NGVhZjdkOGRmMWM3MmNmMzVjMWFjZmQwYzgzYWY0MmI3MDY4MzFiMzlmODA2OGU0ZDM0NmUiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImU1ZTM2ZjFiMDZiMTA2NWQwMGZlMmZjMTlmMGY2OTNhNmE2OTA5MTg4MWE1MDczMmNkMzlmOWNiZTE0NTRmNDgiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"
+ },
+ {
+ "resource": "repo://libs/partners/openai/langchain_openai/chat_models/base.py#L1206-L1232",
+ "version": "repo-lines-v1:sha256:f87cd9fd019e68d2947e1f7d59727de00223e0ade76fe624ea874047c7cd903a:eyJzZWxlY3RlZExpbmVDb3VudCI6MjcsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ5YmQyOTMzNzBkZWUyYzk3NGFiZDM2ZmRjMmUwM2IwNjgxNTIzMWRlZmY1MzE0MWEzZjI2M2FhYzY2Y2UyOGEiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6ImE2YTcxNTI1NzJlZTg0ZjEwOTA2Yzc0YjlmMmE5MjQzNGRkYWIwZTNjNDI4MTNiMDRlNTk3ZWZjZWM5NTFiMjYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImEwYzA1NTc4OTUwNzI1ODcyOWUwNzAxMzhkZTc2NDk1NmVkZGFiZDUzNzhmMGQyY2JkMDdiOWU3Y2JhMWM0ZjEiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjY2NDQyMDIxZjNkNDJmMjU0MTVjZDJlOGNjMGIwNmRjYzQyMDZmYjFkZmE1ODY0NzJlNWUxNTYxZDZmZTQyNzYifQ"
+ },
+ {
+ "resource": "repo://libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py#L1-L99",
+ "version": "repo-lines-v1:sha256:b633abbf79920239cd3ca50463ef74011ad968d44a62026c340fe2b714195e03:eyJzZWxlY3RlZExpbmVDb3VudCI6OTksImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjI2MWViYzE4NDM2YzZjY2ZmYmFiYTQyNzg5YWNlY2U4YTMzZWJmOTc1ZDBlNGU2OTkxOThkYTQ2MWY4YjZmYWYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImU5YjJmZWNiYTNhOGJkZjBlOGEwZjFiZjM1YTE3M2EzMTU2N2ZlMDJmZmI0MjI1NjY0MGYwZmUwZTYxOTJiZmMifQ"
+ },
+ {
+ "resource": "repo://libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py#L1-L38",
+ "version": "repo-lines-v1:sha256:4520bf0c78fbf6a6791276c867203d5fb046f96b247d9a110fd3c859ceaedae7:eyJzZWxlY3RlZExpbmVDb3VudCI6MzgsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImYwODY1MzAzZmE5Njc5ZDM3NWE2YTUxMzY2MjdmYTUwZTVlZjc4Yzg0MTIyYmU2ODNjYzNjNjY5MThmNWM0YTYiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjU5MDlhNTNhNjE4ZDAyOGUxZDMwMDBjMGE3YWJjZWVjYmU1ZmIzN2Y0ZTUxMWVmZTQ2NjQzZmFkNmU2Njg3MmYiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjowLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjowLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6ImUzYjBjNDQyOThmYzFjMTQ5YWZiZjRjODk5NmZiOTI0MjdhZTQxZTQ2NDliOTM0Y2E0OTU5OTFiNzg1MmI4NTUifQ"
+ }
+ ]
+ },
+ {
+ "id": "claim_b0af652f582b43798af20375ffc9de60",
+ "statement": "Provider implementations must convert provider-specific response formats back to unified AIMessage. The conversion process involves: parsing the provider response structure, mapping provider content types to unified blocks, extracting and normalizing tool calls into ToolCall objects, populating usage_metadata (input/output token counts), and storing provider-specific fields in response_metadata. This is the reverse of input message conversion and ensures consistent output regardless of underlying provider API format.",
+ "evidence": [
+ {
+ "resource": "repo://libs/partners/openai/langchain_openai/chat_models/base.py#L217-L282",
+ "version": "repo-lines-v1:sha256:5e3fae2575c60ac6c83164339c7a77469f4cf4b35f2c1b7e5745de3449270674:eyJzZWxlY3RlZExpbmVDb3VudCI6NjYsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6ImRlOTRiYmJkZTFhNTc4ZTU0MDk3NjZmZjRhOTc3ODU2YzU4MmNkZDBiZDU5MzhkMDcxZDdkNjY2YTRkMzU2NjMiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjAxYmE0NzE5YzgwYjZmZTkxMWIwOTFhN2MwNTEyNGI2NGVlZWNlOTY0ZTA5YzA1OGVmOGY5ODA1ZGFjYTU0NmIiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjBlYzQyOTU5MTY5N2YyNDg0N2RkNWQ1Yzk2ZDM2ZDRiZDU2NzVmMzZhNDY3YWNhNjZkMjRiNzZiYzU0MDEyYjciLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6IjVkOGE3YmNjNjg2YzA3OTU5MmI3ZmFiNmVlZTFkMjZmODg3NTBlMTlmMzhlNzMxNjk0NzljYjViZTQ1ZTNiOGEifQ"
+ },
+ {
+ "resource": "repo://libs/partners/openai/langchain_openai/chat_models/base.py#L404-L483",
+ "version": "repo-lines-v1:sha256:19d3968712a35b837a1571d6054d2a26eb3b7b8333e34e719777d3ec4c457712:eyJzZWxlY3RlZExpbmVDb3VudCI6ODAsImZpcnN0U2VsZWN0ZWRMaW5lSGFzaCI6IjM1MGQ3ZDFiOWU4Mjk2ZjUxMGRkN2U3NGUyMjFlYWYzMzFmNzU5YjQ1ZGFmMGJlYjg0NDhkY2I2MWZjYThhOWQiLCJsYXN0U2VsZWN0ZWRMaW5lSGFzaCI6IjQ0NmQ1YzA0YjU5YjFmYmU0ZDAzNzc1ZmJmODI3ZjY5ODBhYmM1ZWE3OGE2ZDU4ZGViZDRmZWYyZmYyMjZmN2UiLCJwcmVjZWRpbmdDb250ZXh0TGluZUNvdW50IjozLCJwcmVjZWRpbmdDb250ZXh0SGFzaCI6IjVlMWZhYjNmYzQwYmE5YTFkMWRhNWZhOGIyZTU0ZTU5YWI4YTZjNjFjYzBmYWFjMmE4ZDEyZDVmYTg3MWJhMDAiLCJmb2xsb3dpbmdDb250ZXh0TGluZUNvdW50IjozLCJmb2xsb3dpbmdDb250ZXh0SGFzaCI6Ijg5NmY1ZWNhZDA4NzFlNzEyNzRjMjliMGIyM2RjZjhhYjI4MWZmYmY0ZGFlYWFjZGRmOWUzYWE5ODg3N2M0YmMifQ"
+ }
+ ]
}
],
"verification": {
"by": "openwiki/0.5.0",
- "at": "2026-09-03T15:18:34.589Z"
+ "at": "2026-09-09T08:26:28.144Z"
}
}
diff --git a/openwiki/.claims/quickstart.json b/openwiki/.claims/quickstart.json
index 2f757c51af..58f4a6267a 100644
--- a/openwiki/.claims/quickstart.json
+++ b/openwiki/.claims/quickstart.json
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
- "pageVersion": "sha256:e5d5db29dc79ac7fe95a9d3907d7332ac1504c3735f93a236d93039cebc2a687",
+ "pageVersion": "sha256:6bab4df1cbe8d024002542007ec45a1d17f5dd4d9454cb66bda120674fd4b44e",
"claims": [
{
"id": "claim_7425c73f5e4c4667b8babba66c3663a0",
@@ -183,6 +183,6 @@
],
"verification": {
"by": "openwiki/0.5.0",
- "at": "2026-09-08T08:27:09.597Z"
+ "at": "2026-09-09T08:26:28.144Z"
}
}
diff --git a/openwiki/.last-update.json b/openwiki/.last-update.json
index 4c89c67a3d..f3ad5192f1 100644
--- a/openwiki/.last-update.json
+++ b/openwiki/.last-update.json
@@ -1,7 +1,7 @@
{
- "updatedAt": "2026-09-08T08:37:19.693Z",
+ "updatedAt": "2026-09-09T08:30:25.024Z",
"command": "update",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
"model": "claude-haiku-4-5",
"status": "complete",
"language": "en"
diff --git a/openwiki/.page-manifest.json b/openwiki/.page-manifest.json
index 742f49768c..0f3b37374a 100644
--- a/openwiki/.page-manifest.json
+++ b/openwiki/.page-manifest.json
@@ -5,162 +5,162 @@
"pageVersion": "sha256:bd16b5e2d2f508d0aba8962fb1e836569b2a9af1615a3ec3a278948b6b703043",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/agent-factory.md": {
"pageVersion": "sha256:861e60569112cc57094912804e603c9cd7bd4162df709645dd543bb46b2cca3f",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/architecture.md": {
"pageVersion": "sha256:955c0c402efcda6052d84d4421645bd6720847d59e4d25c1c4ac40bec2d68e2a",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/callbacks.md": {
"pageVersion": "sha256:1bc36cc5d9a9fd1c9ab60ccb76938f7eb0d0722738953a69f474fe7e532f2a78",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/chat-models.md": {
"pageVersion": "sha256:67dc4d64315fbd418d3cdd7cd0f5500ae8f6059c10d263e69dfedd8e7d3a8338",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/ci-workflows.md": {
"pageVersion": "sha256:8af0cd4e2f4fde3bbeaa007c68ac7b8049bd352e75e6455e2b7896818da707cc",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/composability.md": {
"pageVersion": "sha256:2686a50367f151aef17fad64706fe0e5bb3d6d279febeecbac7d3760d2d17424",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/dev-commands.md": {
"pageVersion": "sha256:7dd5ad8767d8a3f658ed06a962ccaafe416623877d4864ce71de856a4ae7b52f",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/integration-tests.md": {
"pageVersion": "sha256:8bf3d528d2fe2628f24d10c54b6445ad11f8ec7abae99049815d037c83fdaf08",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/mcp-integration.md": {
"pageVersion": "sha256:39684cc4e8be6978f803b85b99406b6a877eaf9e8c8b964279a413f854340751",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/messages.md": {
"pageVersion": "sha256:7e1f2bf23c2f051eac9a9adf14ea571ffc8481dd90f220634bb732a545971a5a",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/middleware.md": {
"pageVersion": "sha256:dc648f1612a1d33054c8fbb196b66361684e441ad6fbf9af3cb5df1777a4a402",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/model-initialization.md": {
"pageVersion": "sha256:0ff4006082d29f33169349313c83cc890f4fafd73f0a3df4a51cf88689471825",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/openai-provider.md": {
"pageVersion": "sha256:012f8bbb76f0fc9e8cf5796d4dd6a558d1ac45e1248a500804c3dd6342401ccf",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/partner-pattern.md": {
- "pageVersion": "sha256:989b7aec4a438448775477cdd98e554b1cc64e2e0ec441dc7eb1e2ea3e406d1d",
+ "pageVersion": "sha256:91706aa194d34ce5f993646f2d7f280fff4b4ac0424ec2e7a1da4f8e3b132469",
"completedBy": "openwiki/0.5.0",
- "completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "completedRunId": "4e2863b2-b3c1-42c3-aa09-e3dfe9f97230",
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/prompts.md": {
"pageVersion": "sha256:5f946f7b6b3214808e71060f1626dc4100caf473eb5e0186d8064f20219062b9",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/quickstart.md": {
- "pageVersion": "sha256:e5d5db29dc79ac7fe95a9d3907d7332ac1504c3735f93a236d93039cebc2a687",
+ "pageVersion": "sha256:6bab4df1cbe8d024002542007ec45a1d17f5dd4d9454cb66bda120674fd4b44e",
"completedBy": "openwiki/0.5.0",
- "completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "completedRunId": "4e2863b2-b3c1-42c3-aa09-e3dfe9f97230",
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/runnables.md": {
"pageVersion": "sha256:2785275fb70363fa2ba7b5c6b351f08d2bb5de58d88dec14a5c66d33f670ea88",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/source-map.md": {
"pageVersion": "sha256:6ca0ee06a5fc2963191e151712a4fe1c0427cf4f7d2015ee0cdca292742929dd",
"completedBy": "openwiki/0.5.0",
"completedRunId": "cb0ae1f9-02ab-4f92-9981-eeb48c091794",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/streaming.md": {
"pageVersion": "sha256:a438de3bacc6da5a8e98bfd85d8e6f3a947deaf987bccf74fa6efdf166987bb6",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/structured-output.md": {
"pageVersion": "sha256:94885a8043502300eae424ea3f016be44eb925bbaf0ad6297fdd741c3280ee69",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/tools.md": {
"pageVersion": "sha256:f95633f03549fc6949b4ba8fc5d1bd13a03843a429ff10fa3284ae68f6ffce88",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
},
"/openwiki/unit-tests.md": {
"pageVersion": "sha256:7f15b0e6bb2c95e703a2e0c8f6fe04091727b2cb26ae3a3260124cd43f1394e0",
"completedBy": "openwiki/0.5.0",
"completedRunId": "b9d6bfc2-1d6c-4466-8f2b-ecd535b3e562",
- "gitHead": "e670c7a03ba36fd1516f0185f7ec1186c89aa471",
- "sourceFingerprint": "sha256:f04f2a17ceb7176792b77272fb0620d883237402ed5380fed61cffbc48ce7694"
+ "gitHead": "22f3421aeedec55962f712a34d86d9683bf6cf59",
+ "sourceFingerprint": "sha256:7d02f65fe28bf14669a654005944df05ee23fa0081c27bfb0afd490004a42e85"
}
}
}
diff --git a/openwiki/index.md b/openwiki/index.md
index e4aedf470d..8b399080cd 100644
--- a/openwiki/index.md
+++ b/openwiki/index.md
@@ -18,7 +18,7 @@ okf_version: "0.2"
- [Agent Middleware: Composable Request/Response Processing](middleware.md) - Document the middleware system for agents, including lifecycle hooks, HITL approval, error handling, retry logic, and middleware composition patterns for intercepting and modifying agent behavior.
- [Chat Model Initialization with init_chat_model](model-initialization.md) - Factory function for instantiating chat models from provider strings with unified configuration and runtime model switching.
- [OpenAI Integration: ChatOpenAI and Azure Support](openai-provider.md) - ChatOpenAI integration for OpenAI's Chat Completions and Responses APIs, with support for tool calling, structured output, vision, streaming, and Azure deployment.
-- [Adding a New Chat Model Provider](partner-pattern.md) - Step-by-step guide to integrate a new LLM provider into LangChain's monorepo, including package structure, ChatModel implementation, streaming, function calling, and standard tests.
+- [Adding a New Chat Model Provider](partner-pattern.md) - Step-by-step guide to integrate a new LLM provider into LangChain's monorepo, including package structure, ChatModel implementation, streaming, function calling, structured output, and standard tests. Covers message conversion, error handling, model profiles, and optional advanced API modes like Responses API.
- [Prompt Templates and Few-Shot Learning](prompts.md) - Prompt templates define message sequences and variable substitution patterns for chat models. Few-shot learning selects examples dynamically to teach models by example.
- [LangChain Repository Quick Start](quickstart.md) - Entry point for engineers: orient to the monorepo structure, run first tests, understand what to edit for common tasks, and route to major development areas.
- [Runnable: Core Composition Layer](runnables.md) - Explain the Runnable protocol and how it enables composable chaining of LLM components through the LangChain Expression Language (LCEL).
diff --git a/openwiki/partner-pattern.md b/openwiki/partner-pattern.md
index d2abea7a43..6c7415ae9f 100644
--- a/openwiki/partner-pattern.md
+++ b/openwiki/partner-pattern.md
@@ -1,11 +1,11 @@
---
type: Integration Pattern
title: Adding a New Chat Model Provider
-description: Step-by-step guide to integrate a new LLM provider into LangChain's monorepo, including package structure, ChatModel implementation, streaming, function calling, and standard tests.
+description: Step-by-step guide to integrate a new LLM provider into LangChain's monorepo, including package structure, ChatModel implementation, streaming, function calling, structured output, and standard tests. Covers message conversion, error handling, model profiles, and optional advanced API modes like Responses API.
tags: [chat-models, provider-integration, llm, function-calling, structured-output, streaming]
verified:
- by: openwiki/0.5.0
- at: 2026-09-03T15:18:34.589Z
+ at: 2026-09-09T08:26:28.144Z
sources:
- id: openwiki-source-c52037e7b642f7ac5a7642a8
resource: repo://libs/core/langchain_core/language_models/chat_models.py
@@ -23,15 +23,21 @@ sources:
resource: repo://libs/partners/anthropic/langchain_anthropic/data/profile_augmentations.toml
- id: openwiki-source-8641a971af4f11b852966d77
resource: repo://libs/partners/openai/langchain_openai/chat_models/__init__.py
+ - id: openwiki-source-3bc725a9a39d534be6f46d18
+ resource: repo://libs/partners/openai/langchain_openai/chat_models/_compat.py
- id: openwiki-source-738512768ef81ae009b097ac
resource: repo://libs/partners/openai/langchain_openai/chat_models/base.py
- id: openwiki-source-df762860acfcc6abf0ce804b
resource: repo://libs/partners/openai/pyproject.toml
+ - id: openwiki-source-e14c13faa5b908b1c95925d3
+ resource: repo://libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py
- id: openwiki-source-3953aa29dbaaf738e6efc09d
resource: repo://libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py
+ - id: openwiki-source-4065d8687d2708ee826c7818
+ resource: repo://libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py
- id: openwiki-source-025cad4ae99967890152b7e0
resource: repo://libs/standard-tests/README.md
-generated: { by: "openwiki/0.5.0", at: "2026-09-03T15:18:34.589Z" }
+generated: { by: "openwiki/0.5.0", at: "2026-09-09T08:26:28.144Z" }
---
## Overview
@@ -86,34 +92,56 @@ Create a new directory under `/libs/partners/` with the provider name in lowerca
### Package Metadata (pyproject.toml)
-Key configuration for a provider package (reference: `repo://libs/partners/openai/pyproject.toml`):
+Key configuration for a provider package (reference: `repo://libs/partners/openai/pyproject.toml#L1-L76`):
```toml
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
[project]
-name = "langchain-provider-name" # pypi package name
+name = "langchain-provider-name" # PyPI package name
description = "LangChain integration for Provider Name"
requires-python = ">=3.10.0,<4.0.0"
+version = "0.1.0"
dependencies = [
"langchain-core>=1.6.0,<2.0.0", # Required: base LangChain
- "provider-client-library>=X.Y.Z", # Provider's own SDK
+ "provider-client-library>=2.45.0,<4.0.0", # Provider's own SDK (pinned version)
"certifi>=2024.6.2", # SSL certificates
]
[dependency-groups]
test = [
- "pytest>=9.0.3",
- "pytest-asyncio>=1.3.0",
- "langchain>=1.0.0",
- "langchain-tests>=1.1.9", # Standard test suite
+ "pytest>=9.0.3,<10.0.0",
+ "pytest-asyncio>=1.3.0,<2.0.0",
+ "langchain>=1.0.0,<2.0.0",
+ "langchain-tests>=1.1.9,<2.0.0", # Standard test suite with version constraint
+]
+lint = ["ruff>=0.13.1,<0.17.0"]
+dev = []
+test_integration = [
+ # Additional integration test dependencies (API clients, test fixtures)
+]
+typing = [
+ "mypy>=2.1.0,<2.2.0",
]
[tool.uv.sources]
langchain-core = { path = "../../core", editable = true }
langchain-tests = { path = "../../standard-tests", editable = true }
langchain = { path = "../../langchain_v1", editable = true }
+
+[tool.uv]
+constraint-dependencies = ["urllib3>=2.6.3", "pygments>=2.20.0"]
```
+**Key patterns:**
+- **Lock provider SDK versions** to prevent breaking API changes (e.g., `openai>=2.45.0,<4.0.0`)
+- **Add version constraints to all test dependencies** for reproducibility
+- **Use `[tool.uv.sources]`** to reference local LangChain packages in monorepo
+- **Separate integration test dependencies** in a dedicated group (only needed in CI)
+
## 2. ChatModel Implementation
### BaseChatModel and Core Requirements
@@ -267,23 +295,42 @@ class ChatProviderModel(BaseChatModel):
### Message Conversion and Content Blocks
-LangChain messages have a **unified, provider-agnostic content format** using **content blocks** (reference: `/openwiki/messages.md`). Each provider must translate between this format and its own API schema.
+LangChain messages have a **unified, provider-agnostic content format** using **content blocks** (reference: `/openwiki/messages.md`). Each provider must translate between this format and its own API schema on both input and output.
**Key message fields:**
- **`content`**: `str | list[dict]` - Either plain text or structured content blocks
- **`tool_calls`**: `list[ToolCall]` - Structured tool invocation requests from the model
- **`usage_metadata`**: Token counts and category breakdowns
+- **`response_metadata`**: Provider-specific response data (model name, usage, finish reason, etc.)
-**Content block types:**
+**Unified content block types:**
- `{"type": "text", "text": "..."}` - Plain text
-- `{"type": "image", "source": {...}}` - Images (multiple source formats)
+- `{"type": "text", "text": "...", "annotations": [...]}` - Text with citations/annotations (Responses API)
+- `{"type": "image", "source": {...}}` - Images (multiple source formats: base64, URL, etc.)
- `{"type": "tool_use", "id": "...", "name": "...", "input": {...}}` - Tool calls
- `{"type": "tool_result", ...}` - Tool execution results
+- `{"type": "reasoning", ...}` - Reasoning content (advanced models)
+- `{"type": "audio", ...}` - Audio input/output (multimodal)
+
+**Conversion responsibilities:**
+
+1. **Input (messages → provider format)**:
+ - Map LangChain message types to provider roles (HumanMessage → "user", AIMessage → "assistant", etc.)
+ - Convert unified content blocks to provider-specific formats
+ - Handle tool calls and structured output schemas
+ - Preserve special annotations and extras (e.g., prompt caching, reasoning parameters)
+
+2. **Output (provider response → AIMessage)**:
+ - Parse provider-specific response format (JSON, streaming chunks, tool results)
+ - Map provider content types to unified blocks
+ - Extract and normalize tool calls into `ToolCall` objects
+ - Populate `usage_metadata` (input/output token counts)
+ - Store provider-specific metadata in `response_metadata`
**Example: Message conversion (Anthropic reference):**
-The Anthropic provider converts LangChain messages to Anthropic's format (reference: `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L1-L100`):
+The Anthropic provider converts both input and output (reference: `repo://libs/partners/anthropic/langchain_anthropic/chat_models.py#L1-L150`):
```python
def _convert_messages_to_provider_format(
@@ -326,6 +373,79 @@ def _convert_messages_to_provider_format(
return provider_messages
```
+### Converting Provider Response Format to Unified Messages
+
+After receiving a response from the provider API, convert it back to LangChain's unified `AIMessage` format. This is the reverse direction of message conversion.
+
+**Key conversion steps:**
+
+1. **Parse provider response** - Extract choices/outputs from provider-specific format
+2. **Create unified content blocks** - Map provider content types to LangChain blocks
+3. **Handle tool calls** - Parse provider tool results into `ToolCall` objects
+4. **Populate metadata** - Capture usage info and provider-specific response metadata
+5. **Create AIMessage** - Construct the output message with all components
+
+**Example: OpenAI response conversion** (reference: `repo://libs/partners/openai/langchain_openai/chat_models/base.py#L217-L282`):
+
+```python
+from langchain_core.messages import AIMessage, UsageMetadata
+from langchain_core.output_parsers.openai_tools import parse_tool_call, make_invalid_tool_call
+
+def _convert_response_to_message(self, response: dict) -> AIMessage:
+ """Convert provider API response to AIMessage."""
+ # Parse the response choice (provider-specific format)
+ choice = response["choices"][0]
+ message_data = choice["message"]
+
+ # Extract content, tool calls, and metadata
+ content = message_data.get("content", "")
+
+ # Convert tool calls from provider format to LangChain ToolCall
+ tool_calls = []
+ invalid_tool_calls = []
+ if "tool_calls" in message_data:
+ for raw_tc in message_data["tool_calls"]:
+ try:
+ # Parse provider tool call into ToolCall
+ tool_calls.append(parse_tool_call(raw_tc, return_id=True))
+ except Exception as e:
+ # Store malformed tool calls for inspection
+ invalid_tool_calls.append(
+ make_invalid_tool_call(raw_tc, str(e))
+ )
+
+ # Extract usage metadata (normalize across providers)
+ usage_metadata = {}
+ if "usage" in response:
+ usage_metadata = {
+ "input_tokens": response["usage"].get("prompt_tokens", 0),
+ "output_tokens": response["usage"].get("completion_tokens", 0),
+ }
+
+ # Build response metadata with provider-specific fields
+ response_metadata = {
+ "model_name": response.get("model"),
+ "finish_reason": choice.get("finish_reason"),
+ }
+
+ # Create unified AIMessage
+ return AIMessage(
+ content=content,
+ tool_calls=tool_calls,
+ invalid_tool_calls=invalid_tool_calls,
+ usage_metadata=UsageMetadata(**usage_metadata) if usage_metadata else None,
+ response_metadata=response_metadata,
+ )
+```
+
+**Handling provider-specific response fields:**
+
+Some providers return additional fields not in the standard format. Store these in `response_metadata`:
+
+- OpenAI: `model_name`, `service_tier`, `incomplete_details` (Responses API), `id` (response ID)
+- Anthropic: `stop_reason`, `usage`, `content` (structured blocks)
+- Custom fields: Any provider-specific data the application may need
+
## 3. Streaming Architecture
### Stream Implementation Pattern
@@ -625,6 +745,104 @@ The standard test suite validates:
- **Callbacks**: Token counting, error handling
- **Model profile**: Presence and validity
+### Advanced API Testing (Optional)
+
+If your provider supports advanced response modes (e.g., OpenAI's Responses API), create additional test classes for those modes:
+
+**Example: Responses API unit tests** (reference: `repo://libs/partners/openai/tests/unit_tests/chat_models/test_responses_standard.py`):
+
+```python
+"""Standard tests with Responses API enabled."""
+
+from langchain_core.language_models import BaseChatModel
+from langchain_tests.unit_tests import ChatModelUnitTests
+
+from langchain_provider_name import ChatProviderModel
+
+
+class TestProviderModelResponsesAPI(ChatModelUnitTests):
+ """Standard tests using the advanced Responses API mode."""
+
+ @property
+ def chat_model_class(self) -> type[BaseChatModel]:
+ return ChatProviderModel
+
+ @property
+ def chat_model_params(self) -> dict:
+ """Enable advanced API mode and any special configuration."""
+ return {
+ "model": "model-123",
+ "use_responses_api": True, # or provider-specific equivalent
+ "stream_usage": True, # Common for advanced modes
+ }
+```
+
+Integration tests for advanced modes should verify:
+- Response format compatibility (content blocks, tool outputs, etc.)
+- Streaming with structured output preserved
+- Tool execution in the advanced format
+- Incomplete/truncated responses (if applicable)
+
+## 8. Advanced API Modes and Response Formats
+
+### Responses API (Provider-Specific Advanced Feature)
+
+Some providers (e.g., OpenAI) offer advanced response APIs alongside standard chat completions. These APIs typically support enhanced features like streaming tool execution, reasoning outputs, and structured response formats.
+
+**Example: OpenAI Responses API** (reference: `/openwiki/openai-provider.md`, `repo://libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py`):
+
+The `ChatOpenAI` provider supports an optional `use_responses_api` parameter to switch between the Chat Completions API and the Responses API:
+
+```python
+from langchain_openai import ChatOpenAI
+
+# Standard Chat Completions API (default)
+model = ChatOpenAI(model="gpt-4o-mini")
+
+# Advanced Responses API (for streaming, reasoning models, etc.)
+model = ChatOpenAI(
+ model="gpt-4o",
+ use_responses_api=True,
+ reasoning={"effort": "medium"}, # Reasoning support
+ include=["web_search_call.results"], # Include tool outputs
+)
+
+# Invoke the model
+response = model.invoke("What is the capital of France?")
+# Returns AIMessage with structured content including reasoning, tool calls
+```
+
+**Key differences in Responses API:**
+
+1. **Response format**: Returns structured content blocks (text, reasoning, tool calls, web_search_calls, etc.) rather than plain text
+2. **Message content**: `response.content` is a list of blocks with `type`, `id`, and metadata
+3. **Streaming behavior**: Streaming yields partial blocks; final aggregation preserves structure
+4. **Tool execution**: Tool calls and results are handled as content blocks
+5. **Output format versions**: Use `output_version="responses/v1"` to control parsing
+
+**Message conversion for Responses API:**
+
+Provider implementations must convert Responses API output (which includes tool execution results, reasoning, and other structured items) back to unified `AIMessage` format. The OpenAI provider uses `_convert_from_v1_to_responses()` (reference: `repo://libs/partners/openai/langchain_openai/chat_models/_compat.py#L420-L514`) to translate content blocks:
+
+```python
+# Responses API returns:
+{
+ "type": "text",
+ "text": "Paris is the capital of France",
+ "annotations": [{"type": "web_search", "title": "..."}],
+ "id": "msg_123"
+}
+
+# Converted to unified AIMessage content block:
+{
+ "type": "text",
+ "text": "Paris is the capital of France",
+ "annotations": [{"type": "web_search", "title": "..."}]
+}
+```
+
+**Recommendation**: Responses API support is optional and provider-specific. Implement it only if your provider's SDK supports it. For reference implementations, see OpenAI's `ChatOpenAI.use_responses_api` and corresponding test fixtures in `test_responses_standard.py`.
+
## 8. Error Handling
Map provider-specific exceptions to LangChain's unified exception hierarchy (reference: `repo://libs/core/langchain_core/exceptions.py`):
diff --git a/openwiki/quickstart.md b/openwiki/quickstart.md
index 4591ea8fbd..9cae8bd42d 100644
--- a/openwiki/quickstart.md
+++ b/openwiki/quickstart.md
@@ -40,10 +40,10 @@ sources:
resource: repo://libs/partners/openai/langchain_openai/__init__.py
- id: openwiki-source-48ce5ee900993294d349b4e8
resource: repo://libs/standard-tests/langchain_tests/__init__.py
-generated: { by: "openwiki/0.5.0", at: "2026-09-03T15:18:34.589Z" }
+generated: { by: "openwiki/0.5.0", at: "2026-09-09T08:26:28.144Z" }
verified:
- by: openwiki/0.5.0
- at: 2026-09-08T08:27:09.597Z
+ at: 2026-09-09T08:26:28.144Z
---
## Welcome to LangChain Development
@@ -71,9 +71,11 @@ LangChain is organized as a **three-layer architecture** in `/libs/`:
| Layer | Edit when you are... | Key files |
|-------|----------------------|-----------|
-| **core** | Adding or modifying base abstractions, core interfaces (Runnable, BaseChatModel, messages, tools, prompts), or callbacks. | `libs/core/langchain_core/` |
-| **langchain_v1** | Building agent factory features, middleware, model initialization, chat model selection, or high-level orchestration. | `libs/langchain_v1/langchain/agents/`, `libs/langchain_v1/langchain/chat_models/` |
-| **partners/{name}** | Adding a new LLM provider (OpenAI, Anthropic, etc.), model-specific features, or provider integrations. | `libs/partners/{provider}/` |
+| **core** | Adding or modifying base abstractions and core interfaces: `Runnable`, `BaseChatModel`, messages, tools, prompts, callbacks, output parsers. | `libs/core/langchain_core/` |
+| **langchain_v1** | Building agent factory features (`create_agent`), middleware composition, model initialization (`init_chat_model`), or high-level orchestration. | `libs/langchain_v1/langchain/agents/factory.py`, `libs/langchain_v1/langchain/chat_models/base.py` |
+| **partners/{name}** | Adding a new LLM provider (OpenAI, Anthropic, etc.), implementing `ChatModel`, handling message conversion, or adding provider-specific features (streaming, tool calling, structured output). | `libs/partners/{provider}/langchain_{provider}/chat_models/base.py` |
+| **standard-tests** | Defining reusable test suites and test fixtures for evaluating chat models, embeddings, and tools across all providers. | `libs/standard-tests/langchain_tests/` |
+| **model-profiles** | Publishing model metadata, capability profiles, context windows, and supported features for discovery by `init_chat_model`. | `libs/model-profiles/langchain_model_profiles/` |
## Installation & Setup
@@ -198,6 +200,7 @@ Use the table below to route to detailed documentation:
|------|-----------|--------------|
| **Build an agent** | [Agent Factory](/openwiki/agent-factory.md) | create_agent, AgentState, middleware composition, graph execution |
| **Add a new LLM provider** | [Adding a Chat Model Provider](/openwiki/partner-pattern.md) | ChatModel impl, message conversion, provider registration, standard tests |
+| **Integrate OpenAI (ChatGPT, o1, etc.)** | [OpenAI Integration](/openwiki/openai-provider.md) | ChatOpenAI, Responses API, vision, streaming, tool calling, Azure |
| **Understand the architecture** | [Architecture Overview](/openwiki/architecture.md) | Three-layer design, dependency flow, core vs. orchestration vs. partners |
| **Work with chat models** | [Chat Model Interface](/openwiki/chat-models.md) | BaseChatModel protocol, streaming, tool binding, structured output |
| **Initialize models dynamically** | [Model Initialization](/openwiki/model-initialization.md) | init_chat_model factory, provider:model syntax, fallback chains |
@@ -272,7 +275,7 @@ langchain_v1/
**partners/** — Provider integrations
```
partners/
-├── openai/ # ChatOpenAI, embeddings
+├── openai/ # ChatOpenAI (Chat Completions & Responses APIs), embeddings
├── anthropic/ # ChatAnthropic (Claude)
├── ollama/ # ChatOllama (local models)
├── groq/ # ChatGroq
@@ -298,6 +301,8 @@ provider/
└── uv.lock
```
+Some providers (like OpenAI) support advanced API modes—see [OpenAI Integration](/openwiki/openai-provider.md) for details on the Responses API and streaming with structured output.
+
## Your First PR: A Workflow
### 1. Pick a Task
@@ -335,12 +340,19 @@ All checks must pass before pushing.
### 6. Commit and Push
+Follow [Conventional Commits](https://www.conventionalcommits.org/) format with scope (required):
+
```bash
git add .
-git commit -m "Brief description of change"
+# Format: type(scope): description
+# Example: feat(core): add streaming support to BaseChatModel
+# Example: fix(openai): handle timeout errors gracefully
+git commit -m "type(scope): description"
git push origin your-branch
```
+See [CLAUDE.md](repo://CLAUDE.md) for commit conventions and branch naming (`<username>/<scope>/<description>`).
+
Pre-commit hooks will run automatically. If they fail, fix and commit again.
### 7. Open a Pull Request