Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
0d6e3565
Unverified
Commit
0d6e3565
authored
Jan 04, 2024
by
Brian Murray
Committed by
GitHub
Jan 04, 2024
Browse files
Add embeddings to API (#1773)
parent
b5939008
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
api/client.go
api/client.go
+7
-0
No files found.
api/client.go
View file @
0d6e3565
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment