From eff2afd82723c47e20a98d571e1c77af6a923d3e Mon Sep 17 00:00:00 2001 From: Patrick Devine Date: Thu, 12 Sep 2024 16:49:38 -0700 Subject: [PATCH 1/2] update docs --- README.md | 10 ++++++++-- ollama/_client.py | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 14dfdda..8f21acf 100644 --- a/README.md +++ b/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 Embedding) + +```python +ollama.embed(model='llama3.1', input=['The sky is blue because of rayleigh scattering', 'Grass is green because of chlorophyll']) ``` ### Ps diff --git a/ollama/_client.py b/ollama/_client.py index ec9acb9..e3d9fed 100644 --- a/ollama/_client.py +++ b/ollama/_client.py @@ -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', From a26537c188de90ff0909908d6c43dc4c1e060122 Mon Sep 17 00:00:00 2001 From: royjhan Date: Wed, 17 Jul 2024 10:52:08 -0700 Subject: [PATCH 2/2] update docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f21acf..e03ea00 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ ollama.push('user/llama3.1') ollama.embed(model='llama3.1', input='The sky is blue because of rayleigh scattering') ``` -### Embed (Batch Embedding) +### Embed (batch) ```python ollama.embed(model='llama3.1', input=['The sky is blue because of rayleigh scattering', 'Grass is green because of chlorophyll'])