Skip to content

Commit 3f0f631

Browse files
fix: add explanatory warning for missing internal_reasonning price
Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com>
1 parent b3a77c0 commit 3f0f631

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

wdoc/utils/misc.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ def get_model_price(model: ModelName) -> Dict[str, Union[float, int]]:
656656
logger.error(
657657
f"Found non 0 request for {model}, this is not supported by wdoc so the price will not be accurate"
658658
)
659+
if not "internal_reasoning" in pricing:
660+
logger.warning(
661+
f"Warning: no 'internal_reasoning' price found for model '{model.original}'. Setting it to 0 but this might make price estimation wrong. Detected pricing: '{pricing}'"
662+
)
663+
pricing["internal_reasoning"] = 0
659664
return pricing
660665

661666
for key in ["original", "model", "sanitized"]:
@@ -674,6 +679,11 @@ def get_model_price(model: ModelName) -> Dict[str, Union[float, int]]:
674679
for k, v in pricing.items():
675680
if k not in output:
676681
output[k] = v
682+
if not "internal_reasoning" in output:
683+
logger.warning(
684+
f"Warning: no 'internal_reasoning' price found for model '{mod}'. Setting it to 0 but this might make price estimation wrong. Detected pricing: '{output}'"
685+
)
686+
output["internal_reasoning"] = 0
677687
return output
678688
raise Exception(
679689
f"Can't find the price of '{model}'\nUpdate litellm or set WDOC_ALLOW_NO_PRICE=True if you still want to use this model."

0 commit comments

Comments
 (0)