From a602dff8443c845872899f071c7029f89c45a438 Mon Sep 17 00:00:00 2001 From: CI-DEV <154627941+IlumCI@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:54:08 +0300 Subject: [PATCH] Update model_router.py --- swarms/structs/model_router.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/swarms/structs/model_router.py b/swarms/structs/model_router.py index 32015e4a..e2668697 100644 --- a/swarms/structs/model_router.py +++ b/swarms/structs/model_router.py @@ -4,7 +4,6 @@ from concurrent.futures import ThreadPoolExecutor from typing import Optional from pydantic import BaseModel, Field -from swarms.utils.function_caller_model import OpenAIFunctionCaller from swarms.utils.any_to_str import any_to_str from swarms.utils.formatter import formatter from swarms.utils.litellm_wrapper import LiteLLM @@ -174,7 +173,7 @@ class ModelRouter: temperature (float): Temperature parameter for model randomness max_workers (int): Maximum concurrent workers for batch processing model_output (ModelOutput): Pydantic model for structured outputs - model_caller (OpenAIFunctionCaller): Function calling interface + model_caller (LiteLLM): Function calling interface """ def __init__( @@ -210,11 +209,11 @@ class ModelRouter: if self.max_workers == "auto": self.max_workers = os.cpu_count() - self.model_caller = OpenAIFunctionCaller( - base_model=ModelOutput, + self.model_caller = LiteLLM( + model_name="gpt-4o", + response_format=ModelOutput, temperature=self.temperature, system_prompt=self.system_prompt, - api_key=api_key, ) except Exception as e: raise RuntimeError(