1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GPT-5の新機能まとめ & 実例紹介【開発者向け】

Posted at

2025年8月に発表されたOpenAI GPT-5は、開発者にとって革命的なアップデートでした。この記事では、実際のAPI使用例・挙動の違い・新パラメータの使い所をコード付きで紹介します。


✅ 主な新機能一覧

機能 内容
reasoning_effort 応答にどれだけ「深く考えるか」を制御(minimalmaximal
verbosity 応答の長さを制御(lowhigh
context length 入力最大40万トークン、出力は12.8万トークン!
unified smart/thinking mode "think hard"などの自然言語プロンプトで高思考モードへ自動切替
マルチモーダル対応 テキスト・画像・音声・動画を一貫して処理可能(例:画像→コード化)
自動ツールチェーン実行 複数ツールの連携実行が可能に(JSONレスポンスでの指示呼び出しも進化)
Gmail/Google Calendar連携 ワークフロー自動化に最適な統合(OAuth2で接続可)

🧠 例1:reasoning_effortの違い

import openai

response = openai.chat.completions.create(
    model="gpt-5",
    messages=[
        {"role": "user", "content": "Explain quantum entanglement in simple terms."}
    ],
    extra_body={
        "reasoning_effort": "minimal",  # or "maximal"
    }
)

print(response.choices[0].message.content)
  • minimal: 高速な要約調の回答(1〜2文)
  • maximal: 物理学のメタファーや背景理論も含む精緻な解説(500語以上)

💬 例2:verbosityによる出力制御

response = openai.chat.completions.create(
    model="gpt-5",
    messages=[
        {"role": "user", "content": "What's the difference between TCP and UDP?"}
    ],
    extra_body={
        "verbosity": "low"  # → 要点だけ / "high" → 丁寧な長文で説明
    }
)
  • low → 1行で回答:「TCPは信頼性あり、UDPは速度重視」
  • high → ネットワーク構造やパケット再送の仕組みまで詳細解説

🔗 例3:「think hard」で高思考モード発動

response = openai.chat.completions.create(
    model="gpt-5",
    messages=[
        {
            "role": "user",
            "content": "Think hard: What's the optimal way to shard a PostgreSQL database for 100M users?"
        }
    ]
)

このプロンプトだけで、GPT-5は「深い思考ルート」に切り替わり、以下のような戦略的回答を返します:

“Based on user distribution, usage frequency, and data hotspots, you could consider range-based sharding on user ID modulo, and employ Citus or Vitess for transparent routing…”


📷 例4:画像からコードを生成(マルチモーダル)

UI sketch image

response = openai.chat.completions.create(
    model="gpt-5-vision",
    messages=[
        {"role": "user", "content": "Generate React code for this UI sketch"},
        {"role": "user", "image": open("upload-sketch.jpg", "rb")}
    ]
)

出力:React + Tailwind CSS構成のコンポーネントコード


🧩 例5:複雑なワークフローの自動化

{
  "tool_calls": [
    {
      "tool": "get_customer_data",
      "args": { "user_id": 123 }
    },
    {
      "tool": "send_email",
      "args": {
        "to": "customer@example.com",
        "subject": "Thanks!",
        "body": "Here is your data..."
      }
    }
  ]
}

→ GPT-5はこのチェーンを自動実行順序付きで処理可能。途中でのエラー検知・分岐処理もこなします。


🧠 まとめ

GPT-5はもはや「ただのチャットAI」ではなく、深く考えるAIプラットフォームへと進化しています。

  • 実装の柔軟性
  • カスタムパラメータによる精度制御
  • 圧倒的な文脈理解力
  • 自然言語だけで高度な指示も可能

業務効率化にも、開発補助にも、**“AIと本気で共創する時代”**が本格的に始まったと感じます。


📎 参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?