Skip to content

Commit

Permalink
Add embeddings to API (ollama#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmurray authored Jan 4, 2024
1 parent b593900 commit 0d6e356
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ func (c *Client) Heartbeat(ctx context.Context) error {
}
return nil
}
func (c *Client) Embeddings(ctx context.Context, req *EmbeddingRequest) (*EmbeddingResponse, error) {
var resp EmbeddingResponse
if err := c.do(ctx, http.MethodPost, "/api/embeddings", req, &resp); err != nil {
return nil, err
}
return &resp, nil
}

func (c *Client) CreateBlob(ctx context.Context, digest string, r io.Reader) error {
if err := c.do(ctx, http.MethodHead, fmt.Sprintf("/api/blobs/%s", digest), nil, nil); err != nil {
Expand Down

0 comments on commit 0d6e356

Please sign in to comment.