Skip to content

feat(stackone): add StackOne AI integration#3

Open
ryoppippi wants to merge 26 commits intomainfrom
ENG-10848-try-to-get-listed-as-third-party-toolset-on-pydantic
Open

feat(stackone): add StackOne AI integration#3
ryoppippi wants to merge 26 commits intomainfrom
ENG-10848-try-to-get-listed-as-third-party-toolset-on-pydantic

Conversation

@ryoppippi
Copy link
Copy Markdown

@ryoppippi ryoppippi commented Jan 22, 2026

Summary

Add StackOne AI integration enabling AI agents to access 200+ SaaS integrations (HRIS, ATS, LMS, CRM, IAM, etc.) through a unified API.

Changes

  • Add tool_from_stackone() for individual tool integration
  • Add StackOneToolset for bulk registration with glob pattern filtering
  • Add comprehensive unit tests with 100% coverage
  • Add documentation and usage examples

New Files

  • pydantic_ai_slim/pydantic_ai/ext/stackone.py - Core integration module
  • tests/test_ext_stackone.py - Unit tests
  • examples/stackone_integration.py - Usage examples

Documentation Updates

  • docs/install.md - Added stackone extra
  • docs/third-party-tools.md - Added StackOne tools section
  • docs/toolsets.md - Added StackOne toolset section

Dependencies

  • stackone-ai>=2.1.1 (requires Python 3.10+, same as Pydantic AI)

Test plan

  • Unit tests pass (uv run pytest tests/test_ext_stackone.py)
  • StackOne-specific pyright check passes
  • Pre-commit checks pass (except existing upstream pyright issues unrelated to this PR)

Jira: ENG-10848

Add integration with StackOne unified API platform for HRIS, ATS, CRM,
and other business systems.

- Add `tool_from_stackone()` for single tool creation
- Add `StackOneToolset` for bulk tool registration with pattern matching
- Require stackone-ai>=2.1.1 (Python 3.10+)
- Add documentation and examples
- Add comprehensive unit tests with 100% coverage
@ryoppippi ryoppippi force-pushed the ENG-10848-try-to-get-listed-as-third-party-toolset-on-pydantic branch from d77e04f to 888b2d4 Compare January 22, 2026 11:26
@ryoppippi ryoppippi changed the title feat: add StackOne AI integration for Pydantic AI feat(stackone): add StackOne AI integration Jan 22, 2026
- Fix StackOne URL from .co to .com
- Update description to reflect current positioning as "AI Integration Gateway"
Copy link
Copy Markdown

@glebedel glebedel left a comment

Choose a reason for hiding this comment

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

We should update the examples but also add the meta tools! That would be a great value-add and differentiator for pydantic too because they might not have this concept at all.

eg. via import search_tool & execute_tool and that could take any tools, stackone tools for sure but also any other pydantic tools (eg. let's say the exa one)

Add search_tool, execute_tool, and feedback_tool functions that wrap
StackOne's utility tools API (tool_search, tool_execute, tool_feedback).

Extend StackOneToolset with new options:
- include_utility_tools: enables dynamic tool discovery mode
- include_feedback_tool: adds feedback collection capability
- hybrid_alpha: configures BM25/TF-IDF search weight

Update documentation and examples to reflect the new API.
Update minimum version requirement to 2.3.0 which includes the
utility_tools API (tool_search, tool_execute, tool_feedback).
- Update StackOneToolset tests to match new implementation that uses
  _tool_from_stackone_tool directly instead of tool_from_stackone
- Add test for include_utility_tools option
- Mark docstring examples with test="skip" to avoid linting issues
- Remove `{test="skip"}` from docstring examples
- Simplify StackOneToolset example to match ExaToolset pattern
- Move Args documentation from class docstring to __init__ method
- Remove verbose examples from search_tool, execute_tool, feedback_tool
- Fix pyright type error in test file with ignore comment
- Replace hris_* with stackone_* in filter_pattern example
- Replace hris_list_employees/hris_get_employee with stackone_* tools
- Update description to remove 'unified interface' terminology
…_*/stackone_*

Per PR review feedback, update all examples and tests to use actual StackOne
provider naming patterns like 'bamboohr_*' and 'workday_*' instead of
fictional 'hris_*' or 'stackone_*' patterns.

- Update docs/toolsets.md examples
- Update docs/third-party-tools.md examples
- Update examples/stackone_integration.py
- Update tests/test_ext_stackone.py
- Update docstrings in pydantic_ai_slim/pydantic_ai/ext/stackone.py
@ryoppippi ryoppippi requested a review from glebedel January 30, 2026 15:53
- Format test file with ruff to fix line length issues
- Add {test="skip"} to StackOneToolset docstring example to skip
  example test that requires stackone-ai package
Add stackone.py and test_ext_stackone.py to coverage omit list,
similar to aci.py and exa.py which are also external integrations.
@glebedel glebedel requested a review from Shashikant86 February 3, 2026 11:31
@shashi-stackone shashi-stackone requested review from shashi-stackone and removed request for Shashikant86 February 23, 2026 16:03
@shashi-stackone
Copy link
Copy Markdown

Managed to get the CI passing now also noticed that in the Docs we are adding too many tools strategies there.

@glebedel Comparing to the others they just added how to use a toolset and multiple tools and thats's it .. having the Dynamic Discovery, Feedback and Search (semantic/lexical) would be great but we are adding too much on the page in the docs.

Copy link
Copy Markdown

@shashi-stackone shashi-stackone left a comment

Choose a reason for hiding this comment

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

Made some changes to get CI and addressed some feedback

@shashi-stackone shashi-stackone marked this pull request as ready for review February 26, 2026 15:25
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="pydantic_ai_slim/pydantic_ai/ext/stackone.py">

<violation number="1" location="pydantic_ai_slim/pydantic_ai/ext/stackone.py:16">
P2: According to linked Jira issue ENG-10848, the StackOne integration must expose the meta search/execute (& feedback) tools. This change removes those exports and the toolset no longer provides any path to include utility tools, so the requirement is no longer met.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

search='auto',
)

agent = Agent('google-gla:gemini-2.5-flash', toolsets=[toolset])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think our example should have a different model (better at tool calling), eg. haiku

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should gemimi-3 fine here? As I tested examples with Google API KEY?

from pydantic_ai.ext.stackone import StackOneToolset

toolset = StackOneToolset(
search_query='list and manage employees',
Copy link
Copy Markdown

@glebedel glebedel Mar 10, 2026

Choose a reason for hiding this comment

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

does it make sense to do the search ahead of the agent call? Shouldn't it be more that the agent has search tool in the stackone toolset?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think Pydantic AI toolsets define their tools at construction time and not sure it support dynamically adding tools during an agent run.. I will double check the source but pretty sure not

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

i'm not talking about adding tools during an agent run, i'm talking about having search & execute in the agent run.
What i don't understand here is why do you even have a search query? it's the agent/llm that should decide the query and use the search tool provided in agent declaration?


def test_tool_execution():
tool = stackone_ext._tool_from_stackone_tool(employee_tool)
result = tool.function(limit=10) # type: ignore
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

do we need the # type: ignore here? is that best practice?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added to make pyright happy on CI should be ok here for dynamically-created schema, removing cause type error .

)

agent = Agent(
'google-gla:gemini-2.5-flash',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ditto on model

Copy link
Copy Markdown

@glebedel glebedel left a comment

Choose a reason for hiding this comment

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

not sure the search example makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants