forked from phoenix/litellm-mirror
* Update lago.py to accomodate API change (#5495) external_customer_id is deprecated. external_subscription_id is the replacement. * fix(lago.py): fixes \ --------- Co-authored-by: Raymond Weitekamp <19483938+rawwerks@users.noreply.github.com>
This commit is contained in:
parent
0d99a9697f
commit
bc20879c23
2 changed files with 4 additions and 2 deletions
|
@ -23,7 +23,7 @@ Bill internal teams for their usage
|
||||||
Set 'lago' as a callback on your proxy config.yaml
|
Set 'lago' as a callback on your proxy config.yaml
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
model_name:
|
model_list:
|
||||||
- model_name: fake-openai-endpoint
|
- model_name: fake-openai-endpoint
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: openai/fake
|
model: openai/fake
|
||||||
|
|
|
@ -114,7 +114,7 @@ class LagoLogger(CustomLogger):
|
||||||
returned_val = {
|
returned_val = {
|
||||||
"event": {
|
"event": {
|
||||||
"transaction_id": str(uuid.uuid4()),
|
"transaction_id": str(uuid.uuid4()),
|
||||||
"external_customer_id": external_customer_id,
|
"external_subscription_id": external_customer_id,
|
||||||
"code": os.getenv("LAGO_API_EVENT_CODE"),
|
"code": os.getenv("LAGO_API_EVENT_CODE"),
|
||||||
"properties": {"model": model, "response_cost": cost, **usage},
|
"properties": {"model": model, "response_cost": cost, **usage},
|
||||||
}
|
}
|
||||||
|
@ -189,6 +189,8 @@ class LagoLogger(CustomLogger):
|
||||||
)
|
)
|
||||||
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
|
verbose_logger.debug(f"Logged Lago Object: {response.text}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if response is not None and hasattr(response, "text"):
|
if response is not None and hasattr(response, "text"):
|
||||||
litellm.print_verbose(f"\nError Message: {response.text}")
|
litellm.print_verbose(f"\nError Message: {response.text}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue