Documentation
¶
Index ¶
- type AIClient
- type Agent
- type Config
- type Tool
- func NewAddProjectAliasTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewCancelTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
- func NewCompleteTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
- func NewCreateProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewCreateTaskTool(tasks model.TaskService, projects model.ProjectService, ...) Tool
- func NewGetProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewGetTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
- func NewListProjectsTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewListTasksTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
- func NewMoveTaskTool(tasks model.TaskService, projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewRemoveProjectAliasTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewReopenTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
- func NewSearchTasksTool(tasks model.TaskService, projects model.ProjectService, ...) Tool
- func NewSetProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewSnoozeTaskTool(tasks model.TaskService, dp *dateparse.Dateparser, loc *goI18n.Localizer) Tool
- func NewUpdateProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
- func NewUpdateTaskTool(tasks model.TaskService, dp *dateparse.Dateparser, loc *goI18n.Localizer) Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIClient ¶
type AIClient interface {
CreateChatCompletion(ctx context.Context, req openai.ChatCompletionRequest) (openai.ChatCompletionResponse, error)
}
AIClient is the AI client interface for the tool-calling loop.
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent processes DM/GroupDirect messages through a tool-calling loop.
type Config ¶
type Config struct {
// SystemPrompt is a custom system prompt. Empty string = built-in default.
SystemPrompt string
// Language is the prompt language ("ru" or "en"). Empty string defaults to "ru".
Language string
// Now is the function for obtaining the current time. If nil — time.Now is used.
Now func() time.Time
// ListProjects is an optional function that fetches the project list for injection
// into the system prompt. Lets the model recognise project names even in
// non-standard phrasing without a mandatory list_projects call.
// nil — the projects block is not added to the prompt. Errors are logged
// but do not interrupt processing.
ListProjects func(ctx context.Context) ([]model.Project, error)
}
Config holds agent parameters.
type Tool ¶
type Tool interface {
// Name returns the tool name (used in function calling).
Name() string
// Description describes the tool's purpose for the model.
Description() string
// Parameters returns the JSON schema for the tool parameters.
Parameters() map[string]any
// DMOnly returns true if the tool is only available in DM mode (full access).
// In GroupDirect mode such tools are excluded from the tools set.
DMOnly() bool
// Execute runs the tool with the given arguments (JSON string) and returns the result.
Execute(ctx context.Context, args string) (string, error)
}
Tool describes a single agent tool.
func NewAddProjectAliasTool ¶ added in v0.3.0
func NewAddProjectAliasTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewAddProjectAliasTool creates the add_project_alias tool.
func NewCancelTaskTool ¶ added in v0.3.0
func NewCancelTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
NewCancelTaskTool creates the cancel_task tool.
func NewCompleteTaskTool ¶
func NewCompleteTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
NewCompleteTaskTool creates the complete_task tool.
func NewCreateProjectTool ¶
func NewCreateProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewCreateProjectTool creates the create_project tool.
func NewCreateTaskTool ¶
func NewCreateTaskTool(tasks model.TaskService, projects model.ProjectService, dp *dateparse.Dateparser, loc *goI18n.Localizer) Tool
NewCreateTaskTool creates the create_task tool.
func NewGetProjectTool ¶ added in v0.3.0
func NewGetProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewGetProjectTool creates the get_project tool.
func NewGetTaskTool ¶ added in v0.3.0
func NewGetTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
NewGetTaskTool creates the get_task tool.
func NewListProjectsTool ¶
func NewListProjectsTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewListProjectsTool creates the list_projects tool.
func NewListTasksTool ¶
func NewListTasksTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
NewListTasksTool creates the list_tasks tool.
func NewMoveTaskTool ¶
func NewMoveTaskTool(tasks model.TaskService, projects model.ProjectService, loc *goI18n.Localizer) Tool
NewMoveTaskTool creates the move_task tool.
func NewRemoveProjectAliasTool ¶ added in v0.3.0
func NewRemoveProjectAliasTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewRemoveProjectAliasTool creates the remove_project_alias tool.
func NewReopenTaskTool ¶ added in v0.3.0
func NewReopenTaskTool(tasks model.TaskService, loc *goI18n.Localizer) Tool
NewReopenTaskTool creates the reopen_task tool.
func NewSearchTasksTool ¶ added in v0.3.0
func NewSearchTasksTool(tasks model.TaskService, projects model.ProjectService, dp *dateparse.Dateparser, loc *goI18n.Localizer) Tool
NewSearchTasksTool creates the search_tasks tool.
func NewSetProjectTool ¶
func NewSetProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewSetProjectTool creates the set_project tool.
func NewSnoozeTaskTool ¶ added in v0.3.0
func NewSnoozeTaskTool(tasks model.TaskService, dp *dateparse.Dateparser, loc *goI18n.Localizer) Tool
NewSnoozeTaskTool creates the snooze_task tool.
func NewUpdateProjectTool ¶ added in v0.3.0
func NewUpdateProjectTool(projects model.ProjectService, loc *goI18n.Localizer) Tool
NewUpdateProjectTool creates the update_project tool.
func NewUpdateTaskTool ¶ added in v0.3.0
func NewUpdateTaskTool(tasks model.TaskService, dp *dateparse.Dateparser, loc *goI18n.Localizer) Tool
NewUpdateTaskTool creates the update_task tool.
Source Files
¶
- agent.go
- prompts_embed.go
- resolve_project.go
- resolve_task.go
- tool_add_project_alias.go
- tool_cancel_task.go
- tool_complete_task.go
- tool_create_project.go
- tool_create_task.go
- tool_get_project.go
- tool_get_task.go
- tool_list_projects.go
- tool_list_tasks.go
- tool_move_task.go
- tool_remove_project_alias.go
- tool_reopen_task.go
- tool_search_tasks.go
- tool_set_project.go
- tool_snooze_task.go
- tool_update_project.go
- tool_update_task.go