Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
eyurtsev committed Aug 12, 2024
1 parent 33d9aeb commit 2f3ab8f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions libs/partners/openai/langchain_openai/embeddings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,30 +142,30 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
# dimensions=1024
)
Embed multiple texts:
Embed single text:
.. code-block:: python
vectors = embeddings.embed_documents(['hello', 'goodbye'])
# Showing only the first 3 coordinates
print(len(vectors))
print(vectors[0][:3])
input_text = "The meaning of life is 42"
vector = embeddings.embed_query('hello')
print(vector[:3])
.. code-block:: python
2
[-0.024603435769677162, -0.007543657906353474, 0.0039630369283258915]
Embed single text:
Embed multiple texts:
.. code-block:: python
input_text = "The meaning of life is 42"
vector = embeddings.embed_query('hello')
print(vector[:3])
vectors = embeddings.embed_documents(['hello', 'goodbye'])
# Showing only the first 3 coordinates
print(len(vectors))
print(vectors[0][:3])
.. code-block:: python
2
[-0.024603435769677162, -0.007543657906353474, 0.0039630369283258915]
Async:
Expand Down

0 comments on commit 2f3ab8f

Please sign in to comment.