Documentation
¶
Overview ¶
Package api provides an HTTP API server for inspecting and managing the Merkle DAG.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ListenAddr is the address to listen on (e.g., ":8081")
ListenAddr string
// VectorDriver for semantic search (optional, enables MCP server)
VectorDriver vector.Driver
// Embedder for converting query text to vectors (optional, enables MCP server)
Embedder embeddings.Embedder
}
Config is the API server configuration.
type HistoryMessage ¶
type HistoryMessage struct {
Hash string `json:"hash"`
ParentHash *string `json:"parent_hash,omitempty"`
Role string `json:"role"`
Content []llm.ContentBlock `json:"content"`
Model string `json:"model,omitempty"`
Provider string `json:"provider,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
Usage *llm.Usage `json:"usage,omitempty"`
}
HistoryMessage represents a message in the conversation history.
type HistoryResponse ¶
type HistoryResponse struct {
// Messages in chronological order (oldest first, up to and including the requested node)
Messages []HistoryMessage `json:"messages"`
// HeadHash is the hash of the node that was requested
HeadHash string `json:"head_hash"`
// Depth is the number of messages in the history
Depth int `json:"depth"`
}
HistoryResponse contains the conversation history for a given node.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the API server for managing and querying the Tapes system
func NewServer ¶
func NewServer(config Config, driver storage.Driver, dagLoader merkle.DagLoader, log *slog.Logger) (*Server, error)
NewServer creates a new API server. The storer is injected to allow sharing with other components (e.g., the proxy when not run as a singleton).
func (*Server) RunWithListener ¶
RunWithListener starts the API server using the provided listener.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mcp provides an MCP (Model Context Protocol) server for the Tapes system.
|
Package mcp provides an MCP (Model Context Protocol) server for the Tapes system. |
|
Package search provides shared search types and logic for semantic search over stored LLM sessions.
|
Package search provides shared search types and logic for semantic search over stored LLM sessions. |
Click to show internal directories.
Click to hide internal directories.