-
Notifications
You must be signed in to change notification settings - Fork 16
Description
I got the following error while trying to use ChatOCIGentAI with langchain 1.0 deepagent
Exception has occurred: PydanticInvalidForJsonSchema
Cannot generate a JsonSchema for core_schema.CallableSchema
For further information visit https://errors.pydantic.dev/2.12/u/invalid-for-json-schema
File "C:\Users\opc\langgraph-test\src\agent\graph.py", line 24, in
result = agent.invoke({"messages": [{"role": "human", "content": "Tell me a joke about oracle stock price"}]})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.CallableSchema
For further information visit https://errors.pydantic.dev/2.12/u/invalid-for-json-schema
code to reproduce the error
from typing import Literal
from deepagents import create_deep_agent
from langchain_oci import ChatOCIGenAI
oci = ChatOCIGenAI(
model_id="meta.llama-3.3-70b-instruct",
service_endpoint="https://inference.generativeai.sa-saopaulo-1.oci.oraclecloud.com",
compartment_id="ocid1.compartment.oc1..*******",
auth_type="INSTANCE_PRINCIPAL",
is_stream=True,
model_kwargs={"temperature": 0},
)
#works fine
result = oci.invoke("Hello, world!")
agent = create_deep_agent(
model=oci,
)
triggers exception
result = agent.invoke({"messages": [{"role": "human", "content": "Tell me a joke about oracle stock price"}]})
Print the agent's response
print(result["messages"][-1].content)