Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChatMetrics ¶
type ChatMetrics struct { Duration time.Duration Usage *sdk.CompletionUsage }
ChatMetrics holds timing and token usage information
type ChatRequest ¶
type ChatRequest struct { Model string `json:"model"` Messages []ChatMessage `json:"messages"` Stream bool `json:"stream,omitempty"` }
ChatRequest represents a chat completion request
type ChatResponse ¶
type ChatResponse struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Model string `json:"model"` Choices []struct { Index int `json:"index"` Message struct { Role string `json:"role"` Content string `json:"content"` } `json:"message"` FinishReason string `json:"finish_reason"` } `json:"choices"` Usage struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` } `json:"usage"` }
ChatResponse represents a chat completion response
type Model ¶
type Model struct { ID string `json:"id"` Object string `json:"object,omitempty"` Created int64 `json:"created,omitempty"` OwnedBy string `json:"owned_by,omitempty"` Root string `json:"root,omitempty"` Parent string `json:"parent,omitempty"` MetaData map[string]string `json:"metadata,omitempty"` }
Model represents a model returned from the inference gateway
type ModelsResponse ¶
ModelsResponse represents the response from /v1/models endpoint
Click to show internal directories.
Click to hide internal directories.