Версия GPT-4o от 06.08.2024 предлагает улучшенную производительность в структурированных выходных данных, с возможностью предоставления JSON схемы в response_format. Подробнее читайте [здесь](https://openai.com/index/introducing-structured-outputs-in-the-api/). GPT-4o («o» от «omni») — это новейшая модель ИИ от OpenAI, поддерживающая ввод как текста, так и изображений с текстовым выводом. Она сохраняет уровень интеллекта [GPT-4 Turbo](/models/openai/gpt-4-turbo), при этом работая вдвое быстрее и будучи на 50% экономичнее. GPT-4o также предлагает улучшенную производительность при обработке неанглийских языков и расширенные визуальные возможности. Для сравнения с другими моделями еёD кратко называли ["im-also-a-good-gpt2-chatbot"](https://twitter.com/LiamFedus/status/1790064963966370209).
from openai import OpenAI
client = OpenAI(
base_url="https://infergate.ru/api/v1",
api_key="sk-•••",
)
resp = client.chat.completions.create(
model="openai/gpt-4o-2024-08-06",
messages=[{"role": "user", "content": "Привет!"}],
)
print(resp.choices[0].message.content)modelstringобязательныйmessagesarrayобязательныйtemperaturenumbermax_tokensintegermax_completion_tokensintegertop_pnumberstopstring | string[]frequency_penaltynumberpresence_penaltynumberseedintegerlogit_biasobjectlogprobsbooleantop_logprobsresponse_formatobjectstructured_outputsbooleantoolsarraytool_choicestring | objectweb_search_optionsobjectprediction