mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
commit
0cf99c47d4
2 changed files with 7 additions and 12 deletions
|
|
@ -105,7 +105,6 @@ class LunaryLogger:
|
|||
end_time=datetime.now(timezone.utc),
|
||||
error=None,
|
||||
):
|
||||
# Method definition
|
||||
try:
|
||||
print_verbose(f"Lunary Logging - Logging request for model {model}")
|
||||
|
||||
|
|
@ -114,10 +113,9 @@ class LunaryLogger:
|
|||
metadata = litellm_params.get("metadata", {}) or {}
|
||||
|
||||
if optional_params:
|
||||
# merge into extra
|
||||
extra = {**extra, **optional_params}
|
||||
|
||||
tags = litellm_params.pop("tags", None) or []
|
||||
tags = metadata.get("tags", None)
|
||||
|
||||
if extra:
|
||||
extra.pop("extra_body", None)
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ def test_lunary_logging():
|
|||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
# test_lunary_logging()
|
||||
test_lunary_logging()
|
||||
|
||||
|
||||
def test_lunary_template():
|
||||
|
|
@ -38,8 +37,7 @@ def test_lunary_template():
|
|||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
# test_lunary_template()
|
||||
test_lunary_template()
|
||||
|
||||
|
||||
def test_lunary_logging_with_metadata():
|
||||
|
|
@ -52,16 +50,16 @@ def test_lunary_logging_with_metadata():
|
|||
metadata={
|
||||
"run_name": "litellmRUN",
|
||||
"project_name": "litellm-completion",
|
||||
"tags": ["tag1", "tag2"]
|
||||
},
|
||||
)
|
||||
print(response)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
#test_lunary_logging_with_metadata()
|
||||
test_lunary_logging_with_metadata()
|
||||
|
||||
def test_lunary_with_tools():
|
||||
|
||||
import litellm
|
||||
|
||||
messages = [{"role": "user", "content": "What's the weather like in San Francisco, Tokyo, and Paris?"}]
|
||||
|
|
@ -97,7 +95,7 @@ def test_lunary_with_tools():
|
|||
print("\nLLM Response:\n", response.choices[0].message)
|
||||
|
||||
|
||||
#test_lunary_with_tools()
|
||||
test_lunary_with_tools()
|
||||
|
||||
def test_lunary_logging_with_streaming_and_metadata():
|
||||
try:
|
||||
|
|
@ -117,5 +115,4 @@ def test_lunary_logging_with_streaming_and_metadata():
|
|||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
# test_lunary_logging_with_streaming_and_metadata()
|
||||
test_lunary_logging_with_streaming_and_metadata()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue