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 ¶
- type Store
- func (s *Store) CreateAgent(ctx context.Context, input agents.NewAgent) (agents.Agent, error)
- func (s *Store) DeleteAgent(ctx context.Context, tenantID, agentID string) (string, error)
- func (s *Store) GetAgent(ctx context.Context, tenantID, agentID string) (agents.Agent, error)
- func (s *Store) GetAgentWithModelProvider(ctx context.Context, tenantID, agentID string) (agents.Agent, *v1.ModelProviderInput, error)
- func (s *Store) ListAgents(ctx context.Context, query agents.ListQuery) (agents.Page, error)
- func (s *Store) WithAgentUpdate(ctx context.Context, tenantID, agentID string, ...) error
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 (*Store) DeleteAgent ¶
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) 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 ¶
ListAgents reads the cursor Agent and the page from one snapshot. A cursor that cannot name an Agent is a missing one.