From 841ca57321f7ff89a681675d4cc557354e77f184 Mon Sep 17 00:00:00 2001 From: Jordan Wu <101218661+jordan-definitive@users.noreply.github.com> Date: Wed, 15 May 2024 11:32:40 -0700 Subject: [PATCH] chore(examples): embedding example --- examples/embedding.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/embedding.py diff --git a/examples/embedding.py b/examples/embedding.py new file mode 100644 index 0000000..3ebc2ea --- /dev/null +++ b/examples/embedding.py @@ -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)