Code: Select all
client = AzureOpenAI(
api_key="sk-YOUR_API_KEY",
azure_endpoint="https:/smth.openai.azure.com/"
)
response = client.embeddings.create(
input="Your text string goes here",
model="text-embedding-3-small"
)
< /code>
Ich habe es versucht, diesen Fehler zu erhalten: < /p>
OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
< /code>
und < /p>
NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}