Чтобы создать помощника, я адаптировал код с сайта Microsoft.com:
Код: Выделить всё
client = AzureOpenAI(
api_key=AZURE_OPENAI_API_KEY,
azure_endpoint=AZURE_OPENAI_ENDPOINT,
api_version="2024-05-01-preview",
azure_deployment=AZURE_DEPLOYMENT
)
# Create an assistant
assistant = client.beta.assistants.create(
name="Math Assist",
instructions="You are an AI assistant that can write code to help answer math questions.",
tools=[{"type": "code_interpreter"}],
model=AZURE_DEPLOYMENT)
Код: Выделить всё
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
Подробнее здесь: https://stackoverflow.com/questions/786 ... redentials