Tags: ag2ai/ag2
Tags
feat: AG2.1 beta (#2439) * feat: introduce beta module * refactor: add Askable protocol * feat: support prompt management & tools draft * lint: fix Client protocol * feat: support tools execution * feat: introduce usage * chore: update copyrighting * refactor: make prompt decorator callable * feat: inroduce DI * feat: inroduce subscribers DI, HITL, custom exceptions, testclient * fix: correct inheritance * fix: align inheritance * test: add tests for config passing * feat: provide all OpenAI client options to config * feat: support config copy semantic * feat: AG2 GroupChat interop * LLM Clients: OpenAI Responses, Anthropic, Alibaba DashScope, Google, Ollama * chore: add Mark as beta clients codeowner * chore: reorder tests * refactor: reorginize clients * refactor: create structures mappers * refactor: update tool_to_api mappings and consolidate message conversion logic across clients * refactor: remove unused FunctionToolSchema.to_api Made-with: Cursor * docs: restructure beta docs and add Agent Tools page Move beta.mdx to beta/index.mdx, add tools.mdx and placeholder pages (stream, variables, dependency_injection, group_chat_compatibility, testing). Update Mintlify Beta tab and sidebar to docs/beta/index and docs/beta/tools. Ignore .agents/skills and skills-lock.json in .gitignore. Adjust test_naming expected schema for Field(ge=1). Co-authored-by: Cursor <cursoragent@cursor.com> * docs: improve beta agent tools documentation Rewrite tools.mdx using Diátaxis principles, expanding on why/how of tools, synchronous/asynchronous execution, and schemas with realistic examples. Also updates beta index title. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add comprehensive variables documentation Adds complete explanation and examples for Conversation Variables, including Context access, Variable annotations, agent/call level variables, and default values. Also adds it to the beta navigation menu in the mint template. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add dependency injection documentation Write comprehensive documentation for dependency injection based on test_tools_di.py, covering Context dependencies, agent/conversation overrides, Inject, and Depends annotations. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: refine dependency injection and variable documentation Adds complete documentation for dependency injection default values, updates variables terminology, and includes missing test scenarios for DI. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add Depends documentation to beta Add depends.mdx explaining the Depends mechanism for dynamic dependency injection, side-execution, caching, and overrides. Update dependency_injection.mdx to clarify Inject usage. Add new docs to mint-json-template navigation and initialize placeholder files for future beta docs. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: reorganize beta docs and add context features section Move inject and variables documentation into a new context/ subdirectory. Add placeholders for human_in_the_loop, ag2_group_chat, stream, and testing. Update mint-json-template for the new navigation structure and fix internal links in tools and depends docs. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add model configuration guide to beta docs Add comprehensive documentation for model configuration in the beta framework. Cover supported providers, basic setup, environment variables, self-hosted endpoints, configuration reuse, and delayed configuration. Add roadmap.mdx placeholder and update mint-json-template navigation. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: improve human in the loop documentation Add detailed explanation of HITL, usage from context, and registration methods. Add new pages to mint.json. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add AG2 GroupChat compatibility guide for beta agents - Added `website/docs/beta/ag2_group_chat.mdx` covering compatibility with GroupChat, Sequential chat, and ContextVariables - Removed experimental `client.py` as it has been documented - Renamed `website/docs/beta/agent.mdx` to `website/docs/beta/agents.mdx` for consistency Made-with: Cursor * docs(beta): add advanced stream documentation Add documentation for stream interrupters, stream context support, and custom streams Co-authored-by: Cursor <cursoragent@cursor.com> * test: simplify TestConfig usage and add testing docs Allow passing strings and ToolCall directly to TestConfig for easier test writing. Add comprehensive documentation for testing in beta. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(beta): add prompt management documentation Add comprehensive documentation for system prompts, dynamic prompts, and prompt updates in the beta framework. Update PromptHook type hint in agent.py to use ModelRequest instead of BaseEvent. Co-authored-by: Cursor <cursoragent@cursor.com> * feat: enhance dynamic prompts with context injection and async support Update agent.py to wrap prompt hooks for dependency injection and support both sync/async callbacks. Update system_prompts.mdx documentation with relevant context capability details and links. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: improve agents.mdx documentation Enhance Agents page to be more descriptive and user-focused, abstracting away some implementation details, emphasizing features like tools, HITL, and event streaming observation. Switched example configs to use gpt-4o-mini. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: translate and improve AG2 Beta index documentation Translate Russian content to English, add clear sections (Why AG2 Beta, What is AG2 Beta, Compatibility, Focus Areas), improve readability and align with tech-writing best practices. Co-authored-by: Cursor <cursoragent@cursor.com> * Anthropic caching * Dashscope duplicate * Fix Responses API tool format — use top-level name field The Responses API expects {type: "function", name: ...} at the top level, not nested under a "function" key like Chat Completions. Added tool_to_responses_api() mapper and updated the client to use it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add agent turns middleware * feat: add tools execution middleware * feat: add llm calls middleware * fix: allow to mutate LLMCall result in middlewares * feat: add HistoryLimiter middleware * feat: add LLMRetry middleware * feat: add TokenLimiter middleware * feat: add Stream.join support * docs: add Middlewares documentation * docs: reorder middlewares page * Fix parameterless tool schemas for OpenAI, Anthropic Ollama * Documentation updates * Documentation updates * Docs revised, middlewares > middleware * Tidy * feat: add content property for model result * feat: rename entities * Ignore intentional declaration of init and repr in EventMeta * docs: add AG2 Beta blogpost * fix: guard optional SDK imports in beta clients * Make type annotations lazy on clients * docs: store blog images as LFS pointers * tests: fix failing import test * docs: update screenshots * tests: fix textual imports * docs: mark screenshots by LFS * Blog tweaks * tests: fix textual imports * refactor: revisit imports guardrails * Blog tweaks * refactor: return toolschemas * refactor: fix all clients to match new tools * refactor: polish autogen.beta.tools public imports * refactor: pass Context to schema factory * tests: add WebSearch mappers tests * feat: add Toolkit for grouping reusable tools Toolkit accepts plain functions and @tool-decorated functions, supports @toolkit.tool and @toolkit.tool() decorator syntax for registering tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: change Toolkit to accept *tools varargs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: support Python 3.14+ PEP 649 lazy annotations in EventMeta Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: move tool modules to tools/final and fix imports Move function_tool, client_tool, and toolkit into the tools/final subpackage. Update all imports across source and test files to use the new paths. Rename ctx → context in Tool protocol and WebSearchTool. Fix license header year in test_naming.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add user_location support to WebSearchTool Allow setting approximate user location (city, region, country, timezone) to improve web search result relevance. Mapped to both OpenAI Responses API and Anthropic API formats. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: replace Pydantic BaseModel with dataclasses for tool schemas Migrate ToolSchema, FunctionDefinition, FunctionToolSchema, and WebSearchToolSchema from Pydantic to plain dataclasses to reduce dependency overhead. Add Variable resolution support to WebSearchTool via a new _resolve module. Update tests to use dataclasses.asdict() instead of model_dump(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: remove optional_import_block wrappers and normalize __all__ to tuples Remove unnecessary optional_import_block usage in beta config modules since these are direct internal imports. Normalize __all__ from lists to tuples for consistency. Add beta optional deps to docs extras in pyproject.toml. * chore: bump version * lint: fix precommit * Spelling fix * Tidy and blog date update * Roadmap tweak * Fix Self import * Python compatibility updates * Blog tweaks --------- Co-authored-by: Mark Sze <mark@sze.family> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Mark Sze <66362098+marklysze@users.noreply.github.com>
fix: Using Structured Outputs and Streaming with OpenAI client fails (#… …2234) * OpenAI Chat Completions client structured output with streaming fix * Avoid streaming logic with OpenAI and structured outputs * Tidy * Tidy and tests * Defensive use of usage attribute * Integration tests * Test Transition fix * Test file fix
PreviousNext