Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
fix cannot access local variable 'prompt_tokens' where it is not associated with a value (#3286)
Shuchang Zhengb9470ffb443f
diff --git a/skyvern/forge/sdk/api/llm/api_handler_factory.py b/skyvern/forge/sdk/api/llm/api_handler_factory.pyindex 95762bac4..a87a75729 100644--- a/skyvern/forge/sdk/api/llm/api_handler_factory.py+++ b/skyvern/forge/sdk/api/llm/api_handler_factory.py@@ -198,6 +198,13 @@ class LLMAPIHandlerFactory:thought=thought,ai_suggestion=ai_suggestion,)+ prompt_tokens = 0+ completion_tokens = 0+ reasoning_tokens = 0+ cached_tokens = 0+ completion_token_detail = None+ cached_token_detail = None+ llm_cost = 0if step or thought:try:# FIXME: volcengine doesn't support litellm cost calculation.