Feature: MultiAPI support - #72
Merged
Merged
Conversation
aberming
approved these changes
Feb 24, 2026
aberming
left a comment
There was a problem hiding this comment.
Looks good to me - didn't spot any issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support multi-API workflow search results (
api_references)Summary
The server-side
WorkflowSearchResultis changing to support workflows that span multiple APIs. The singleapi_name/api_id/api_versionfields are being replaced by anapi_references: list[APIReferenceSummary]field. This PR updates the Python SDK to handle the new format while maintaining full backward compatibility with the old format.Motivation
Workflows can reference multiple APIs (e.g., a workflow that reads from Slack and writes to Discord). The previous schema only allowed a single
api_nameper search result, which couldn't represent this. The newapi_referenceslist captures all APIs involved in a workflow.Changes
python/src/jentic/lib/models.pyAPIReferenceSummarymodel for the newapi_referencesentries_derive_api_name()helper that extracts a singleapi_namestring from either the legacy top-level field or the newapi_references[0]— provides seamless backward compatibilitySearchResultmodel:api_namechanged from required todefault=""so missing values don't break validationapi_references: list[APIReferenceSummary] | Nonefieldset_datavalidator now uses_derive_api_name()to handle both old and new formatsmatch_scorenow checks bothdistanceandmatch_scorekeys; workflow summary fallback chain isname → summary → workflow_idpython/src/jentic/lib/agent_runtime/api_hub.pysearch_api_capabilities: uses_derive_api_name()for workflow results, passes throughapi_references, and now correctly constructsSearchResponsewithresults/total_count/queryfieldsensure_api_names_in_response/_enrich_entity_with_api_name: simplified to use_derive_api_name()instead of full Pydantic model validation — handles both formats_search_alland_search_workflowsreferenced non-existentSearchRequestattributes (capability_description→query,max_results→limit,api_names→apis)New test files (36 tests)
tests/test_search_result_api_references.py— model-level tests for_derive_api_name,SearchResultwith new/legacy/operation formats,SearchResponsewith mixed results,APIReferenceSummarytests/agent_runtime/test_api_hub_search.py—ensure_api_names_in_responsewith both formats,search_api_capabilitiesend-to-end with new/legacy/multi-API workflow resultsBackward compatibility
The
_derive_api_name()priority chain ensures existing integrations keep working:api_namestring (old format) — used if present and non-emptyapi_references[0].api_name(new format) — fallback""— if neither existsConsumers that only read
result.api_namesee no change. Consumers that need all APIs can now accessresult.api_references.Test plan