Skip to content

feat: add async multi-agent model example - #188

Open
nisweesi wants to merge 2 commits into
xai-org:mainfrom
nisweesi:feature/multi-agent-model-example
Open

feat: add async multi-agent model example#188
nisweesi wants to merge 2 commits into
xai-org:mainfrom
nisweesi:feature/multi-agent-model-example

Conversation

@nisweesi

Copy link
Copy Markdown

Add async multi-agent model example

Checklist

  • I have read both the CONTRIBUTING.md and Contributor License Agreement documents.
  • I have created an issue or feature request and received approval from xAI maintainers. (minor changes like fixing typos can skip this step)
  • I have tested my changes locally and they pass all CI checks.
  • I have added necessary documentation or updated existing documentation.

Description

This PR adds a new asynchronous example demonstrating how to use the grok-4.20-multi-agent model with the xAI SDK.

The example shows how to:

  • Configure the number of agents
  • Enable web search and X search tools
  • Submit a research prompt
  • Use either chat.sample() or chat.stream()
  • Display reasoning-token progress when enabled
  • Print the final response and request cost

The purpose is to provide SDK users with a clear reference for running multi-agent research requests asynchronously.

Related Issue

If applicable, link to the related feature request or bug report issue (e.g., #123). If none, state "N/A".

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Other (please specify)

Additional Notes

Add any other information or context that might be helpful for reviewers.

@nisweesi
nisweesi requested a review from a team as a code owner July 31, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant