From dd188b5f4d9c734e80f46133bf99306813906061 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Mon, 29 Jul 2024 13:54:42 -0700 Subject: [PATCH] fix t_llm_request is unbounded problem (#657) --- skyvern/forge/sdk/api/llm/api_handler_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skyvern/forge/sdk/api/llm/api_handler_factory.py b/skyvern/forge/sdk/api/llm/api_handler_factory.py index 7b23deb1..a7eb87d6 100644 --- a/skyvern/forge/sdk/api/llm/api_handler_factory.py +++ b/skyvern/forge/sdk/api/llm/api_handler_factory.py @@ -190,12 +190,12 @@ class LLMAPIHandlerFactory: } ).encode("utf-8"), ) + t_llm_request = time.perf_counter() try: # TODO (kerem): add a timeout to this call # TODO (kerem): add a retry mechanism to this call (acompletion_with_retries) # TODO (kerem): use litellm fallbacks? https://litellm.vercel.app/docs/tutorials/fallbacks#how-does-completion_with_fallbacks-work LOG.info("Calling LLM API", llm_key=llm_key, model=llm_config.model_name) - t_llm_request = time.perf_counter() response = await litellm.acompletion( model=llm_config.model_name, messages=messages,