The getting started example is not working any more for AG UI Integration

Open Beginner friendly
#406 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
documentation

Research direction

Open agent-framework/integrations/ag-ui/backend-tool-rendering.md around line 549 and inspect the AG-UI chat client example. Compare its imports and tool-call display logic with the working changes shown in the issue. Done means the getting-started example no longer imports unavailable content classes and correctly displays tool calls and results.

Written by the indexing model from the issue text.

Description

https://github.com/MicrosoftDocs/semantic-kernel-docs/blob/cd35ecd6643ea156752a2b536b11b68ae73412b3/agent-framework/integrations/ag-ui/backend-tool-rendering.md?plain=1#L549

Error thrown on executing the AG_UI Chat client -

Traceback (most recent call last):
File "...\AG_UI_ChatClient.py", line 6, in
from agent_framework import Agent, ToolCallContent, ToolResultContent
ImportError: cannot import name 'ToolCallContent' from 'agent_framework' (...\Lib\site-packages\agent_framework_init_.py)

Proposed changes that are working -
............

Create AG-UI chat client

chat_client = AGUIChatClient(**endpoint**=server_url)

..........

Display tool calls and results

            for content in (update.contents or []):
                content_type = getattr(content, "type", "")
                if content_type == "function_call":
                    tool_name = getattr(content, "name", None) or "unknown"
                    print(f"\n\033[95m[Calling tool: {tool_name}]\033[0m")
                elif content_type in {"function_result", "tool_result"}:
                    result = getattr(content, "result", None)
                    if result is None:
                        result = getattr(content, "tool_result", None)
                    result_text = result if isinstance(result, str) else str(result)
                    print(f"\033[94m[Tool result: {result_text}]\033[0m")
Dominant language
Mermaid
Stars
263
Forks
167
Avg merge
3h 2m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MicrosoftDocs/semantic-kernel-docs

All issues in MicrosoftDocs/semantic-kernel-docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.