test_builtin_tools_text_editor() — langchain Function Reference
Architecture documentation for the test_builtin_tools_text_editor() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b83a7814_8b0a_75ce_1158_d7bb68e5dad2["test_builtin_tools_text_editor()"] f27640dd_3870_5548_d153_f9504ae1021f["test_chat_models.py"] b83a7814_8b0a_75ce_1158_d7bb68e5dad2 -->|defined in| f27640dd_3870_5548_d153_f9504ae1021f style b83a7814_8b0a_75ce_1158_d7bb68e5dad2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/integration_tests/test_chat_models.py lines 567–582
def test_builtin_tools_text_editor() -> None:
llm = ChatAnthropic(model="claude-sonnet-4-5-20250929") # type: ignore[call-arg]
tool = {"type": "text_editor_20250728", "name": "str_replace_based_edit_tool"}
llm_with_tools = llm.bind_tools([tool])
response = llm_with_tools.invoke(
"There's a syntax error in my primes.py file. Can you help me fix it?",
)
assert isinstance(response, AIMessage)
assert response.tool_calls
content_blocks = response.content_blocks
assert len(content_blocks) == 2
assert content_blocks[0]["type"] == "text"
assert content_blocks[0]["text"]
assert content_blocks[1]["type"] == "tool_call"
assert content_blocks[1]["name"] == "str_replace_based_edit_tool"
Domain
Subdomains
Source
Frequently Asked Questions
What does test_builtin_tools_text_editor() do?
test_builtin_tools_text_editor() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py.
Where is test_builtin_tools_text_editor() defined?
test_builtin_tools_text_editor() is defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py at line 567.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free