langchain-ai
langchain
BlogDocsChangelog

fix(core): preserve Field(description=...) in @tool decorator

#34354
Comparing
edlsh:fix/tool-field-description-34247
(
bb604cb
) with
master
(
1a3cd46
)
CodSpeed Performance Gauge
-2%
Untouched
13
Skipped
21

Benchmarks

Skipped (21)

Passed

test_async_callbacks_in_sync
libs/core/tests/benchmarks/test_async_callbacks.py
CodSpeed Performance Gauge
-1%
24.7 ms*25 ms
test_import_time[tool]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-1%
514.9 ms*521.7 ms
test_import_time[BaseChatModel]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-1%
525.8 ms*532.8 ms
test_import_time[RunnableLambda]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-1%
486.3 ms*493.2 ms
test_import_time[InMemoryVectorStore]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-1%
609.7 ms*618.7 ms
test_import_time[CallbackManager]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-2%
455.4 ms*462.8 ms
test_import_time[ChatPromptTemplate]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-2%
593.7 ms*603.5 ms
test_import_time[HumanMessage]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-2%
261.8 ms*266.4 ms
test_import_time[PydanticOutputParser]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-2%
527 ms*537.9 ms
test_import_time[Runnable]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-2%
484 ms*495.3 ms
test_import_time[InMemoryRateLimiter]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-2%
172.7 ms*177.1 ms
test_import_time[LangChainTracer]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-3%
435.2 ms*446.8 ms
test_import_time[Document]
libs/core/tests/benchmarks/test_imports.py
CodSpeed Performance Gauge
-3%
184.9 ms*190.3 ms

Commits

Click on a commit to change the comparison range
Base
master
1a3cd46
-1.82%
fix(core): preserve Field(description=...) in @tool decorator When using Annotated[type, Field(description='...')] syntax with the @tool decorator, the field descriptions were being lost during schema generation. This fix extends _get_annotation_description() to also check for FieldInfo objects and extract their description attribute. Fixes #34247
bb604cb
3 days ago
by edlsh
© 2025 CodSpeed Technology
Home Terms Privacy Docs