Documentation
¶
Index ¶
- type CacheEntry
- type FetchService
- type FileReadResult
- type GitHubReference
- type GoogleSearchItem
- type GoogleSearchResponse
- type HTTPModelService
- func (s *HTTPModelService) GetCurrentModel() string
- func (s *HTTPModelService) IsModelAvailable(modelID string) bool
- func (s *HTTPModelService) ListModels(ctx context.Context) ([]string, error)
- func (s *HTTPModelService) SelectModel(modelID string) error
- func (s *HTTPModelService) ValidateModel(modelID string) error
- type InMemoryConversationRepository
- func (r *InMemoryConversationRepository) AddMessage(msg domain.ConversationEntry) error
- func (r *InMemoryConversationRepository) Clear() error
- func (r *InMemoryConversationRepository) Export(format domain.ExportFormat) ([]byte, error)
- func (r *InMemoryConversationRepository) GetMessageCount() int
- func (r *InMemoryConversationRepository) GetMessages() []domain.ConversationEntry
- func (r *InMemoryConversationRepository) UpdateLastMessage(content string) error
- func (r *InMemoryConversationRepository) UpdateLastMessageToolCalls(toolCalls *[]sdk.ChatCompletionMessageToolCall) error
- type LLMToolService
- func (s *LLMToolService) ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (string, error)
- func (s *LLMToolService) IsToolEnabled(name string) bool
- func (s *LLMToolService) ListTools() []domain.ToolDefinition
- func (s *LLMToolService) ValidateTool(name string, args map[string]interface{}) error
- type LocalFileService
- func (s *LocalFileService) GetFileInfo(path string) (domain.FileInfo, error)
- func (s *LocalFileService) ListProjectFiles() ([]string, error)
- func (s *LocalFileService) ReadFile(path string) (string, error)
- func (s *LocalFileService) ReadFileLines(path string, startLine, endLine int) (string, error)
- func (s *LocalFileService) ValidateFile(path string) error
- type ModelsResponse
- type NoOpToolService
- func (s *NoOpToolService) ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (string, error)
- func (s *NoOpToolService) IsToolEnabled(name string) bool
- func (s *NoOpToolService) ListTools() []domain.ToolDefinition
- func (s *NoOpToolService) ValidateTool(name string, args map[string]interface{}) error
- type StreamingChatService
- type ToolResult
- type WebSearchEngine
- type WebSearchService
- func (s *WebSearchService) IsEnabled() bool
- func (s *WebSearchService) SearchDuckDuckGo(ctx context.Context, query string, maxResults int) (*domain.WebSearchResponse, error)
- func (s *WebSearchService) SearchGoogle(ctx context.Context, query string, maxResults int) (*domain.WebSearchResponse, error)
- func (s *WebSearchService) SetEnabled(enabled bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheEntry ¶ added in v0.11.0
type CacheEntry struct {
Content string `json:"content"`
Timestamp time.Time `json:"timestamp"`
URL string `json:"url"`
}
CacheEntry represents a cached fetch result
type FetchService ¶ added in v0.11.0
type FetchService struct {
// contains filtered or unexported fields
}
FetchService handles content fetching operations
func NewFetchService ¶ added in v0.11.0
func NewFetchService(cfg *config.Config) *FetchService
NewFetchService creates a new FetchService
func (*FetchService) ClearCache ¶ added in v0.11.0
func (f *FetchService) ClearCache()
ClearCache clears all cached content
func (*FetchService) FetchContent ¶ added in v0.11.0
func (f *FetchService) FetchContent(ctx context.Context, target string) (*domain.FetchResult, error)
FetchContent fetches content from a URL or GitHub reference
func (*FetchService) GetCacheStats ¶ added in v0.11.0
func (f *FetchService) GetCacheStats() map[string]interface{}
GetCacheStats returns cache statistics
func (*FetchService) ValidateURL ¶ added in v0.11.0
func (f *FetchService) ValidateURL(targetURL string) error
ValidateURL checks if a URL's domain is whitelisted for fetching
type FileReadResult ¶ added in v0.7.0
type FileReadResult struct {
FilePath string `json:"file_path"`
Content string `json:"content"`
Size int64 `json:"size"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
Error string `json:"error,omitempty"`
}
FileReadResult represents the result of a file read operation
type GitHubReference ¶ added in v0.11.0
type GitHubReference struct {
Owner string
Repo string
Number int
Type string // "issue" or "pull"
}
GitHubReference represents a GitHub issue or PR reference
type GoogleSearchItem ¶ added in v0.13.0
type GoogleSearchItem struct {
Title string `json:"title"`
Link string `json:"link"`
Snippet string `json:"snippet"`
}
GoogleSearchItem represents a single search result from Google API
type GoogleSearchResponse ¶ added in v0.13.0
type GoogleSearchResponse struct {
Items []GoogleSearchItem `json:"items"`
}
GoogleSearchResponse represents the response from Google Custom Search API
type HTTPModelService ¶
type HTTPModelService struct {
// contains filtered or unexported fields
}
HTTPModelService implements ModelService using HTTP API calls
func NewHTTPModelService ¶
func NewHTTPModelService(baseURL, apiKey string) *HTTPModelService
NewHTTPModelService creates a new HTTP-based model service
func (*HTTPModelService) GetCurrentModel ¶
func (s *HTTPModelService) GetCurrentModel() string
func (*HTTPModelService) IsModelAvailable ¶
func (s *HTTPModelService) IsModelAvailable(modelID string) bool
func (*HTTPModelService) ListModels ¶
func (s *HTTPModelService) ListModels(ctx context.Context) ([]string, error)
func (*HTTPModelService) SelectModel ¶
func (s *HTTPModelService) SelectModel(modelID string) error
func (*HTTPModelService) ValidateModel ¶
func (s *HTTPModelService) ValidateModel(modelID string) error
type InMemoryConversationRepository ¶
type InMemoryConversationRepository struct {
// contains filtered or unexported fields
}
InMemoryConversationRepository implements ConversationRepository using in-memory storage
func NewInMemoryConversationRepository ¶
func NewInMemoryConversationRepository() *InMemoryConversationRepository
NewInMemoryConversationRepository creates a new in-memory conversation repository
func (*InMemoryConversationRepository) AddMessage ¶
func (r *InMemoryConversationRepository) AddMessage(msg domain.ConversationEntry) error
func (*InMemoryConversationRepository) Clear ¶
func (r *InMemoryConversationRepository) Clear() error
func (*InMemoryConversationRepository) Export ¶
func (r *InMemoryConversationRepository) Export(format domain.ExportFormat) ([]byte, error)
func (*InMemoryConversationRepository) GetMessageCount ¶
func (r *InMemoryConversationRepository) GetMessageCount() int
func (*InMemoryConversationRepository) GetMessages ¶
func (r *InMemoryConversationRepository) GetMessages() []domain.ConversationEntry
func (*InMemoryConversationRepository) UpdateLastMessage ¶
func (r *InMemoryConversationRepository) UpdateLastMessage(content string) error
func (*InMemoryConversationRepository) UpdateLastMessageToolCalls ¶
func (r *InMemoryConversationRepository) UpdateLastMessageToolCalls(toolCalls *[]sdk.ChatCompletionMessageToolCall) error
type LLMToolService ¶
type LLMToolService struct {
// contains filtered or unexported fields
}
LLMToolService implements ToolService with direct tool execution
func NewLLMToolService ¶
func NewLLMToolService(cfg *config.Config, fileService domain.FileService, fetchService domain.FetchService, webSearchService domain.WebSearchService) *LLMToolService
NewLLMToolService creates a new LLM tool service
func (*LLMToolService) ExecuteTool ¶
func (*LLMToolService) IsToolEnabled ¶
func (s *LLMToolService) IsToolEnabled(name string) bool
func (*LLMToolService) ListTools ¶
func (s *LLMToolService) ListTools() []domain.ToolDefinition
func (*LLMToolService) ValidateTool ¶
func (s *LLMToolService) ValidateTool(name string, args map[string]interface{}) error
type LocalFileService ¶
type LocalFileService struct {
// contains filtered or unexported fields
}
LocalFileService implements FileService using local filesystem operations
func NewLocalFileService ¶
func NewLocalFileService(cfg *config.Config) *LocalFileService
NewLocalFileService creates a new local file service
func (*LocalFileService) GetFileInfo ¶
func (s *LocalFileService) GetFileInfo(path string) (domain.FileInfo, error)
func (*LocalFileService) ListProjectFiles ¶
func (s *LocalFileService) ListProjectFiles() ([]string, error)
func (*LocalFileService) ReadFile ¶
func (s *LocalFileService) ReadFile(path string) (string, error)
func (*LocalFileService) ReadFileLines ¶ added in v0.7.0
func (s *LocalFileService) ReadFileLines(path string, startLine, endLine int) (string, error)
func (*LocalFileService) ValidateFile ¶
func (s *LocalFileService) ValidateFile(path string) error
type ModelsResponse ¶
type ModelsResponse struct {
Data []struct {
ID string `json:"id"`
Object string `json:"object"`
} `json:"data"`
}
ModelsResponse represents the API response for listing models
type NoOpToolService ¶
type NoOpToolService struct{}
NoOpToolService implements ToolService as a no-op (when tools are disabled)
func NewNoOpToolService ¶
func NewNoOpToolService() *NoOpToolService
NewNoOpToolService creates a new no-op tool service
func (*NoOpToolService) ExecuteTool ¶
func (*NoOpToolService) IsToolEnabled ¶
func (s *NoOpToolService) IsToolEnabled(name string) bool
func (*NoOpToolService) ListTools ¶
func (s *NoOpToolService) ListTools() []domain.ToolDefinition
func (*NoOpToolService) ValidateTool ¶
func (s *NoOpToolService) ValidateTool(name string, args map[string]interface{}) error
type StreamingChatService ¶
type StreamingChatService struct {
// contains filtered or unexported fields
}
StreamingChatService implements ChatService using streaming SDK client
func NewStreamingChatService ¶
func NewStreamingChatService(baseURL, apiKey string, timeoutSeconds int, toolService domain.ToolService, systemPrompt string) *StreamingChatService
NewStreamingChatService creates a new streaming chat service
func (*StreamingChatService) CancelRequest ¶
func (s *StreamingChatService) CancelRequest(requestID string) error
func (*StreamingChatService) GetMetrics ¶
func (s *StreamingChatService) GetMetrics(requestID string) *domain.ChatMetrics
type ToolResult ¶
type ToolResult struct {
Command string `json:"command"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
ExitCode int `json:"exit_code"`
Duration string `json:"duration"`
}
ToolResult represents the result of a tool execution
type WebSearchEngine ¶ added in v0.13.0
type WebSearchEngine string
WebSearchEngine represents different search engines
const ( GoogleSearch WebSearchEngine = "google" DuckDuckGoSearch WebSearchEngine = "duckduckgo" )
type WebSearchService ¶ added in v0.13.0
type WebSearchService struct {
// contains filtered or unexported fields
}
WebSearchService handles web search operations
func NewWebSearchService ¶ added in v0.13.0
func NewWebSearchService() *WebSearchService
NewWebSearchService creates a new web search service
func (*WebSearchService) IsEnabled ¶ added in v0.13.0
func (s *WebSearchService) IsEnabled() bool
IsEnabled returns whether the web search service is enabled
func (*WebSearchService) SearchDuckDuckGo ¶ added in v0.13.0
func (s *WebSearchService) SearchDuckDuckGo(ctx context.Context, query string, maxResults int) (*domain.WebSearchResponse, error)
SearchDuckDuckGo performs a DuckDuckGo search using their instant answer API
func (*WebSearchService) SearchGoogle ¶ added in v0.13.0
func (s *WebSearchService) SearchGoogle(ctx context.Context, query string, maxResults int) (*domain.WebSearchResponse, error)
SearchGoogle performs a Google search using the Custom Search JSON API
func (*WebSearchService) SetEnabled ¶ added in v0.13.0
func (s *WebSearchService) SetEnabled(enabled bool)
SetEnabled sets the enabled state of the web search service