Skip to content

Commit 1ec88ed

Browse files
authored
Merge pull request #216 from ollama/royh/embed-docs
Deprecate embeddings from docs in favor of embed
2 parents 89e8b74 + a26537c commit 1ec88ed

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.1')
101101
ollama.push('user/llama3.1')
102102
```
103103

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

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

110116
### Ps

ollama/_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ def embeddings(
278278
options: Optional[Options] = None,
279279
keep_alive: Optional[Union[float, str]] = None,
280280
) -> Mapping[str, Sequence[float]]:
281+
"""
282+
Deprecated in favor of `embed`.
283+
"""
281284
return self._request(
282285
'POST',
283286
'/api/embeddings',
@@ -698,6 +701,9 @@ async def embeddings(
698701
options: Optional[Options] = None,
699702
keep_alive: Optional[Union[float, str]] = None,
700703
) -> Mapping[str, Sequence[float]]:
704+
"""
705+
Deprecated in favor of `embed`.
706+
"""
701707
response = await self._request(
702708
'POST',
703709
'/api/embeddings',

0 commit comments

Comments
 (0)