[BREAKING_CHANGES] refactor: change metadata type from map[string]string to map[string]any - #944
Open
anilmisirlioglu wants to merge 1 commit into
Open
[BREAKING_CHANGES] refactor: change metadata type from map[string]string to map[string]any#944anilmisirlioglu wants to merge 1 commit into
anilmisirlioglu wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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 Harness. 🚀 New features to boost your workflow:
|
|
Hi @anilmisirlioglu, the OpenAI description for this field may have changed since you opened the PR. Looking at it now it says: https://platform.openai.com/docs/api-reference/chat/create#chat-create-metadata
Unless I've misunderstood which metadata field this is then it looks like the keys and values both need to be strings. Are you saying that Litellm and Langfuse uses non-strings successfully for these fields? |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Describe the change
We use Litellm and Langfuse and I realized that the
map[string]stringdata 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 typemap[string]anyfor more complex data types. There is no statement in the OpenAI document stating that metadata must be of typemap[string]stringProvide 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
ChatCompletionRequestandModifyMessagetomap[string]anyTests
I ran the tests locally.
Issue: -