-
Notifications
You must be signed in to change notification settings - Fork 492
Open
Description
When I run compare_embeddings.py, this error occur:
pydantic.errors.PydanticUserError: The __modify_schema__ method is not supported in Pydantic v2. Use __get_pydantic_json_schema__ instead in class SecretStr.
For further information visit https://errors.pydantic.dev/2.11/u/custom-json-schema
I even comment the code below and the error still occur:
# Load environment variables. Assumes that project contains .env file with API keys
load_dotenv()
#---- Set OpenAI API key
# Change environment variable name from "OPENAI_API_KEY" to the name given in
# your .env file.
openai.api_key = os.environ['OPENAI_API_KEY']
Should I use other package or change my code?
My version:
langchain: 0.3.26
langchain-community==0.2.3
unstructured==0.14.4
chromadb>=0.5.0
pydantic: 2.11.7
Also, i usefrom langchain_ollama import OllamaEmbeddingsinstead of from langchain_openai import OpenAIEmbeddings
Metadata
Metadata
Assignees
Labels
No labels