145 lines
4.6 KiB
Go
145 lines
4.6 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Node struct {
|
|
ID string `json:"id"`
|
|
Kind string `json:"kind"`
|
|
Label string `json:"label"`
|
|
Summary string `json:"summary,omitempty"`
|
|
Status string `json:"status,omitempty"`
|
|
Origin string `json:"origin"`
|
|
ExternalID string `json:"external_id,omitempty"`
|
|
URI string `json:"uri,omitempty"`
|
|
Categories []string `json:"categories,omitempty"`
|
|
Keywords []string `json:"keywords,omitempty"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
Weight float64 `json:"weight,omitempty"`
|
|
X float64 `json:"x"`
|
|
Y float64 `json:"y"`
|
|
Z float64 `json:"z"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Evidence struct {
|
|
NodeID string `json:"node_id,omitempty"`
|
|
URI string `json:"uri,omitempty"`
|
|
Excerpt string `json:"excerpt,omitempty"`
|
|
}
|
|
|
|
type Edge struct {
|
|
ID string `json:"id"`
|
|
Source string `json:"source"`
|
|
Target string `json:"target"`
|
|
Type string `json:"type"`
|
|
Origin string `json:"origin"`
|
|
Status string `json:"status,omitempty"`
|
|
Confidence float64 `json:"confidence,omitempty"`
|
|
Weight float64 `json:"weight,omitempty"`
|
|
Explanation string `json:"explanation,omitempty"`
|
|
Evidence []Evidence `json:"evidence,omitempty"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Hub struct {
|
|
NodeID string `json:"node_id"`
|
|
Label string `json:"label"`
|
|
Kind string `json:"kind"`
|
|
Degree int `json:"degree"`
|
|
}
|
|
|
|
type GraphAnalysis struct {
|
|
NodeCount int `json:"node_count"`
|
|
EdgeCount int `json:"edge_count"`
|
|
Components int `json:"components"`
|
|
KnowledgeOrphans int `json:"knowledge_orphans"`
|
|
StagingNodes int `json:"staging_nodes"`
|
|
AIThinkNodes int `json:"ai_think_nodes"`
|
|
ExternalNodes int `json:"external_nodes"`
|
|
AIEdges int `json:"ai_edges"`
|
|
Contradictions int `json:"contradictions"`
|
|
TopHubs []Hub `json:"top_hubs"`
|
|
}
|
|
|
|
type Snapshot struct {
|
|
Version uint64 `json:"version"`
|
|
Nodes []Node `json:"nodes"`
|
|
Edges []Edge `json:"edges"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Hit struct {
|
|
NodeID string `json:"node_id"`
|
|
Label string `json:"label"`
|
|
Score float64 `json:"score"`
|
|
Kind string `json:"kind"`
|
|
Status string `json:"status,omitempty"`
|
|
}
|
|
|
|
type Activity struct {
|
|
ID string `json:"id"`
|
|
Type string `json:"type"`
|
|
Source string `json:"source"`
|
|
Phase string `json:"phase,omitempty"`
|
|
Query string `json:"query,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
NodeIDs []string `json:"node_ids,omitempty"`
|
|
EdgeIDs []string `json:"edge_ids,omitempty"`
|
|
Strength float64 `json:"strength,omitempty"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
}
|
|
|
|
type ExternalEvent struct {
|
|
Type string `json:"type"`
|
|
Source string `json:"source"`
|
|
Query string `json:"query,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
Hits []ExternalHit `json:"hits,omitempty"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type ExternalHit struct {
|
|
ID string `json:"id"`
|
|
Score float64 `json:"score,omitempty"`
|
|
}
|
|
|
|
type QueryRequest struct {
|
|
Query string `json:"query"`
|
|
}
|
|
|
|
type QueryResponse struct {
|
|
Query string `json:"query"`
|
|
Answer string `json:"answer"`
|
|
Hits []Hit `json:"hits"`
|
|
UsedNodeIDs []string `json:"used_node_ids,omitempty"`
|
|
Uncertainties []string `json:"uncertainties,omitempty"`
|
|
DurationMS int64 `json:"duration_ms"`
|
|
}
|
|
|
|
type RelationDecision struct {
|
|
Related bool `json:"related"`
|
|
RelationType string `json:"relation_type"`
|
|
Confidence float64 `json:"confidence"`
|
|
Explanation string `json:"explanation"`
|
|
NeedsResearch bool `json:"needs_research"`
|
|
ResearchQuery string `json:"research_query"`
|
|
Title string `json:"title"`
|
|
Synthesis string `json:"synthesis"`
|
|
Keywords []string `json:"keywords"`
|
|
}
|
|
|
|
type AnswerDecision struct {
|
|
Answer string `json:"answer"`
|
|
UsedNodeIDs []string `json:"used_node_ids"`
|
|
Uncertainties []string `json:"uncertainties"`
|
|
}
|
|
|
|
type ResearchResult struct {
|
|
Title string `json:"title"`
|
|
URL string `json:"url"`
|
|
Content string `json:"content"`
|
|
}
|