Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
refactor gemini reasoning effor (#3292)
LawyZhenge0043d002ce3
diff --git a/skyvern/config.py b/skyvern/config.pyindex 7176b67c8..d826bda59 100644--- a/skyvern/config.py+++ b/skyvern/config.py@@ -245,7 +245,8 @@ class Settings(BaseSettings):# GEMINIGEMINI_API_KEY: str | None = None- GEMINI_REASONING_EFFORT: str | None = None+ GEMINI_INCLUDE_THOUGHT: bool = False+ GEMINI_THINKING_BUDGET: int | None = None# VERTEX_AIVERTEX_CREDENTIALS: str | None = Nonediff --git a/skyvern/forge/sdk/api/llm/config_registry.py b/skyvern/forge/sdk/api/llm/config_registry.pyindex 8b3ce2f3e..44d155f69 100644--- a/skyvern/forge/sdk/api/llm/config_registry.py+++ b/skyvern/forge/sdk/api/llm/config_registry.py@@ -787,7 +787,12 @@ if settings.ENABLE_GEMINI:supports_vision=True,add_assistant_prefix=False,max_completion_tokens=65536,- reasoning_effort=settings.GEMINI_REASONING_EFFORT,+ litellm_params=LiteLLMParams(+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },+ ),),)LLMConfigRegistry.register_config(@@ -798,7 +803,12 @@ if settings.ENABLE_GEMINI:supports_vision=True,add_assistant_prefix=False,max_completion_tokens=65536,- reasoning_effort=settings.GEMINI_REASONING_EFFORT,+ litellm_params=LiteLLMParams(+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },+ ),),)LLMConfigRegistry.register_config(@@ -809,7 +819,12 @@ if settings.ENABLE_GEMINI:supports_vision=True,add_assistant_prefix=False,max_completion_tokens=65536,- reasoning_effort=settings.GEMINI_REASONING_EFFORT,+ litellm_params=LiteLLMParams(+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },+ ),),)LLMConfigRegistry.register_config(@@ -820,7 +835,12 @@ if settings.ENABLE_GEMINI:supports_vision=True,add_assistant_prefix=False,max_completion_tokens=65536,- reasoning_effort=settings.GEMINI_REASONING_EFFORT,+ litellm_params=LiteLLMParams(+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },+ ),),)LLMConfigRegistry.register_config(@@ -831,7 +851,12 @@ if settings.ENABLE_GEMINI:supports_vision=True,add_assistant_prefix=False,max_completion_tokens=65536,- reasoning_effort=settings.GEMINI_REASONING_EFFORT,+ litellm_params=LiteLLMParams(+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },+ ),),)@@ -1027,8 +1052,11 @@ if settings.ENABLE_VERTEX_AI and settings.VERTEX_CREDENTIALS:vertex_credentials=settings.VERTEX_CREDENTIALS,api_base=f"{api_base}/gemini-2.5-pro" if api_base else None,vertex_location=settings.VERTEX_LOCATION,+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },),- reasoning_effort=settings.GEMINI_REASONING_EFFORT,),)LLMConfigRegistry.register_config(@@ -1043,8 +1071,11 @@ if settings.ENABLE_VERTEX_AI and settings.VERTEX_CREDENTIALS:vertex_credentials=settings.VERTEX_CREDENTIALS,api_base=f"{api_base}/gemini-2.5-pro-preview-05-06" if api_base else None,vertex_location=settings.VERTEX_LOCATION,+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },),- reasoning_effort=settings.GEMINI_REASONING_EFFORT,),)LLMConfigRegistry.register_config(@@ -1059,8 +1090,11 @@ if settings.ENABLE_VERTEX_AI and settings.VERTEX_CREDENTIALS:vertex_credentials=settings.VERTEX_CREDENTIALS,api_base=f"{api_base}/gemini-2.5-flash" if api_base else None,vertex_location=settings.VERTEX_LOCATION,+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },),- reasoning_effort=settings.GEMINI_REASONING_EFFORT,),)LLMConfigRegistry.register_config(@@ -1075,8 +1109,11 @@ if settings.ENABLE_VERTEX_AI and settings.VERTEX_CREDENTIALS:vertex_credentials=settings.VERTEX_CREDENTIALS,api_base=f"{api_base}/gemini-2.5-flash-preview-05-20" if api_base else None,vertex_location=settings.VERTEX_LOCATION,+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },),- reasoning_effort=settings.GEMINI_REASONING_EFFORT,),)LLMConfigRegistry.register_config(@@ -1091,8 +1128,11 @@ if settings.ENABLE_VERTEX_AI and settings.VERTEX_CREDENTIALS:vertex_credentials=settings.VERTEX_CREDENTIALS,api_base=f"{api_base}/gemini-2.5-flash-preview-04-17" if api_base else None,vertex_location=settings.VERTEX_LOCATION,+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },),- reasoning_effort=settings.GEMINI_REASONING_EFFORT,),)LLMConfigRegistry.register_config(@@ -1107,8 +1147,11 @@ if settings.ENABLE_VERTEX_AI and settings.VERTEX_CREDENTIALS:vertex_credentials=settings.VERTEX_CREDENTIALS,api_base=f"{api_base}/gemini-2.5-flash-preview-05-20" if api_base else None,vertex_location=settings.VERTEX_LOCATION,+ thinking={+ "budget_tokens": settings.GEMINI_THINKING_BUDGET,+ "type": "enabled" if settings.GEMINI_INCLUDE_THOUGHT else None,+ },),- reasoning_effort=settings.GEMINI_REASONING_EFFORT,),)LLMConfigRegistry.register_config(diff --git a/skyvern/forge/sdk/api/llm/models.py b/skyvern/forge/sdk/api/llm/models.pyindex 9d231c2a5..1e4ff6ad3 100644--- a/skyvern/forge/sdk/api/llm/models.py+++ b/skyvern/forge/sdk/api/llm/models.py@@ -16,6 +16,7 @@ class LiteLLMParams(TypedDict, total=False):model_info: dict[str, Any] | Nonevertex_credentials: str | Nonevertex_location: str | None+ thinking: dict[str, Any] | None@dataclass(frozen=True)