langchain-community[major]: Upgrade community to pydantic 2 (#26011)

This PR upgrades langchain-community to pydantic 2.


* Most of this PR was auto-generated using code mods with gritql
(https://github.com/eyurtsev/migrate-pydantic/tree/main)
* Subsequently, some code was fixed manually due to accommodate
differences between pydantic 1 and 2

Breaking Changes:

- Use TEXTEMBED_API_KEY and TEXTEMBEB_API_URL for env variables for text
embed integrations:
cbea780492

Other changes:

- Added pydantic_settings as a required dependency for community. This
may be removed if we have enough time to convert the dependency into an
optional one.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
Harrison Chase
2024-09-05 11:07:10 -07:00
committed by GitHub
parent 1ad66e70dc
commit 8516a03a02
569 changed files with 2442 additions and 2330 deletions

View File

@@ -5,7 +5,7 @@ from typing import Any, List
import requests
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, Field
from pydantic import BaseModel, Field
API_URL = "https://api.bookend.ai/"
DEFAULT_TASK = "embeddings"