Skip to content

Commit 1fdcfbd

Browse files
committed
update docs
1 parent 359c63d commit 1fdcfbd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,16 @@ ollama.pull('llama3')
101101
ollama.push('user/llama3')
102102
```
103103

104-
### Embeddings
104+
### Embed
105105

106106
```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?'])
108114
```
109115

110116
### Ps

ollama/_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ def embeddings(
250250
options: Optional[Options] = None,
251251
keep_alive: Optional[Union[float, str]] = None,
252252
) -> Mapping[str, Sequence[float]]:
253+
"""
254+
Deprecated in favor of `embed`.
255+
"""
253256
return self._request(
254257
'POST',
255258
'/api/embeddings',
@@ -641,6 +644,9 @@ async def embeddings(
641644
options: Optional[Options] = None,
642645
keep_alive: Optional[Union[float, str]] = None,
643646
) -> Mapping[str, Sequence[float]]:
647+
"""
648+
Deprecated in favor of `embed`.
649+
"""
644650
response = await self._request(
645651
'POST',
646652
'/api/embeddings',

0 commit comments

Comments
 (0)