ag2 icon indicating copy to clipboard operation
ag2 copied to clipboard

Proposal: GPT-5 support & feature roadmap for AG2

Open elCaptnCode opened this issue 4 months ago • 0 comments

Summary

OpenAI has released GPT ‑5, their most advanced model series yet, with new variants and API features that will require significant updates in AG2 to support them effectively.

New Models

  • gpt ‑5: Designed for complex reasoning, broad world knowledge and code‑heavy tasks.
  • gpt ‑5‑mini: Cost‑optimised model for standard reasoning and chat.
  • gpt ‑5‑nano: High‑throughput model for simple instruction following.

GPT‑5 Features — Quick Reference Table

Feature What it does (TL;DR) How to use (Responses API)
Reasoning effort Control depth of thinking and latency. Set `"reasoning": { "effort": "minimal
Verbosity Control length of the model’s final answer. Set `"text": { "verbosity": "low
Custom tools Let tools receive freeform (non‑JSON) text (e.g., code, SQL). Define a tool with {"type":"custom","name":"code_exec","description":"..."} and include it under tools.
Allowed tools Restrict which tools the model may (or must) call. Use `"tool_choice": {"type":"allowed_tools","mode":"auto
Chain‑of‑thought passing Reuse prior turn’s reasoning to cut latency & cost. Include "previous_response_id": "<id>" on follow‑up calls (or pass earlier reasoning items in input).
Preambles Model briefly explains why before a tool call. Add a system instruction like: “Before you call a tool, explain why you are calling it.”

Backend Implementation Requirements (AG2)

High Priority

  • Update core response logic (e.g. LLMConfig and message pipelines) to support GPT‑5 parameters such as reasoning effort and verbosity.
  • Add new model enum values (GPT5, GPT5_MINI, GPT5_NANO) and update agent configuration defaults.
  • Introduce a dedicated GPT‑5 backend or extend existing backends to handle freeform tool inputs and allowed tools.
  • Audit and update existing tools to ensure compatibility with freeform inputs.

Medium Priority

  • Implement passing of Chain of Thought between turns for agents using GPT‑5.
  • Add global verbosity controls to help manage cost and output length.
  • Update pricing and cost estimation logic for the new model series.
  • Integrate allowed tools for safer tool usage.

Future Enhancements

  • Support OpenAI’s prompt optimizer for GPT‑5 in AG2.
  • Add encrypted reasoning items for zero data retention workflows.
  • Leverage preambles to improve transparency in tool calling.

Key Technical Details

  • GPT‑5 performs best when using the Responses API because it enables Chain of Thought passing.
  • Custom tools now accept freeform text inputs, not just JSON schemas.
  • The model series offers significant gains in coding and instruction‑following tasks along with new safety features for tool control.

Documentation

Implementation details should be documented in OPENAI_GPT5_MODELS.md.

Migration Path

For AG2 workflows currently using older models, we recommend:

  • o3gpt ‑5 (medium/high reasoning).
  • gpt ‑4.1gpt ‑5 (minimal/low reasoning).
  • o4‑mini/gpt ‑4.1‑minigpt ‑5‑mini.
  • gpt ‑4.1‑nanogpt ‑5‑nano.

Testing Strategy

  • Benchmark GPT‑5 models against existing GPT‑4o flows.
  • Verify tool compatibility with custom tool formats.
  • Analyze token and reasoning costs versus performance gains.
  • Test multi‑turn conversations with Chain of Thought enabled.

Please feel free to weigh in on these proposed requirements and priorities for bringing GPT‑5 support to AG2.

elCaptnCode avatar Aug 07 '25 19:08 elCaptnCode