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

Add metadata field to all OpenAI API request structs #866

Open
youssefsiam38 opened this issue Sep 30, 2024 · 0 comments
Open

Add metadata field to all OpenAI API request structs #866

youssefsiam38 opened this issue Sep 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@youssefsiam38
Copy link

Is your feature request related to a problem? Please describe.

As LLM use grows, so does the need for tracing, debugging, and testing. The feature request is to attach custom metadata to API requests for logging, tracing, or tool integration. The current go-openai library lacks a standardized way to include this metadata in request structs.

Describe the solution you'd like

Add a Metadata field of type map[string]interface{} to all structs representing request bodies for OpenAI APIs. For example:

ChatCompletionRequest struct {
    // ... existing fields ...
    Metadata map[string]interface{} `json:"metadata,omitempty"`
}

Apply this change consistently across all relevant request structs.

Additional context

This feature would align go-openai with other OpenAI libraries and tools that support metadata, such as LiteLLM proxy, enabling easier integration with logging and tracing systems.

@youssefsiam38 youssefsiam38 added the enhancement New feature or request label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant