Skip to content

Commit

Permalink
robocorp[major]: upgrade pydantic (#26062)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme authored Sep 4, 2024
1 parent 9379613 commit 923ce84
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 42 deletions.
6 changes: 3 additions & 3 deletions libs/partners/robocorp/langchain_robocorp/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from dataclasses import dataclass
from typing import Any, Dict, List, Set, Tuple, Union, cast

from langchain_core.pydantic_v1 import (
from langchain_core.utils.json_schema import dereference_refs
from langchain_core.utils.pydantic import is_basemodel_instance
from pydantic import (
BaseModel,
Field,
create_model,
)
from langchain_core.utils.json_schema import dereference_refs
from langchain_core.utils.pydantic import is_basemodel_instance


@dataclass(frozen=True)
Expand Down
7 changes: 4 additions & 3 deletions libs/partners/robocorp/langchain_robocorp/toolkits.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import PromptTemplate
from langchain_core.pydantic_v1 import BaseModel, Field, PrivateAttr, create_model
from langchain_core.runnables import Runnable, RunnablePassthrough
from langchain_core.tools import BaseTool, StructuredTool, Tool
from langchain_core.tracers.context import _tracing_v2_is_enabled
from langsmith import Client
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr, create_model

from langchain_robocorp._common import (
get_param_fields,
Expand Down Expand Up @@ -110,8 +110,9 @@ class ActionServerToolkit(BaseModel):
"""Enable reporting Langsmith trace to Action Server runs"""
_run_details: dict = PrivateAttr({})

class Config:
arbitrary_types_allowed = True
model_config = ConfigDict(
arbitrary_types_allowed=True,
)

def get_tools(
self,
Expand Down
14 changes: 6 additions & 8 deletions libs/partners/robocorp/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion libs/partners/robocorp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ disallow_untyped_defs = "True"
"Source Code" = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/robocorp"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
python = ">=3.9,<4.0"
langchain-core = ">=0.2.24,<0.3"
requests = "^2.31.0"
types-requests = "^2.31.0.6"
pydantic = ">=2,<3"

[tool.ruff.lint]
select = [ "E", "F", "I", "T201",]
Expand Down
27 changes: 0 additions & 27 deletions libs/partners/robocorp/scripts/check_pydantic.sh

This file was deleted.

0 comments on commit 923ce84

Please sign in to comment.