Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions backend/onyx/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
from onyx.db.connector import check_connectors_exist
from onyx.db.document import check_docs_exist
from onyx.db.models import LLMProvider
from onyx.llm.utils import get_model_map, _find_model_obj
from onyx.natural_language_processing.utils import BaseTokenizer
from onyx.tools.tool import Tool


OPEN_AI_TOOL_CALLING_MODELS = {
"gpt-3.5-turbo",
"gpt-4-turbo",
"gpt-4",
"gpt-4o",
"gpt-4o-mini",
}


def explicit_tool_calling_supported(model_provider: str, model_name: str) -> bool:
return model_provider == "openai" and model_name in OPEN_AI_TOOL_CALLING_MODELS
model_map = get_model_map()
model_obj = _find_model_obj(
model_map=model_map,
provider=model_provider,
model_name=model_name,
)

return model_obj.get("supports_function_calling", False) if model_obj else False


def compute_tool_tokens(tool: Tool, llm_tokenizer: BaseTokenizer) -> int:
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ langchainhub==0.1.21
langgraph==0.2.72
langgraph-checkpoint==2.0.13
langgraph-sdk==0.1.44
litellm==1.66.3
litellm==1.69.0
lxml==5.3.0
lxml_html_clean==0.2.2
llama-index==0.12.28
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements/model_server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ torch==2.6.0
transformers==4.49.0
uvicorn==0.21.1
voyageai==0.2.3
litellm==1.66.3
litellm==1.69.0
sentry-sdk[fastapi,celery,starlette]==2.14.0
aioboto3==14.0.0
prometheus_fastapi_instrumentator==7.1.0
Loading