Код: Выделить всё
import os
from openai import AzureOpenAI
client = AzureOpenAI(
api_key="[insert Azure OpenAI API key here]",
api_version="2023-07-01-preview",
azure_endpoint="https://[insert Azure OpenAI API enddpoint here].openai.azure.com/",
)
file = client.files.create(
file=open("./dummy.jsonl", "rb"),
purpose="batch"
)
file_id = file.id
Код: Выделить всё
{
"custom_id": "request-1",
"method": "POST",
"url": "/v1/chat/completions",
"body": {
"model": "gpt-3.5-turbo-0125",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello world!"
}
],
"max_tokens": 1000
}
}
Код: Выделить всё
BadRequestError: Error code: 400 - {'error': {'code': 'invalidPayload', 'message': 'Invalid value for purpose.'}}
Подробнее здесь: https://stackoverflow.com/questions/790 ... gpt-4o-min