feat(openapi): create openapi toolset#292
Open
AmaadMartin wants to merge 8 commits intogoogle:mainfrom
Open
Conversation
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.
Link to Issue or Description of Change
Or, if no issue exists, describe the change:
Problem:
The
adk-jsrepository lacked the ability to automatically generate tools from OpenAPI specifications, requiring developers to manually define tools for REST APIs and limiting parity with the Python implementation.Solution:
Implemented the OpenAPI Toolset feature, adding a complete suite of tools and parsers to handle OpenAPI specifications:
OpenAPIToolset(openapi_toolset.ts): A new toolset class that parses an OpenAPI specification and generates a set ofRestApiToolinstances.RestApiTool(rest_api_tool.ts): A generic tool capable of executing REST API calls, mapping arguments to path, query, header, and body parameters.OpenApiSpecParser: IncludessanitizeSchemaTypesto ensure schema compatibility.ToolAuthHandler: Includes a credential store in the session state for caching resolved credentials.Testing Plan
Unit Tests:
Summary of passed results:
openapi_tooldirectory.auth/auth_helpers.ts: 100%openapi_spec_parser/tool_auth_handler.ts: 100%auth/credential_exchangers/auto_auth_credential_exchanger.ts: 100%rest_api_tool.ts: 95.78%openapi_spec_parser/openapi_spec_parser.ts: 94.81%openapi_spec_parser/operation_parser.ts: 93.60%openapi_toolset.ts: 93.58%auth/credential_exchangers/service_account_exchanger.ts: 93.54%Integration Tests:
OpenAPIToolsetcan parse sample specs and execute tools with mocked fetch.Checklist