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

#266: removing omitempty from response definition #267

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pkg/api/schemas/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ func NewChatFromStr(message string) *ChatRequest {

// ChatResponse defines Glide's Chat Response Schema unified across all language models
type ChatResponse struct {
ID string `json:"id,omitempty"`
Created int `json:"created_at,omitempty"`
Provider string `json:"provider_id,omitempty"`
RouterID string `json:"router_id,omitempty"`
ModelID string `json:"model_id,omitempty"`
ModelName string `json:"model_name,omitempty"`
Cached bool `json:"cached,omitempty"`
ModelResponse ModelResponse `json:"model_response,omitempty"`
ID string `json:"id"`
Created int `json:"created_at"`
Provider string `json:"provider_id"`
RouterID string `json:"router_id"`
ModelID string `json:"model_id"`
ModelName string `json:"model_name"`
Cached bool `json:"cached"`
ModelResponse ModelResponse `json:"model_response"`
}

// ModelResponse is the unified response from the provider.

type ModelResponse struct {
Metadata map[string]string `json:"metadata,omitempty"`
Metadata map[string]string `json:"metadata"`
Message ChatMessage `json:"message"`
TokenUsage TokenUsage `json:"token_usage"`
}
Expand Down
Loading