diff --git a/embeddings/provider.go b/embeddings/provider.go index ccece80..6147932 100644 --- a/embeddings/provider.go +++ b/embeddings/provider.go @@ -19,8 +19,10 @@ import ( var httpClient = &http.Client{Timeout: 30 * time.Second} // Endpoint URLs are package-level vars so tests can override them with httptest servers. -var openAIEndpoint = "https://api.openai.com/v1/embeddings" -var voyageEndpoint = "https://api.voyageai.com/v1/embeddings" +var ( + openAIEndpoint = "https://api.openai.com/v1/embeddings" + voyageEndpoint = "https://api.voyageai.com/v1/embeddings" +) // maxRetries is the maximum number of rate-limit retries before giving up. const maxRetries = 5 diff --git a/portablegraph/portable_graph.go b/portablegraph/portable_graph.go index 4bc7a92..c8c51f0 100644 --- a/portablegraph/portable_graph.go +++ b/portablegraph/portable_graph.go @@ -23,23 +23,23 @@ type PortableNode struct { // PortableEdge represents a portable graph edge. type PortableEdge struct { - ID string `json:"id"` - From string `json:"from"` - To string `json:"to"` - Kind string `json:"kind"` // "depends_on", "produced", "references" - Weight float64 `json:"weight"` - Attrs map[string]interface{} `json:"attrs,omitempty"` - CreatedAt time.Time `json:"created_at"` + ID string `json:"id"` + From string `json:"from"` + To string `json:"to"` + Kind string `json:"kind"` // "depends_on", "produced", "references" + Weight float64 `json:"weight"` + Attrs map[string]interface{} `json:"attrs,omitempty"` + CreatedAt time.Time `json:"created_at"` } // PortableGraph represents a portable, serializable graph. type PortableGraph struct { mu sync.RWMutex - ID string `json:"id"` - Name string `json:"name"` + ID string `json:"id"` + Name string `json:"name"` Nodes map[string]*PortableNode `json:"nodes"` - Edges []PortableEdge `json:"edges"` - Attrs map[string]interface{} `json:"attrs,omitempty"` + Edges []PortableEdge `json:"edges"` + Attrs map[string]interface{} `json:"attrs,omitempty"` } // NewPortableGraph creates a new portable graph. @@ -146,10 +146,10 @@ func (g *PortableGraph) ToGraphSpec() *graphcontracts.GraphSpec { } return &graphcontracts.GraphSpec{ - ID: g.ID, - Name: g.Name, - Nodes: nodes, - Edges: edges, + ID: g.ID, + Name: g.Name, + Nodes: nodes, + Edges: edges, } }