File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
python/pathway/xpacks/llm Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def wrapper(*args, **kwargs):
4949 return func
5050
5151
52- def _check_model_accepts_arg (model_name : str , provider : str , arg : str ):
52+ def _check_model_accepts_arg (model_name : str , provider : str | None , arg : str ):
5353 from litellm import get_supported_openai_params
5454
5555 supported_params = (
Original file line number Diff line number Diff line change @@ -442,10 +442,14 @@ def _accepts_call_arg(self, arg_name: str) -> bool:
442442 if self .model is None :
443443 return False
444444
445- provider = self .model .split ("/" )[0 ]
446- model = "" .join (
447- self .model .split ("/" )[1 :]
448- ) # handle case: replicate/meta/meta-llama-3-8b
445+ if "/" in self .model :
446+ provider = self .model .split ("/" )[0 ]
447+ model = "" .join (
448+ self .model .split ("/" )[1 :]
449+ ) # handle case: replicate/meta/meta-llama-3-8b
450+ else :
451+ model = self .model
452+ provider = None
449453 return _check_model_accepts_arg (model , provider , arg_name )
450454
451455
Original file line number Diff line number Diff line change @@ -97,12 +97,12 @@ def test_openai_call_args(model, call_arg):
9797 [
9898 "claude-3-5-sonnet-20240620" ,
9999 "claude-3-opus-20240229" ,
100- "antrophic /claude-3-5-sonnet-20240620" ,
100+ "anthropic /claude-3-5-sonnet-20240620" ,
101101 None ,
102102 ],
103103)
104104@pytest .mark .parametrize ("call_arg" , [* VALID_ARGS , * INVALID_ARGS ])
105- def test_antrophic_call_args (model , call_arg ):
105+ def test_anthropic_call_args (model , call_arg ):
106106 llm = llms .LiteLLMChat (model = model )
107107
108108 if model is None :
You can’t perform that action at this time.
0 commit comments