Skip to content

Commit

Permalink
Use perf-counter instead of time (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykeremy authored Jul 25, 2024
1 parent 5000f3d commit 20a611a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions skyvern/forge/sdk/api/llm/api_handler_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ async def llm_api_handler(
# 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.time()
t_llm_request = time.perf_counter()
response = await litellm.acompletion(
model=llm_config.model_name,
messages=messages,
Expand All @@ -206,7 +206,7 @@ async def llm_api_handler(
except openai.OpenAIError as e:
raise LLMProviderError(llm_key) from e
except CancelledError:
t_llm_cancelled = time.time()
t_llm_cancelled = time.perf_counter()
LOG.error(
"LLM request got cancelled",
llm_key=llm_key,
Expand Down

0 comments on commit 20a611a

Please sign in to comment.