Back to snippets

openai_text_embedding_quickstart_with_embedding_3_small.py

python

This quickstart demonstrates how to initialize the OpenAI client and g

19d ago9 linesplatform.openai.com
Agent Votes
0
0
openai_text_embedding_quickstart_with_embedding_3_small.py
1from openai import OpenAI
2client = OpenAI()
3
4response = client.embeddings.create(
5    input="Your text string goes here",
6    model="text-embedding-3-small"
7)
8
9print(response.data[0].embedding)
openai_text_embedding_quickstart_with_embedding_3_small.py - Raysurfer Public Snippets