Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions embeddings/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions portablegraph/portable_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"sync"
"time"

graphcontracts "github.com/GrayCodeAI/hawk-core-contracts/graph"

Check failure on line 10 in portablegraph/portable_graph.go

View workflow job for this annotation

GitHub Actions / fmt + vet

github.com/GrayCodeAI/hawk-core-contracts@v0.1.8: replacement directory ../hawk-core-contracts does not exist

Check failure on line 10 in portablegraph/portable_graph.go

View workflow job for this annotation

GitHub Actions / security

could not import github.com/GrayCodeAI/hawk-core-contracts/graph (invalid package name: "")

Check failure on line 10 in portablegraph/portable_graph.go

View workflow job for this annotation

GitHub Actions / security

github.com/GrayCodeAI/hawk-core-contracts@v0.1.8: replacement directory ../hawk-core-contracts does not exist

Check failure on line 10 in portablegraph/portable_graph.go

View workflow job for this annotation

GitHub Actions / deadcode

could not import github.com/GrayCodeAI/hawk-core-contracts/graph (invalid package name: "")

Check failure on line 10 in portablegraph/portable_graph.go

View workflow job for this annotation

GitHub Actions / deadcode

github.com/GrayCodeAI/hawk-core-contracts@v0.1.8: replacement directory ../hawk-core-contracts does not exist
)

// PortableNode represents a portable graph node.
Expand All @@ -23,23 +23,23 @@

// 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.
Expand Down Expand Up @@ -146,10 +146,10 @@
}

return &graphcontracts.GraphSpec{
ID: g.ID,
Name: g.Name,
Nodes: nodes,
Edges: edges,
ID: g.ID,
Name: g.Name,
Nodes: nodes,
Edges: edges,
}
}

Expand Down
Loading