File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,16 @@ ollama.pull('llama3.1')
101
101
ollama.push(' user/llama3.1' )
102
102
```
103
103
104
- ### Embeddings
104
+ ### Embed
105
105
106
106
``` python
107
- ollama.embeddings(model = ' llama3.1' , prompt = ' The sky is blue because of rayleigh scattering' )
107
+ ollama.embed(model = ' llama3.1' , input = ' The sky is blue because of rayleigh scattering' )
108
+ ```
109
+
110
+ ### Embed (batch)
111
+
112
+ ``` python
113
+ ollama.embed(model = ' llama3.1' , input = [' The sky is blue because of rayleigh scattering' , ' Grass is green because of chlorophyll' ])
108
114
```
109
115
110
116
### Ps
Original file line number Diff line number Diff line change @@ -278,6 +278,9 @@ def embeddings(
278
278
options : Optional [Options ] = None ,
279
279
keep_alive : Optional [Union [float , str ]] = None ,
280
280
) -> Mapping [str , Sequence [float ]]:
281
+ """
282
+ Deprecated in favor of `embed`.
283
+ """
281
284
return self ._request (
282
285
'POST' ,
283
286
'/api/embeddings' ,
@@ -698,6 +701,9 @@ async def embeddings(
698
701
options : Optional [Options ] = None ,
699
702
keep_alive : Optional [Union [float , str ]] = None ,
700
703
) -> Mapping [str , Sequence [float ]]:
704
+ """
705
+ Deprecated in favor of `embed`.
706
+ """
701
707
response = await self ._request (
702
708
'POST' ,
703
709
'/api/embeddings' ,
You can’t perform that action at this time.
0 commit comments