legacy

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSessionAborted is returned when a session is aborted by user request
	ErrSessionAborted = goerr.New("session aborted by user")
)

Functions

func CollectThreadComments

func CollectThreadComments(ctx context.Context, repo interfaces.Repository, ticketID types.TicketID, currentSession *session.Session) []ticket.Comment

CollectThreadComments delegates to the shared chat package implementation.

func GenerateChatSystemPrompt

func GenerateChatSystemPrompt(ctx context.Context, target *ticket.Ticket, alertCount int, additionalInstructions string, knowledges []*knowledge.Knowledge, requesterID string, threadComments []ticket.Comment, userSystemPrompt string) (string, error)

GenerateChatSystemPrompt generates the chat system prompt from template and parameters.

func ToolCallToText

func ToolCallToText(ctx context.Context, llmClient gollem.LLMClient, spec *gollem.ToolSpec, call *gollem.FunctionCall) string

ToolCallToText converts a tool call to a human-readable text description using LLM.

Types

type Option

type Option func(*PlanExecChat)

Option configures a PlanExecChat.

func WithFrontendURL

func WithFrontendURL(url string) Option

WithFrontendURL sets the frontend URL for session links.

func WithNoAuthorization

func WithNoAuthorization(noAuthz bool) Option

WithNoAuthorization disables policy-based authorization checks.

func WithSlackService

func WithSlackService(svc *slackService.Service) Option

WithSlackService sets the Slack service for message routing.

func WithStorageClient

func WithStorageClient(client interfaces.StorageClient) Option

WithStorageClient sets the storage client for history persistence.

func WithStoragePrefix

func WithStoragePrefix(prefix string) Option

WithStoragePrefix sets the storage prefix for history paths.

func WithStrategyFactory

func WithStrategyFactory(f StrategyFactory) Option

WithStrategyFactory sets the strategy factory for agent execution.

func WithSubAgents

func WithSubAgents(subAgents []*agent.SubAgent) Option

WithSubAgents sets the sub-agents available to the agent.

func WithTools

func WithTools(tools []gollem.ToolSet) Option

WithTools sets the tool sets available to the agent.

func WithTraceRepository

func WithTraceRepository(repo trace.Repository) Option

WithTraceRepository sets the trace repository for execution tracing.

func WithUserSystemPrompt

func WithUserSystemPrompt(prompt string) Option

WithUserSystemPrompt sets the user system prompt.

type PlanExecChat

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

PlanExecChat implements interfaces.ChatUseCase with the Plan & Execute strategy.

func NewPlanExecChat

func NewPlanExecChat(repo interfaces.Repository, llmClient gollem.LLMClient, policyClient interfaces.PolicyClient, opts ...Option) *PlanExecChat

NewPlanExecChat creates a new PlanExecChat with the given dependencies and options.

func (*PlanExecChat) Execute

func (c *PlanExecChat) Execute(ctx context.Context, target *ticket.Ticket, message string) error

Execute processes a chat message for the specified ticket. This is the main orchestrator that coordinates all phases of chat processing.

type PlanProgressReporter

type PlanProgressReporter interface {
	Planned() bool
}

PlanProgressReporter reports whether planning occurred during execution.

type StrategyFactory

type StrategyFactory func(ctx context.Context, params *StrategyParams) (gollem.Strategy, PlanProgressReporter)

StrategyFactory creates a gollem execution strategy for a chat session. It returns the strategy and an optional PlanProgressReporter for tracking plan progress.

func DefaultStrategyFactory

func DefaultStrategyFactory() StrategyFactory

DefaultStrategyFactory creates the standard Plan & Execute strategy with progress tracking.

type StrategyParams

type StrategyParams struct {
	LLMClient  gollem.LLMClient
	Session    *session.Session
	Repository interfaces.Repository
	RequestID  string
	PlanFunc   func(context.Context, string)
}

StrategyParams holds the parameters needed to create a strategy.

Jump to

Keyboard shortcuts

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