agentpg

package
v0.0.12-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package agentpg stores saved Agents in PostgreSQL. An Agent's model provider bundle is sealed with the Core credential key, bound to its tenant and Agent, in the Agent's transaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func New

func New(pool *pgunit.Pool, cipher *credentialcrypto.Cipher) *Store

New returns the Agent store, which seals model provider bundles with cipher. A bundle the key cannot open is an internal error.

func (*Store) CreateAgent

func (s *Store) CreateAgent(ctx context.Context, input agents.NewAgent) (agents.Agent, error)

func (*Store) DeleteAgent

func (s *Store) DeleteAgent(ctx context.Context, tenantID, agentID string) (string, error)

DeleteAgent treats an agentID that cannot name an Agent as a missing one. The model provider bundle goes with the Agent by foreign-key cascade.

func (*Store) GetAgent

func (s *Store) GetAgent(ctx context.Context, tenantID, agentID string) (agents.Agent, error)

GetAgent treats an agentID that cannot name an Agent as a missing one.

func (*Store) GetAgentWithModelProvider

func (s *Store) GetAgentWithModelProvider(ctx context.Context, tenantID, agentID string) (agents.Agent, *v1.ModelProviderInput, error)

GetAgentWithModelProvider reads the Agent and its sealed bundle with one statement and opens the bundle. An agentID that cannot name an Agent is a missing one.

func (*Store) ListAgents

func (s *Store) ListAgents(ctx context.Context, query agents.ListQuery) (agents.Page, error)

ListAgents reads the cursor Agent and the page from one snapshot. A cursor that cannot name an Agent is a missing one.

func (*Store) WithAgentUpdate

func (s *Store) WithAgentUpdate(ctx context.Context, tenantID, agentID string, update func(agents.UpdateTx) error) error

WithAgentUpdate treats an agentID that cannot name an Agent as a missing one.

Jump to

Keyboard shortcuts

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