Skip to content

Commit

Permalink
to_pydantic_2
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Sep 4, 2024
1 parent d50d09e commit f4e15bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/partners/robocorp/langchain_robocorp/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dataclasses import dataclass
from typing import Any, Dict, List, Set, Tuple, Union, cast

from langchain_core.pydantic_v1 import (
from pydantic import (
BaseModel,
Field,
create_model,
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,7 +13,7 @@
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 pydantic 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
Expand All @@ -27,6 +27,8 @@
from langchain_robocorp._prompts import (
API_CONTROLLER_PROMPT,
)
from pydantic import ConfigDict


LLM_TRACE_HEADER = "X-action-trace"

Expand Down Expand Up @@ -110,8 +112,7 @@ 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

0 comments on commit f4e15bd

Please sign in to comment.