Documentation
¶
Index ¶
- type Alias
- type DAG
- func (d *DAG) Append(parentID string, role string, content string) (*DAGNode, error)
- func (d *DAG) Branches(nodeID string) ([]*DAGNode, error)
- func (d *DAG) Close() error
- func (d *DAG) Fork(nodeID string) (*DAGNode, error)
- func (d *DAG) Head() (*DAGNode, error)
- func (d *DAG) History(nodeID string) ([]*DAGNode, error)
- func (d *DAG) Prune(nodeID string) error
- func (d *DAG) SetHead(nodeID string) error
- type DAGNode
- type Node
- type NodeType
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) CreateAlias(ctx context.Context, alias, nodeID string) error
- func (s *SQLiteStore) CreateNode(ctx context.Context, node *Node) error
- func (s *SQLiteStore) DeleteAlias(ctx context.Context, alias string) error
- func (s *SQLiteStore) DeleteNode(ctx context.Context, id string) error
- func (s *SQLiteStore) GetAncestors(ctx context.Context, id string) ([]*Node, error)
- func (s *SQLiteStore) GetNode(ctx context.Context, id string) (*Node, error)
- func (s *SQLiteStore) GetNodeByAlias(ctx context.Context, alias string) (*Node, error)
- func (s *SQLiteStore) GetNodeByPrefix(ctx context.Context, prefix string) (*Node, error)
- func (s *SQLiteStore) GetNodeChildren(ctx context.Context, id string) ([]*Node, error)
- func (s *SQLiteStore) GetOrphanedToolUses(ctx context.Context, rootID string) ([]string, error)
- func (s *SQLiteStore) GetSubtree(ctx context.Context, id string) ([]*Node, error)
- func (s *SQLiteStore) IndexToolIDs(ctx context.Context, nodeID string, toolIDs []string, role string) error
- func (s *SQLiteStore) ListAliases(ctx context.Context, nodeID string) ([]Alias, error)
- func (s *SQLiteStore) ListRootNodes(ctx context.Context) ([]*Node, error)
- func (s *SQLiteStore) UpdateNode(ctx context.Context, node *Node) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAG ¶
type DAG struct {
// contains filtered or unexported fields
}
DAG is a conversation stored as a directed acyclic graph.
func NewDAGFromStore ¶
NewDAGFromStore creates a DAG using an existing store.
type DAGNode ¶
type DAGNode struct {
ID string
ParentID string
Role string
Content string
Model string
CreatedAt time.Time
Metadata map[string]string
}
DAGNode is a single message in the conversation DAG.
type Node ¶
type Node struct {
ID string `json:"id"`
ParentID string `json:"parent_id,omitempty"`
RootID string `json:"root_id,omitempty"`
Sequence int `json:"sequence"`
NodeType NodeType `json:"node_type"`
Content string `json:"content"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
TokensIn int `json:"tokens_in,omitempty"`
TokensOut int `json:"tokens_out,omitempty"`
TokensCacheRead int `json:"tokens_cache_read,omitempty"`
TokensCacheCreation int `json:"tokens_cache_creation,omitempty"`
TokensReasoning int `json:"tokens_reasoning,omitempty"`
LatencyMs int `json:"latency_ms,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
OutputGroupID string `json:"output_group_id,omitempty"`
Status string `json:"status,omitempty"`
Title string `json:"title,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
CreatedAt time.Time `json:"created_at"`
Metadata json.RawMessage `json:"metadata,omitempty"`
}
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(path string) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) CreateAlias ¶
func (s *SQLiteStore) CreateAlias(ctx context.Context, alias, nodeID string) error
func (*SQLiteStore) CreateNode ¶
func (s *SQLiteStore) CreateNode(ctx context.Context, node *Node) error
func (*SQLiteStore) DeleteAlias ¶
func (s *SQLiteStore) DeleteAlias(ctx context.Context, alias string) error
func (*SQLiteStore) DeleteNode ¶
func (s *SQLiteStore) DeleteNode(ctx context.Context, id string) error
func (*SQLiteStore) GetAncestors ¶
func (*SQLiteStore) GetNodeByAlias ¶
func (*SQLiteStore) GetNodeByPrefix ¶
func (*SQLiteStore) GetNodeChildren ¶
func (*SQLiteStore) GetOrphanedToolUses ¶
func (*SQLiteStore) GetSubtree ¶
func (*SQLiteStore) IndexToolIDs ¶
func (*SQLiteStore) ListAliases ¶
func (*SQLiteStore) ListRootNodes ¶
func (s *SQLiteStore) ListRootNodes(ctx context.Context) ([]*Node, error)
func (*SQLiteStore) UpdateNode ¶
func (s *SQLiteStore) UpdateNode(ctx context.Context, node *Node) error
type Store ¶
type Store interface {
CreateNode(ctx context.Context, node *Node) error
GetNode(ctx context.Context, id string) (*Node, error)
GetNodeByPrefix(ctx context.Context, prefix string) (*Node, error)
GetNodeChildren(ctx context.Context, id string) ([]*Node, error)
GetSubtree(ctx context.Context, id string) ([]*Node, error)
GetAncestors(ctx context.Context, id string) ([]*Node, error)
ListRootNodes(ctx context.Context) ([]*Node, error)
UpdateNode(ctx context.Context, node *Node) error
DeleteNode(ctx context.Context, id string) error
CreateAlias(ctx context.Context, alias, nodeID string) error
DeleteAlias(ctx context.Context, alias string) error
GetNodeByAlias(ctx context.Context, alias string) (*Node, error)
ListAliases(ctx context.Context, nodeID string) ([]Alias, error)
IndexToolIDs(ctx context.Context, nodeID string, toolIDs []string, role string) error
GetOrphanedToolUses(ctx context.Context, rootID string) ([]string, error)
Close() error
}
Click to show internal directories.
Click to hide internal directories.