langchain-cli[patch]: Update to work with langchain 0.3 (#26403)

Update to work with pydantic 2 / langchain 0.3
This commit is contained in:
Eugene Yurtsev
2024-09-12 16:51:28 -04:00
committed by GitHub
parent 41a632a2ae
commit 85f673c7ea
2 changed files with 4 additions and 4 deletions

View File

@@ -116,7 +116,7 @@ class Chat__ModuleName__(BaseChatModel):
Tool calling: Tool calling:
.. code-block:: python .. code-block:: python
from langchain_core.pydantic_v1 import BaseModel, Field from pydantic import BaseModel, Field
class GetWeather(BaseModel): class GetWeather(BaseModel):
'''Get the current weather in a given location''' '''Get the current weather in a given location'''
@@ -144,7 +144,7 @@ class Chat__ModuleName__(BaseChatModel):
from typing import Optional from typing import Optional
from langchain_core.pydantic_v1 import BaseModel, Field from pydantic import BaseModel, Field
class Joke(BaseModel): class Joke(BaseModel):
'''Joke to tell user.''' '''Joke to tell user.'''

View File

@@ -5,8 +5,8 @@ from typing import Optional, Type
from langchain_core.callbacks import ( from langchain_core.callbacks import (
CallbackManagerForToolRun, CallbackManagerForToolRun,
) )
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.tools import BaseTool from langchain_core.tools import BaseTool
from pydantic import BaseModel
class __ModuleName__Input(BaseModel): class __ModuleName__Input(BaseModel):
@@ -62,7 +62,7 @@ class __ModuleName__Tool(BaseTool):
.. code-block:: python .. code-block:: python
# TODO: output of invocation # TODO: output of invocation
""" # noqa: E501 """ # noqa: E501
# TODO: Set tool name and description # TODO: Set tool name and description
name: str = "TODO: Tool name" name: str = "TODO: Tool name"