agents

package
v0.0.0-...-e341b83 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DisableAdvisoryLock     = false
	UseBlockingAdvisoryLock = true
)

Functions

func NewAgentHandler

func NewAgentHandler(agent AgentService, generic services.GenericService) *agentHandler

func NewAgentSubresourceHandler

func NewAgentSubresourceHandler(
	agent AgentService,
	session sessions.SessionService,
	generic services.GenericService,
) *agentSubresourceHandler

func NewIgniteHandler

func NewIgniteHandler(agent AgentService, session sessions.SessionService, msg sessions.MessageService) *igniteHandler

func NewMockAgentDao

func NewMockAgentDao() *agentDaoMock

func PresentAgent

func PresentAgent(agent *Agent) openapi.Agent

Types

type Agent

type Agent struct {
	api.Meta
	ProjectId            string  `json:"project_id"             gorm:"not null;index"`
	ParentAgentId        *string `json:"parent_agent_id"        gorm:"index"`
	OwnerUserId          string  `json:"owner_user_id"          gorm:"not null"`
	Name                 string  `json:"name"                   gorm:"not null"`
	DisplayName          *string `json:"display_name"`
	Description          *string `json:"description"`
	Prompt               *string `json:"prompt"                 gorm:"type:text"`
	RepoUrl              *string `json:"repo_url"`
	WorkflowId           *string `json:"workflow_id"`
	LlmModel             string  `json:"llm_model"              gorm:"default:'claude-sonnet-4-6'"`
	LlmTemperature       float64 `json:"llm_temperature"        gorm:"default:0.7"`
	LlmMaxTokens         int32   `json:"llm_max_tokens"         gorm:"default:4000"`
	BotAccountName       *string `json:"bot_account_name"`
	ResourceOverrides    *string `json:"resource_overrides"`
	EnvironmentVariables *string `json:"environment_variables"`
	Labels               *string `json:"labels"`
	Annotations          *string `json:"annotations"`
	CurrentSessionId     *string `json:"current_session_id"`
}

func ConvertAgent

func ConvertAgent(agent openapi.Agent) *Agent

func (*Agent) BeforeCreate

func (d *Agent) BeforeCreate(tx *gorm.DB) error

type AgentDao

type AgentDao interface {
	Get(ctx context.Context, id string) (*Agent, error)
	Create(ctx context.Context, agent *Agent) (*Agent, error)
	Replace(ctx context.Context, agent *Agent) (*Agent, error)
	Delete(ctx context.Context, id string) error
	FindByIDs(ctx context.Context, ids []string) (AgentList, error)
	All(ctx context.Context) (AgentList, error)
	AllByProjectID(ctx context.Context, projectID string) (AgentList, error)
}

func NewAgentDao

func NewAgentDao(sessionFactory *db.SessionFactory) AgentDao

type AgentIndex

type AgentIndex map[string]*Agent

type AgentList

type AgentList []*Agent

func (AgentList) Index

func (l AgentList) Index() AgentIndex

type AgentPatchRequest

type AgentPatchRequest struct {
	DisplayName          *string  `json:"display_name,omitempty"`
	Description          *string  `json:"description,omitempty"`
	Prompt               *string  `json:"prompt,omitempty"`
	RepoUrl              *string  `json:"repo_url,omitempty"`
	WorkflowId           *string  `json:"workflow_id,omitempty"`
	LlmModel             *string  `json:"llm_model,omitempty"`
	LlmTemperature       *float64 `json:"llm_temperature,omitempty"`
	LlmMaxTokens         *int32   `json:"llm_max_tokens,omitempty"`
	BotAccountName       *string  `json:"bot_account_name,omitempty"`
	ResourceOverrides    *string  `json:"resource_overrides,omitempty"`
	EnvironmentVariables *string  `json:"environment_variables,omitempty"`
	Labels               *string  `json:"labels,omitempty"`
	Annotations          *string  `json:"annotations,omitempty"`
	CurrentSessionId     *string  `json:"current_session_id,omitempty"`
	ParentAgentId        *string  `json:"parent_agent_id,omitempty"`
}

type AgentService

type AgentService interface {
	Get(ctx context.Context, id string) (*Agent, *errors.ServiceError)
	Create(ctx context.Context, agent *Agent) (*Agent, *errors.ServiceError)
	Replace(ctx context.Context, agent *Agent) (*Agent, *errors.ServiceError)
	Delete(ctx context.Context, id string) *errors.ServiceError
	All(ctx context.Context) (AgentList, *errors.ServiceError)
	AllByProjectID(ctx context.Context, projectID string) (AgentList, *errors.ServiceError)

	FindByIDs(ctx context.Context, ids []string) (AgentList, *errors.ServiceError)

	OnUpsert(ctx context.Context, id string) error
	OnDelete(ctx context.Context, id string) error
}

func NewAgentService

func NewAgentService(lockFactory db.LockFactory, agentDao AgentDao, events services.EventService) AgentService

func Service

type IgniteResponse

type IgniteResponse struct {
	Session        openapi.Session `json:"session"`
	IgnitionPrompt string          `json:"ignition_prompt"`
}

type ServiceLocator

type ServiceLocator func() AgentService

func NewServiceLocator

func NewServiceLocator(env *environments.Env) ServiceLocator

Jump to

Keyboard shortcuts

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