From a6da9a5d5f56827174620498c82bc16efad257c7 Mon Sep 17 00:00:00 2001 From: MIDORIBIN Date: Fri, 18 Aug 2023 21:22:22 +0900 Subject: [PATCH] fix: suppoer g4f v0.0.2 --- langchain_g4f/G4FLLM.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/langchain_g4f/G4FLLM.py b/langchain_g4f/G4FLLM.py index 3544d63..7e62453 100644 --- a/langchain_g4f/G4FLLM.py +++ b/langchain_g4f/G4FLLM.py @@ -1,18 +1,16 @@ -from types import ModuleType from typing import Any, List, Mapping, Optional, Union from g4f import ChatCompletion from g4f.models import Model +from g4f.Provider.base_provider import BaseProvider from langchain.callbacks.manager import CallbackManagerForLLMRun from langchain.llms.base import LLM from langchain.llms.utils import enforce_stop_tokens class G4FLLM(LLM): - # Model.model or str model: Union[Model, str] - # Provider.Provider - provider: Optional[ModuleType] = None + provider: Optional[type[BaseProvider]] = None auth: Optional[Union[str, bool]] = None create_kwargs: Optional[dict[str, Any]] = None