mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-09 23:12:38 +00:00
huggingface[patch], pinecone[patch], fireworks[patch], mistralai[patch], voyageai[patch], togetherai[path]: convert Pydantic extras to literals (#25384)
Backwards compatible change that converts pydantic extras to literals which is consistent with pydantic 2 usage. - fireworks - voyage ai - mistralai - mistral ai - together ai - huggigng face - pinecone
This commit is contained in:
@@ -7,7 +7,6 @@ from typing import Any, Iterator, List, Mapping, Optional
|
||||
from langchain_core.callbacks import CallbackManagerForLLMRun
|
||||
from langchain_core.language_models.llms import BaseLLM
|
||||
from langchain_core.outputs import Generation, GenerationChunk, LLMResult
|
||||
from langchain_core.pydantic_v1 import Extra
|
||||
|
||||
DEFAULT_MODEL_ID = "gpt2"
|
||||
DEFAULT_TASK = "text-generation"
|
||||
@@ -67,7 +66,7 @@ class HuggingFacePipeline(BaseLLM):
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
extra = "forbid"
|
||||
|
||||
@classmethod
|
||||
def from_model_id(
|
||||
|
Reference in New Issue
Block a user