Documentation
¶
Index ¶
- func New(envConfig *config.EnvConfig) (*http.Server, error)
- func Run(envConfig *config.EnvConfig) error
- type AddModelRequest
- type AvailableModel
- type AvailableModelListResponse
- type BackupResponse
- type BulkFileRequest
- type BulkFileResponse
- type ChatCompletionChoice
- type ChatCompletionRequest
- type ChatCompletionResponse
- type ChatDelta
- type ChatMessage
- type ConfiguredModel
- type ConfiguredModelListResponse
- type ContentPart
- type EnvironmentRequest
- type EnvironmentResponse
- type ErrorResponse
- type FileInfo
- type FileRequest
- type FileResponse
- type FileResult
- type FileUploadResponse
- type GenerateRequest
- type GenerateResponse
- type HealthResponse
- type ListResponse
- type ModelInfo
- type ModelListResponse
- type OpenAIError
- type OpenAIErrorDetail
- type ProcessResponse
- type ProviderInfo
- type ProviderListResponse
- type ProviderRequest
- type RestoreRequest
- type Server
- type SuccessResponse
- type UpdateModelRequest
- type UsageInfo
- type YAMLRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddModelRequest ¶ added in v0.0.24
type AddModelRequest struct {
Name string `json:"name"`
Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}
AddModelRequest is the request body for adding a model to a provider's configuration
type AvailableModel ¶ added in v0.0.24
type AvailableModel struct {
Name string `json:"name"`
Description string `json:"description,omitempty"` // Optional description if available
}
AvailableModel represents a model available from the provider's service
type AvailableModelListResponse ¶ added in v0.0.24
type AvailableModelListResponse struct {
Success bool `json:"success"`
Models []AvailableModel `json:"models"`
Error string `json:"error,omitempty"`
}
AvailableModelListResponse is the response for listing available models from a provider
type BackupResponse ¶ added in v0.0.8
type BackupResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Filename string `json:"filename,omitempty"`
}
BackupResponse represents a response for backup operations
type BulkFileRequest ¶ added in v0.0.8
type BulkFileRequest struct {
Files []FileRequest `json:"files"`
}
BulkFileRequest represents a request for bulk file operations
type BulkFileResponse ¶ added in v0.0.8
type BulkFileResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Results []FileResult `json:"results,omitempty"`
}
BulkFileResponse represents a response for bulk file operations
type ChatCompletionChoice ¶ added in v0.0.84
type ChatCompletionChoice struct {
Index int `json:"index"`
Message *ChatMessage `json:"message,omitempty"`
Delta *ChatDelta `json:"delta,omitempty"`
FinishReason *string `json:"finish_reason"`
}
ChatCompletionChoice represents a single completion choice
type ChatCompletionRequest ¶ added in v0.0.84
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
Stream bool `json:"stream,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
MaxTokens *int `json:"max_tokens,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
PresencePenalty *float64 `json:"presence_penalty,omitempty"`
Stop []string `json:"stop,omitempty"`
User string `json:"user,omitempty"`
}
ChatCompletionRequest represents the OpenAI chat completion request
type ChatCompletionResponse ¶ added in v0.0.84
type ChatCompletionResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []ChatCompletionChoice `json:"choices"`
Usage UsageInfo `json:"usage"`
}
ChatCompletionResponse represents the non-streaming response
type ChatDelta ¶ added in v0.0.84
type ChatDelta struct {
Role string `json:"role,omitempty"`
Content string `json:"content,omitempty"`
}
ChatDelta represents incremental content in streaming
type ChatMessage ¶ added in v0.0.84
type ChatMessage struct {
Role string `json:"role"`
Content interface{} `json:"content"` // string or []ContentPart
RawContent string `json:"-"` // Extracted text content
}
ChatMessage represents a message in the conversation Content can be a string or an array of content parts (for multi-modal)
func (*ChatMessage) GetTextContent ¶ added in v0.0.84
func (m *ChatMessage) GetTextContent() string
GetTextContent extracts the text content from the message Handles both string content and array of content parts
type ConfiguredModel ¶ added in v0.0.24
type ConfiguredModel struct {
Name string `json:"name"`
Type string `json:"type"` // e.g., "local", "external"
Modes []cfg.ModelMode `json:"modes"` // Use alias cfg
}
ConfiguredModel represents a model as configured within Comanda
type ConfiguredModelListResponse ¶ added in v0.0.24
type ConfiguredModelListResponse struct {
Success bool `json:"success"`
Models []ConfiguredModel `json:"models"`
Error string `json:"error,omitempty"`
}
ConfiguredModelListResponse is the response for listing models configured for a provider
type ContentPart ¶ added in v0.0.84
ContentPart represents a part of multi-modal content
type EnvironmentRequest ¶ added in v0.0.8
type EnvironmentRequest struct {
Password string `json:"password"`
}
EnvironmentRequest represents a request for environment operations
type EnvironmentResponse ¶ added in v0.0.8
type EnvironmentResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
}
EnvironmentResponse represents a response for environment operations
type ErrorResponse ¶ added in v0.0.24
type ErrorResponse struct {
Success bool `json:"success"` // Should always be false
Error string `json:"error"`
}
ErrorResponse represents a generic error API response
type FileInfo ¶ added in v0.0.8
type FileInfo struct {
Name string `json:"name"`
Path string `json:"path"`
Size int64 `json:"size"`
IsDir bool `json:"isDir"`
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
Methods string `json:"methods,omitempty"`
}
FileInfo represents detailed information about a file
type FileRequest ¶ added in v0.0.8
FileRequest represents a request to create/edit a file
type FileResponse ¶ added in v0.0.8
type FileResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
File FileInfo `json:"file,omitempty"`
}
FileResponse represents a response for file operations
type FileResult ¶ added in v0.0.8
type FileResult struct {
Path string `json:"path"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
FileResult represents the result of a single file operation
type FileUploadResponse ¶ added in v0.0.14
type FileUploadResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
File FileInfo `json:"file,omitempty"`
}
FileUploadResponse represents a response for file upload operations
type GenerateRequest ¶ added in v0.0.35
GenerateRequest represents the request body for the generate endpoint
type GenerateResponse ¶ added in v0.0.35
type GenerateResponse struct {
Success bool `json:"success"`
YAML string `json:"yaml,omitempty"`
Error string `json:"error,omitempty"`
Model string `json:"model,omitempty"`
}
GenerateResponse represents the response for the generate endpoint
type HealthResponse ¶
HealthResponse represents the health check response
type ListResponse ¶
type ListResponse struct {
Success bool `json:"success"`
Files []FileInfo `json:"files"`
Error string `json:"error,omitempty"`
}
ListResponse represents the response for file listing
type ModelInfo ¶ added in v0.0.84
type ModelInfo struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
}
ModelInfo represents model information for /v1/models
type ModelListResponse ¶ added in v0.0.84
ModelListResponse represents the models list response
type OpenAIError ¶ added in v0.0.84
type OpenAIError struct {
Error OpenAIErrorDetail `json:"error"`
}
OpenAIError represents an error response
type OpenAIErrorDetail ¶ added in v0.0.84
type OpenAIErrorDetail struct {
Message string `json:"message"`
Type string `json:"type"`
Param *string `json:"param"`
Code *string `json:"code"`
}
OpenAIErrorDetail represents the error details
type ProcessResponse ¶
type ProcessResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Output string `json:"output,omitempty"`
}
ProcessResponse represents the response for process operations
type ProviderInfo ¶ added in v0.0.8
type ProviderInfo struct {
Name string `json:"name"`
Models []string `json:"models"`
Enabled bool `json:"enabled"`
}
ProviderInfo represents information about a provider
type ProviderListResponse ¶ added in v0.0.8
type ProviderListResponse struct {
Success bool `json:"success"`
Providers []ProviderInfo `json:"providers"`
Error string `json:"error,omitempty"`
}
ProviderListResponse represents the response for provider listing
type ProviderRequest ¶ added in v0.0.8
type ProviderRequest struct {
Name string `json:"name"`
APIKey string `json:"apiKey"`
Models []string `json:"models,omitempty"`
Enabled bool `json:"enabled"`
}
ProviderRequest represents a request to modify a provider
type RestoreRequest ¶ added in v0.0.8
type RestoreRequest struct {
Backup string `json:"backup"`
}
RestoreRequest represents a request for restore operations
type Server ¶ added in v0.0.8
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
type SuccessResponse ¶ added in v0.0.24
type SuccessResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
}
SuccessResponse represents a generic successful API response
type UpdateModelRequest ¶ added in v0.0.24
UpdateModelRequest is the request body for updating a configured model's modes
type UsageInfo ¶ added in v0.0.84
type UsageInfo struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
}
UsageInfo represents token usage information
type YAMLRequest ¶ added in v0.0.14
type YAMLRequest struct {
Content string `json:"content"`
Input string `json:"input"`
Streaming bool `json:"streaming"`
}
YAMLRequest represents a request for YAML operations