Skip to content

Python: add Xquik function tool sample#5890

Open
kriptoburak wants to merge 1 commit into
microsoft:mainfrom
kriptoburak:codex/xquik-function-tools-sample
Open

Python: add Xquik function tool sample#5890
kriptoburak wants to merge 1 commit into
microsoft:mainfrom
kriptoburak:codex/xquik-function-tools-sample

Conversation

@kriptoburak
Copy link
Copy Markdown

Motivation and Context

Fixes #5792.

This adds a concrete Python function-tool sample for API-key backed external research tools. It keeps Xquik write actions out of scope and uses local sample data when XQUIK_API_KEY is not set, so normal sample validation does not need new Xquik secrets.

Description

  • Adds xquik_function_tools.py under python/samples/02-agents/tools/.
  • Defines async @tool functions for Xquik read endpoints: post search, user lookup, user posts, and trends.
  • Uses FoundryChatClient with AzureCliCredential, matching the current default sample guidance.
  • Uses Python standard-library HTTP utilities, so the sample does not add dependencies.
  • Adds a tools folder README and documents the Xquik sample setup.

Focused validation run locally:

  • Ruff format and check for the new sample passed.
  • poe syntax sample check passed.
  • Targeted Pyright for xquik_function_tools.py passed.
  • Imported the sample with XQUIK_API_KEY empty and verified the Xquik tools return sample_data.
  • Repository-wide sample Pyright currently fails on unrelated existing 04-hosting/foundry-hosted-agents imports for agent_framework_foundry_hosting and azure.ai.agentserver.invocations; the new sample passes targeted Pyright.

Contribution Checklist

  • The code builds clean without any errors or warnings for the changed sample files
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
    • Sample-only change. I ran focused sample syntax, Ruff, Pyright, and offline tool import checks instead of the full unit suite.
  • Is this a breaking change? No.

Copilot AI review requested due to automatic review settings May 15, 2026 12:15
@moonbox3 moonbox3 added documentation Improvements or additions to documentation python labels May 15, 2026
@kriptoburak kriptoburak force-pushed the codex/xquik-function-tools-sample branch from 76e5bb9 to 9d785bd Compare May 15, 2026 12:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Python sample demonstrating how to expose API-key backed external research calls as Agent Framework async function tools, with an offline fallback so sample validation doesn’t require secrets.

Changes:

  • Added a new xquik_function_tools.py sample implementing read-only Xquik function tools (search posts, user lookup, user posts, trends).
  • Implemented a “no API key” path that returns deterministic local sample data.
  • Added a tools/README.md indexing tool samples and documenting the Xquik sample setup.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
python/samples/02-agents/tools/xquik_function_tools.py New sample implementing Xquik-backed async @tool functions with offline sample-data fallback and a runnable main().
python/samples/02-agents/tools/README.md New README enumerating function tool samples and documenting the Xquik sample prerequisites.

@kriptoburak kriptoburak force-pushed the codex/xquik-function-tools-sample branch 3 times, most recently from a2e9428 to 620d63a Compare May 15, 2026 18:09
@kriptoburak kriptoburak force-pushed the codex/xquik-function-tools-sample branch from 620d63a to 45067bc Compare May 15, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Add Xquik REST API function tool sample

3 participants