Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add allowed_operations init parameter to OpenAPITool #39

Merged
merged 10 commits into from
Sep 10, 2024

Conversation

vblagoje
Copy link
Member

@vblagoje vblagoje commented Jul 19, 2024

Why:

Introduces operation filtering in OpenAPITool to refine tools registration for LLM usage. OpenAPI specs have sometimes hundreds of operations making it unfeasible for LLM tools registration. This change allows users to register only a subset of operations from OpenAPI spec and more importantly makes long specs usable in OpenAPITool.

What:

  • Added allowed_operations parameter in OpenAPITool to specify which API operations (tools) to register with LLMs.
  • Expanded schema converters with an additional parameter to filter operations.

How can it be used:

openapi_tool = OpenAPITool(
    generator_api=LLMProvider.OPENAI,
    spec='path/to/your/spec.json',
    allowed_operations=['specificOperationId']
)

How did you test it:

  • Unit tests for new logic in schema converters and operation filtering.
  • Integration tests for OpenAPI client configuration with allowed_operations.
  • Manual testing with sample configurations.

Notes for the reviewer:

  • Verify operation filtering logic across all LLM providers.
  • Review linter configuration adjustments.
  • Consider additional edge cases for testing.

@vblagoje vblagoje requested a review from a team as a code owner July 19, 2024 12:43
@vblagoje vblagoje requested review from shadeMe and removed request for a team July 19, 2024 12:43
@coveralls
Copy link

coveralls commented Jul 19, 2024

Pull Request Test Coverage Report for Build 10769856598

Details

  • 31 of 31 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 93.788%

Totals Coverage Status
Change from base Build 10739348969: 0.1%
Covered Lines: 3276
Relevant Lines: 3493

💛 - Coveralls

@vblagoje vblagoje merged commit 5efff0a into main Sep 10, 2024
5 checks passed
@vblagoje vblagoje deleted the openapi_filter branch September 10, 2024 09:26
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.

3 participants