You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using LiteLLMInstrumentor, you cannot use the Message objects provided by LiteLLM.
You have to use dictionaries.
This is unfortunate since we use the Message objects extensively.
To Reproduce
fromphoenix.otelimportregisterimportlitellmfromopeninference.instrumentation.litellmimportLiteLLMInstrumentor# Setup tracer providertracer_provider=register(
project_name="test",
endpoint="http://localhost:6006/v1/traces",
)
# Setup LiteLLM prebuilt instrumentLiteLLMInstrumentor().instrument(tracer_provider=tracer_provider)
# This worksmodel_response=litellm.completion(model='anthropic/claude-3-haiku-20240307',
messages=[{'role':'user', 'content':'hello'}])
# This throws an exception: "Object of type Message is not JSON serializable"model_response=litellm.completion(model='anthropic/claude-3-haiku-20240307',
messages=[litellm.Message(role='user', content='hello'])
Expected behavior
Calling litellm methods with litellm.Message objects and getting traces without exceptions.
Desktop
OS: Windows
Version openinference-instrumentation-litellm==0.1.11
The text was updated successfully, but these errors were encountered:
Describe the bug
When using LiteLLMInstrumentor, you cannot use the Message objects provided by LiteLLM.
You have to use dictionaries.
This is unfortunate since we use the Message objects extensively.
To Reproduce
Expected behavior
Calling litellm methods with litellm.Message objects and getting traces without exceptions.
Desktop
The text was updated successfully, but these errors were encountered: