forked from phoenix/litellm-mirror
support langfuse tags feature
This commit is contained in:
parent
5d59fa166c
commit
b640ec4dc0
3 changed files with 749 additions and 630 deletions
|
@ -230,6 +230,10 @@ class LangFuseLogger:
|
|||
|
||||
print_verbose(f"Langfuse Layer Logging - logging to langfuse v2 ")
|
||||
|
||||
if supports_tags:
|
||||
metadata_tags = metadata["tags"]
|
||||
tags = metadata_tags
|
||||
|
||||
generation_name = metadata.get("generation_name", None)
|
||||
if generation_name is None:
|
||||
# just log `litellm-{call_type}` as the generation name
|
||||
|
@ -274,8 +278,7 @@ class LangFuseLogger:
|
|||
"prompt_tokens": response_obj["usage"]["prompt_tokens"],
|
||||
"completion_tokens": response_obj["usage"]["completion_tokens"],
|
||||
"total_cost": cost if supports_costs else None,
|
||||
}
|
||||
|
||||
}
|
||||
generation_params = {
|
||||
"name": generation_name,
|
||||
"id": metadata.get("generation_id", generation_id),
|
||||
|
|
1370
poetry.lock
generated
1370
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,7 @@ license = "MIT"
|
|||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8.1,<3.9.7 || >3.9.7"
|
||||
python = ">=3.8.1,<4.0, !=3.9.7"
|
||||
openai = ">=1.0.0"
|
||||
python-dotenv = ">=0.2.0"
|
||||
tiktoken = ">=0.4.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue