diff --git a/pyproject.toml b/pyproject.toml index 4813eef3..e54e09e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ell-ai" -version = "0.0.7" +version = "0.0.9" description = "ell - the language model programming library" authors = ["William Guss "] license = "MIT" diff --git a/src/ell/lmp/_track.py b/src/ell/lmp/_track.py index 4614bc37..4d2ef43a 100644 --- a/src/ell/lmp/_track.py +++ b/src/ell/lmp/_track.py @@ -119,8 +119,8 @@ def tracked_func(*fn_args, _get_invocation_id=False, **fn_kwargs) -> str: ) latency_ms = (utc_now() - _start_time).total_seconds() * 1000 usage = metadata.get("usage", {"prompt_tokens": 0, "completion_tokens": 0}) - prompt_tokens= usage.get("prompt_tokens", 0) - completion_tokens= usage.get("completion_tokens", 0) + prompt_tokens= usage.get("prompt_tokens", 0) if usage else 0 + completion_tokens= usage.get("completion_tokens", 0) if usage else 0 #XXX: cattrs add invocation origin here recursively on all pirmitive types within a message.