Skip to content

Commit

Permalink
chore(examples): embedding example
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-wu-97 committed May 15, 2024
1 parent 3807b4c commit 961159c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/embedding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from groq import Groq

client = Groq()

embedding = client.embeddings.create(
#
# Required parameters
#
# The input texts to embed.
input=["hello world"],
# The model to use.
model="nomic-embed-text-v1.5",
#
# Optional parameters
#
# Format to return the embeddings in.
# Only "float" is supported at the moment.
encoding_format="float",
# A unique identifier representing your end-user.
user="user",
)

print(embedding)

0 comments on commit 961159c

Please sign in to comment.