openai.embeddings.create(input = texts, model=model).data in python

To access the data returned by openai.embeddings.create in Python, you can use the .data attribute. Here's an example:

main.py
import openai

# Specify your texts and model
texts = ["I love programming", "Python is a great language"]
model = "gpt-3.5-turbo"

# Create embeddings using the OpenAI API
response = openai.Embeddings.create(input=texts, model=model)

# Access the embeddings data
embeddings_data = response.data

# Print the embeddings data
print(embeddings_data)
349 chars
15 lines

The embeddings_data variable will contain the embeddings data returned by the API request. You can then use this data for further processing or analysis as per your requirements.

gistlibby LogSnag