From 5243a689a10a1f89c5671fd43b31cefce43bcdf8 Mon Sep 17 00:00:00 2001 From: William Guss Date: Mon, 23 Sep 2024 14:52:54 -0700 Subject: [PATCH] v0.0.9 --- pyproject.toml | 2 +- src/ell/lmp/_track.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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.