mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 14:26:48 +00:00
langchain[patch]: docstring update (#26242)
This commit is contained in:
@@ -93,7 +93,7 @@ def create_openai_fn_chain(
|
|||||||
from langchain_community.chat_models import ChatOpenAI
|
from langchain_community.chat_models import ChatOpenAI
|
||||||
from langchain_core.prompts import ChatPromptTemplate
|
from langchain_core.prompts import ChatPromptTemplate
|
||||||
|
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
|
||||||
class RecordPerson(BaseModel):
|
class RecordPerson(BaseModel):
|
||||||
@@ -183,7 +183,7 @@ def create_structured_output_chain(
|
|||||||
from langchain_community.chat_models import ChatOpenAI
|
from langchain_community.chat_models import ChatOpenAI
|
||||||
from langchain_core.prompts import ChatPromptTemplate
|
from langchain_core.prompts import ChatPromptTemplate
|
||||||
|
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
class Dog(BaseModel):
|
class Dog(BaseModel):
|
||||||
\"\"\"Identifying information about a dog.\"\"\"
|
\"\"\"Identifying information about a dog.\"\"\"
|
||||||
|
@@ -61,7 +61,7 @@ Passage:
|
|||||||
removal="1.0",
|
removal="1.0",
|
||||||
alternative=(
|
alternative=(
|
||||||
"""
|
"""
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from langchain_anthropic import ChatAnthropic
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
class Joke(BaseModel):
|
class Joke(BaseModel):
|
||||||
@@ -131,7 +131,7 @@ def create_extraction_chain(
|
|||||||
removal="1.0",
|
removal="1.0",
|
||||||
alternative=(
|
alternative=(
|
||||||
"""
|
"""
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from langchain_anthropic import ChatAnthropic
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
class Joke(BaseModel):
|
class Joke(BaseModel):
|
||||||
|
@@ -130,7 +130,7 @@ def create_tagging_chain_pydantic(
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from langchain_anthropic import ChatAnthropic
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
class Joke(BaseModel):
|
class Joke(BaseModel):
|
||||||
|
@@ -32,7 +32,7 @@ If a property is not present and is not required in the function parameters, do
|
|||||||
removal="1.0",
|
removal="1.0",
|
||||||
alternative=(
|
alternative=(
|
||||||
"""
|
"""
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from langchain_anthropic import ChatAnthropic
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
class Joke(BaseModel):
|
class Joke(BaseModel):
|
||||||
|
@@ -44,7 +44,7 @@ from pydantic import BaseModel
|
|||||||
removal="1.0",
|
removal="1.0",
|
||||||
alternative=(
|
alternative=(
|
||||||
"""
|
"""
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from langchain_anthropic import ChatAnthropic
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
class Joke(BaseModel):
|
class Joke(BaseModel):
|
||||||
@@ -108,7 +108,7 @@ def create_openai_fn_runnable(
|
|||||||
|
|
||||||
from langchain.chains.structured_output import create_openai_fn_runnable
|
from langchain.chains.structured_output import create_openai_fn_runnable
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
|
||||||
class RecordPerson(BaseModel):
|
class RecordPerson(BaseModel):
|
||||||
@@ -162,7 +162,7 @@ def create_openai_fn_runnable(
|
|||||||
removal="1.0",
|
removal="1.0",
|
||||||
alternative=(
|
alternative=(
|
||||||
"""
|
"""
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from langchain_anthropic import ChatAnthropic
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
class Joke(BaseModel):
|
class Joke(BaseModel):
|
||||||
@@ -237,7 +237,7 @@ def create_structured_output_runnable(
|
|||||||
|
|
||||||
from langchain.chains import create_structured_output_runnable
|
from langchain.chains import create_structured_output_runnable
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
|
||||||
class RecordDog(BaseModel):
|
class RecordDog(BaseModel):
|
||||||
@@ -318,7 +318,7 @@ def create_structured_output_runnable(
|
|||||||
|
|
||||||
from langchain.chains import create_structured_output_runnable
|
from langchain.chains import create_structured_output_runnable
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
class Dog(BaseModel):
|
class Dog(BaseModel):
|
||||||
'''Identifying information about a dog.'''
|
'''Identifying information about a dog.'''
|
||||||
@@ -340,7 +340,7 @@ def create_structured_output_runnable(
|
|||||||
from langchain.chains import create_structured_output_runnable
|
from langchain.chains import create_structured_output_runnable
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_core.prompts import ChatPromptTemplate
|
from langchain_core.prompts import ChatPromptTemplate
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
class Dog(BaseModel):
|
class Dog(BaseModel):
|
||||||
'''Identifying information about a dog.'''
|
'''Identifying information about a dog.'''
|
||||||
@@ -366,7 +366,7 @@ def create_structured_output_runnable(
|
|||||||
from langchain.chains import create_structured_output_runnable
|
from langchain.chains import create_structured_output_runnable
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_core.prompts import ChatPromptTemplate
|
from langchain_core.prompts import ChatPromptTemplate
|
||||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
class Dog(BaseModel):
|
class Dog(BaseModel):
|
||||||
'''Identifying information about a dog.'''
|
'''Identifying information about a dog.'''
|
||||||
|
@@ -241,7 +241,7 @@ def init_chat_model(
|
|||||||
|
|
||||||
# pip install langchain langchain-openai langchain-anthropic
|
# pip install langchain langchain-openai langchain-anthropic
|
||||||
from langchain.chat_models import init_chat_model
|
from langchain.chat_models import init_chat_model
|
||||||
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'''
|
||||||
|
Reference in New Issue
Block a user