Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan committed Sep 3, 2024
1 parent 5f5287c commit 6777106
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions libs/partners/openai/langchain_openai/chat_models/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class AzureChatOpenAI(BaseChatOpenAI):
Tool calling:
.. code-block:: python
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
class GetWeather(BaseModel):
Expand Down Expand Up @@ -306,7 +306,7 @@ class GetPopulation(BaseModel):
from typing import Optional
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
class Joke(BaseModel):
Expand Down Expand Up @@ -733,7 +733,7 @@ def with_structured_output(
from typing import Optional
from langchain_openai import AzureChatOpenAI
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
class AnswerWithJustification(BaseModel):
Expand Down Expand Up @@ -764,7 +764,7 @@ class AnswerWithJustification(BaseModel):
.. code-block:: python
from langchain_openai import AzureChatOpenAI
from langchain_core.pydantic_v1 import BaseModel
from pydantic import BaseModel
class AnswerWithJustification(BaseModel):
Expand Down Expand Up @@ -851,7 +851,7 @@ class AnswerWithJustification(TypedDict):
.. code-block::
from langchain_openai import AzureChatOpenAI
from langchain_core.pydantic_v1 import BaseModel
from pydantic import BaseModel
class AnswerWithJustification(BaseModel):
answer: str
Expand Down
10 changes: 5 additions & 5 deletions libs/partners/openai/langchain_openai/chat_models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def with_structured_output(
from typing import Optional
from langchain_openai import ChatOpenAI
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
class AnswerWithJustification(BaseModel):
Expand Down Expand Up @@ -1221,7 +1221,7 @@ class AnswerWithJustification(BaseModel):
.. code-block:: python
from langchain_openai import ChatOpenAI
from langchain_core.pydantic_v1 import BaseModel
from pydantic import BaseModel
class AnswerWithJustification(BaseModel):
Expand Down Expand Up @@ -1311,7 +1311,7 @@ class AnswerWithJustification(TypedDict):
.. code-block::
from langchain_openai import ChatOpenAI
from langchain_core.pydantic_v1 import BaseModel
from pydantic import BaseModel
class AnswerWithJustification(BaseModel):
answer: str
Expand Down Expand Up @@ -1613,7 +1613,7 @@ class ChatOpenAI(BaseChatOpenAI):
.. code-block:: python
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
class GetWeather(BaseModel):
Expand Down Expand Up @@ -1699,7 +1699,7 @@ class GetPopulation(BaseModel):
from typing import Optional
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
class Joke(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions libs/partners/openai/scripts/check_pydantic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ result=$(git -C "$repository_path" grep -E '^import pydantic|^from pydantic')
if [ -n "$result" ]; then
echo "ERROR: The following lines need to be updated:"
echo "$result"
echo "Please replace the code with an import from langchain_core.pydantic_v1."
echo "Please replace the code with an import from pydantic."
echo "For example, replace 'from pydantic import BaseModel'"
echo "with 'from langchain_core.pydantic_v1 import BaseModel'"
echo "with 'from pydantic import BaseModel'"
exit 1
fi

0 comments on commit 6777106

Please sign in to comment.