Back to snippets
openai_text_embedding_quickstart_with_embedding_3_small.py
pythonThis quickstart demonstrates how to initialize the OpenAI client and g
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)