mirror of
https://github.com/kharonsec/ollama-python
synced 2026-05-09 16:42:13 +02:00
Merge pull request #216 from ollama/royh/embed-docs
Deprecate embeddings from docs in favor of embed
This commit is contained in:
10
README.md
10
README.md
@@ -101,10 +101,16 @@ ollama.pull('llama3.1')
|
||||
ollama.push('user/llama3.1')
|
||||
```
|
||||
|
||||
### Embeddings
|
||||
### Embed
|
||||
|
||||
```python
|
||||
ollama.embeddings(model='llama3.1', prompt='The sky is blue because of rayleigh scattering')
|
||||
ollama.embed(model='llama3.1', input='The sky is blue because of rayleigh scattering')
|
||||
```
|
||||
|
||||
### Embed (batch)
|
||||
|
||||
```python
|
||||
ollama.embed(model='llama3.1', input=['The sky is blue because of rayleigh scattering', 'Grass is green because of chlorophyll'])
|
||||
```
|
||||
|
||||
### Ps
|
||||
|
||||
@@ -278,6 +278,9 @@ class Client(BaseClient):
|
||||
options: Optional[Options] = None,
|
||||
keep_alive: Optional[Union[float, str]] = None,
|
||||
) -> Mapping[str, Sequence[float]]:
|
||||
"""
|
||||
Deprecated in favor of `embed`.
|
||||
"""
|
||||
return self._request(
|
||||
'POST',
|
||||
'/api/embeddings',
|
||||
@@ -698,6 +701,9 @@ class AsyncClient(BaseClient):
|
||||
options: Optional[Options] = None,
|
||||
keep_alive: Optional[Union[float, str]] = None,
|
||||
) -> Mapping[str, Sequence[float]]:
|
||||
"""
|
||||
Deprecated in favor of `embed`.
|
||||
"""
|
||||
response = await self._request(
|
||||
'POST',
|
||||
'/api/embeddings',
|
||||
|
||||
Reference in New Issue
Block a user