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 authored and stainless-app[bot] committed May 16, 2024
1 parent 5c6814c commit 841ca57
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 841ca57

Please # to comment.