Changes some parameters for mypy linting compatibility
This commit is contained in:
parent
08c2542416
commit
534cf7c1a6
1 changed files with 8 additions and 7 deletions
|
|
@ -102,20 +102,20 @@ class ChatLiteLLMComponent(CustomComponent):
|
||||||
model_kwargs: Optional[Dict[str, Any]] = {},
|
model_kwargs: Optional[Dict[str, Any]] = {},
|
||||||
top_p: Optional[float] = None,
|
top_p: Optional[float] = None,
|
||||||
top_k: Optional[int] = None,
|
top_k: Optional[int] = None,
|
||||||
n: Optional[int] = 1,
|
n: int = 1,
|
||||||
max_tokens: Optional[int] = 256,
|
max_tokens: int = 256,
|
||||||
max_retries: Optional[int] = 6,
|
max_retries: int = 6,
|
||||||
verbose: Optional[bool] = False,
|
verbose: bool = False,
|
||||||
) -> Union[BaseLanguageModel, Callable]:
|
) -> Union[BaseLanguageModel, Callable]:
|
||||||
try:
|
try:
|
||||||
import litellm
|
import litellm
|
||||||
|
litellm.drop_params=True
|
||||||
|
litellm.set_verbose=verbose
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ChatLiteLLMException(
|
raise ChatLiteLLMException(
|
||||||
"Could not import litellm python package. "
|
"Could not import litellm python package. "
|
||||||
"Please install it with `pip install litellm`"
|
"Please install it with `pip install litellm`"
|
||||||
)
|
)
|
||||||
litellm.drop_params=True
|
|
||||||
litellm.set_verbose=verbose
|
|
||||||
if api_key:
|
if api_key:
|
||||||
if "perplexity" in model:
|
if "perplexity" in model:
|
||||||
os.environ["PERPLEXITYAI_API_KEY"] = api_key
|
os.environ["PERPLEXITYAI_API_KEY"] = api_key
|
||||||
|
|
@ -124,9 +124,10 @@ class ChatLiteLLMComponent(CustomComponent):
|
||||||
|
|
||||||
LLM = ChatLiteLLM(
|
LLM = ChatLiteLLM(
|
||||||
model=model,
|
model=model,
|
||||||
|
client=None,
|
||||||
streaming=streaming,
|
streaming=streaming,
|
||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
model_kwargs=model_kwargs,
|
model_kwargs=model_kwargs if model_kwargs is not None else {},
|
||||||
top_p=top_p,
|
top_p=top_p,
|
||||||
top_k=top_k,
|
top_k=top_k,
|
||||||
n=n,
|
n=n,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue