Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING_CHANGES] refactor: change metadata type from map[string]string to map[string]any #944

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anilmisirlioglu
Copy link

Describe the change
We use Litellm and Langfuse and I realized that the map[string]string data type in the metadata field is insufficient to pass some trace fields (e.g. tags, trace_metadata) from the metadata. It is possible to make metadata type map[string]any for more complex data types. There is no statement in the OpenAI document stating that metadata must be of type map[string]string

Provide OpenAI documentation link
Litellm Langfuse Integration
OpenAI Metadata -> Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Describe your solution
I changed the type of the metadata field in ChatCompletionRequest and ModifyMessage to map[string]any

Tests
I ran the tests locally.

Issue: -

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.88%. Comparing base (774fc9d) to head (37e834c).
Report is 87 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #944      +/-   ##
==========================================
+ Coverage   98.46%   98.88%   +0.41%     
==========================================
  Files          24       27       +3     
  Lines        1364     1786     +422     
==========================================
+ Hits         1343     1766     +423     
+ Misses         15       14       -1     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant