Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
shu/remove max completion tokens for ollama (#2300)
Shuchang Zheng349e506dc13c
diff --git a/skyvern/forge/sdk/api/llm/api_handler_factory.py b/skyvern/forge/sdk/api/llm/api_handler_factory.pyindex f546b062d..6ef25dfb7 100644--- a/skyvern/forge/sdk/api/llm/api_handler_factory.py+++ b/skyvern/forge/sdk/api/llm/api_handler_factory.py@@ -430,10 +430,12 @@ class LLMAPIHandlerFactory:@staticmethoddef get_api_parameters(llm_config: LLMConfig | LLMRouterConfig) -> dict[str, Any]:params: dict[str, Any] = {}- if llm_config.max_completion_tokens is not None:- params["max_completion_tokens"] = llm_config.max_completion_tokens- elif llm_config.max_tokens is not None:- params["max_tokens"] = llm_config.max_tokens+ if not llm_config.model_name.startswith("ollama/"):+ # OLLAMA does not support max_completion_tokens+ if llm_config.max_completion_tokens is not None:+ params["max_completion_tokens"] = llm_config.max_completion_tokens+ elif llm_config.max_tokens is not None:+ params["max_tokens"] = llm_config.max_tokensif llm_config.temperature is not None:params["temperature"] = llm_config.temperaturediff --git a/skyvern/forge/sdk/api/llm/config_registry.py b/skyvern/forge/sdk/api/llm/config_registry.pyindex 3fcfec7e9..2eb4b6e00 100644--- a/skyvern/forge/sdk/api/llm/config_registry.py+++ b/skyvern/forge/sdk/api/llm/config_registry.py@@ -815,7 +815,6 @@ if settings.ENABLE_OLLAMA:["OLLAMA_SERVER_URL", "OLLAMA_MODEL"],supports_vision=False, # Ollama does not support vision yetadd_assistant_prefix=False,- max_completion_tokens=settings.LLM_CONFIG_MAX_TOKENS,litellm_params=LiteLLMParams(api_base=settings.OLLAMA_SERVER_URL,api_key=None,