ai

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIService

type AIService struct {
	// contains filtered or unexported fields
}

func NewAIService

func NewAIService(provider, baseURL, model, apiKey string, apiClient *client.Client, serverURL string) *AIService

func (*AIService) Ask

func (s *AIService) Ask(ctx context.Context, question string, history []ChatMessage) (*AskResponse, error)

func (*AIService) AskStream

func (s *AIService) AskStream(ctx context.Context, question string, history []ChatMessage, cb StreamCallback) error

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(llmClient *openai.Client, apiClient *client.Client, model string, serverURL string) *Agent

func (*Agent) Ask

func (a *Agent) Ask(ctx context.Context, question string, history []ChatMessage) (*AskResponse, error)

func (*Agent) AskStream

func (a *Agent) AskStream(ctx context.Context, question string, history []ChatMessage, cb StreamCallback) error

type AskResponse

type AskResponse struct {
	Answer           string
	Model            string
	PromptTokens     int
	CompletionTokens int
}

type ChatMessage

type ChatMessage struct {
	Role    string
	Content string
}

type StreamCallback

type StreamCallback func(StreamEvent)

type StreamEvent

type StreamEvent struct {
	Type             string
	Tool             string
	Content          string
	PromptTokens     int
	CompletionTokens int
}

Jump to

Keyboard shortcuts

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