langchain/libs/core/langchain_core/runnables
ccurme 888fbc07b5
core[patch]: support passing args_schema through as_tool (#24269)
Note: this allows the schema to be passed in positionally.

```python
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.runnables import RunnableLambda


class Add(BaseModel):
    """Add two integers together."""

    a: int = Field(..., description="First integer")
    b: int = Field(..., description="Second integer")


def add(input: dict) -> int:
    return input["a"] + input["b"]


runnable = RunnableLambda(add)
as_tool = runnable.as_tool(Add)
as_tool.args_schema.schema()
```
```
{'title': 'Add',
 'description': 'Add two integers together.',
 'type': 'object',
 'properties': {'a': {'title': 'A',
   'description': 'First integer',
   'type': 'integer'},
  'b': {'title': 'B', 'description': 'Second integer', 'type': 'integer'}},
 'required': ['a', 'b']}
```
2024-07-15 07:51:05 -07:00
..
__init__.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
base.py core[patch]: support passing args_schema through as_tool (#24269) 2024-07-15 07:51:05 -07:00
branch.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
config.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
configurable.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
fallbacks.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
graph_ascii.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
graph_mermaid.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
graph_png.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
graph.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
history.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
learnable.py [Enhancement] Add support for directly providing a run_id (#18990) 2024-03-18 15:03:04 -07:00
passthrough.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
retry.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
router.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
schema.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00
utils.py core[patch]: docstrings runnables update (#24161) 2024-07-12 11:27:06 -04:00