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')
101
101
ollama.push(' user/llama3' )
102
102
```
103
103
104
- ### Embeddings
104
+ ### Embed
105
105
106
106
``` python
107
- ollama.embeddings(model = ' llama3' , prompt = ' The sky is blue because of rayleigh scattering' )
107
+ ollama.embed(model = ' llama3' , input = ' Why is the sky blue?' )
108
+ ```
109
+
110
+ ### Embed (Batch Embedding)
111
+
112
+ ``` python
113
+ ollama.embed(model = ' llama3' , input = [' Why is the sky blue?' , ' Why is the grass green?' ])
108
114
```
109
115
110
116
### Ps
Original file line number Diff line number Diff line change @@ -250,6 +250,9 @@ def embeddings(
250
250
options : Optional [Options ] = None ,
251
251
keep_alive : Optional [Union [float , str ]] = None ,
252
252
) -> Mapping [str , Sequence [float ]]:
253
+ """
254
+ Deprecated in favor of `embed`.
255
+ """
253
256
return self ._request (
254
257
'POST' ,
255
258
'/api/embeddings' ,
@@ -641,6 +644,9 @@ async def embeddings(
641
644
options : Optional [Options ] = None ,
642
645
keep_alive : Optional [Union [float , str ]] = None ,
643
646
) -> Mapping [str , Sequence [float ]]:
647
+ """
648
+ Deprecated in favor of `embed`.
649
+ """
644
650
response = await self ._request (
645
651
'POST' ,
646
652
'/api/embeddings' ,
You can’t perform that action at this time.
0 commit comments