mirror of
https://github.com/MIDORIBIN/langchain-gpt4free.git
synced 2025-03-21 01:33:51 +03:00
fix: suppoer g4f v0.0.2
This commit is contained in:
parent
1bdad4b922
commit
a6da9a5d5f
@ -1,18 +1,16 @@
|
|||||||
from types import ModuleType
|
|
||||||
from typing import Any, List, Mapping, Optional, Union
|
from typing import Any, List, Mapping, Optional, Union
|
||||||
|
|
||||||
from g4f import ChatCompletion
|
from g4f import ChatCompletion
|
||||||
from g4f.models import Model
|
from g4f.models import Model
|
||||||
|
from g4f.Provider.base_provider import BaseProvider
|
||||||
from langchain.callbacks.manager import CallbackManagerForLLMRun
|
from langchain.callbacks.manager import CallbackManagerForLLMRun
|
||||||
from langchain.llms.base import LLM
|
from langchain.llms.base import LLM
|
||||||
from langchain.llms.utils import enforce_stop_tokens
|
from langchain.llms.utils import enforce_stop_tokens
|
||||||
|
|
||||||
|
|
||||||
class G4FLLM(LLM):
|
class G4FLLM(LLM):
|
||||||
# Model.model or str
|
|
||||||
model: Union[Model, str]
|
model: Union[Model, str]
|
||||||
# Provider.Provider
|
provider: Optional[type[BaseProvider]] = None
|
||||||
provider: Optional[ModuleType] = None
|
|
||||||
auth: Optional[Union[str, bool]] = None
|
auth: Optional[Union[str, bool]] = None
|
||||||
create_kwargs: Optional[dict[str, Any]] = None
|
create_kwargs: Optional[dict[str, Any]] = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user