agent

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package agent implements the Agent Service.

Responsibilities:

  • CRUD operations for Agent records
  • Validation of agent configurations
  • Calculation of agent metadata (max tokens)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service manages agent records.

func New

func New(database *db.DB, providerSvc *provider.Service, modelInfoSvc *modelinfo.Service) *Service

New constructs a new agent Service.

func (*Service) Create

func (s *Service) Create(agent *models.Agent) error

Create creates a new agent with a slug ID derived from its name.

func (*Service) Delete

func (s *Service) Delete(id string) error

Delete removes an agent by ID.

func (*Service) Get

func (s *Service) Get(id string) (*models.Agent, error)

Get retrieves an agent by ID.

func (*Service) List

func (s *Service) List() ([]*models.Agent, error)

List returns all agents.

func (*Service) MigrateIDs

func (s *Service) MigrateIDs(credSvc *credential.Service, tokenSvc *token.Service) (int, error)

MigrateIDs renames UUID-era agents to slug IDs and rewrites every reference: credentials data.agent_id and token AllowedModels entries. Idempotent: re-runs find no UUID rows and change nothing.

func (*Service) Update

func (s *Service) Update(id string, agent *models.Agent) error

Update updates an existing agent.

Jump to

Keyboard shortcuts

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