Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion backend/onyx/llm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,16 @@ def get_llm_contextual_cost(
)
except Exception:
logger.exception(
f"An unexpected error occurred while calculating cost for model {llm.config.model_name} (potentially due to malformed name). Assuming cost is 0."
"An unexpected error occurred while calculating cost for model "
f"{llm.config.model_name} (potentially due to malformed name). "
"Assuming cost is 0."
)
return 0

# Costs are in USD dollars per million tokens
return usd_per_prompt + usd_per_completion


def get_llm_max_tokens(
model_map: dict,
model_name: str,
Expand Down
Loading