-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Summary
Add an embedding client to the LLM package that calls Ollama's /api/embed endpoint. This is the foundation for the memory system's vector search.
Details
New files:
internal/llm/embed.gointernal/llm/embed_test.go
Types:
EmbedRequest{Model, Input string}EmbedResponse{Embeddings [][]float64}
Function:
Embed(ctx, host, model, input string) ([]float64, error)— POST to/api/embedusingcarlmjohnson/requests
Error:
ErrEmbed = errors.New("neural embedding generation failed")
Testing:
- Table-driven tests with
httptest.NewServer(same pattern asollama_test.go) - Cases: successful embedding, model not found (404), unexpected status, empty input
Notes:
- No changes to existing code
- Follow the same HTTP pattern used in
Chat()andStreamChat()inollama.go - Use
handleHTTPErrors()for consistent error handling
Acceptance Criteria
-
Embed()function returns embedding vector from Ollama - Proper error handling for 404 (model not found) and other HTTP errors
- Table-driven tests pass with mocked Ollama endpoint
- No changes to existing files
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Backlog