services

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 (*InMemoryConversationRepository) Clear

func (*InMemoryConversationRepository) Export

func (*InMemoryConversationRepository) GetMessageCount

func (r *InMemoryConversationRepository) GetMessageCount() int

func (*InMemoryConversationRepository) GetMessages

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) *LLMToolService

NewLLMToolService creates a new LLM tool service

func (*LLMToolService) ExecuteTool

func (s *LLMToolService) ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (string, error)

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() *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) 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 (s *NoOpToolService) ExecuteTool(ctx context.Context, name string, args map[string]interface{}) (string, error)

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) *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

func (*StreamingChatService) SendMessage

func (s *StreamingChatService) SendMessage(ctx context.Context, model string, messages []sdk.Message) (<-chan domain.ChatEvent, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL