File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 6
6
from onyx .db .connector import check_connectors_exist
7
7
from onyx .db .document import check_docs_exist
8
8
from onyx .db .models import LLMProvider
9
+ from onyx .llm .utils import get_model_map , _find_model_obj
9
10
from onyx .natural_language_processing .utils import BaseTokenizer
10
11
from onyx .tools .tool import Tool
11
12
12
13
13
- OPEN_AI_TOOL_CALLING_MODELS = {
14
- "gpt-3.5-turbo" ,
15
- "gpt-4-turbo" ,
16
- "gpt-4" ,
17
- "gpt-4o" ,
18
- "gpt-4o-mini" ,
19
- }
20
-
21
-
22
14
def explicit_tool_calling_supported (model_provider : str , model_name : str ) -> bool :
23
- return model_provider == "openai" and model_name in OPEN_AI_TOOL_CALLING_MODELS
15
+ model_map = get_model_map ()
16
+ model_obj = _find_model_obj (
17
+ model_map = model_map ,
18
+ provider = model_provider ,
19
+ model_name = model_name ,
20
+ )
21
+
22
+ return model_obj .get ("supports_function_calling" , False ) if model_obj else False
24
23
25
24
26
25
def compute_tool_tokens (tool : Tool , llm_tokenizer : BaseTokenizer ) -> int :
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ langchainhub==0.1.21
39
39
langgraph==0.2.72
40
40
langgraph-checkpoint==2.0.13
41
41
langgraph-sdk==0.1.44
42
- litellm==1.66.3
42
+ litellm==1.69.0
43
43
lxml==5.3.0
44
44
lxml_html_clean==0.2.2
45
45
llama-index==0.12.28
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ torch==2.6.0
14
14
transformers==4.49.0
15
15
uvicorn==0.21.1
16
16
voyageai==0.2.3
17
- litellm==1.66.3
17
+ litellm==1.69.0
18
18
sentry-sdk[fastapi,celery,starlette]==2.14.0
19
19
aioboto3==14.0.0
20
20
prometheus_fastapi_instrumentator==7.1.0
You can’t perform that action at this time.
0 commit comments