feat: Retire openapi3, use openapi-service-client instead #7514
+275
−1,346
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.
Why:
The pull request eviscerates the underlying openapi3 library used under the hood in
OpenAPIServiceConnector
and replaces it with out own openapi library. The main motivations for replacement of the old library are:These bugs were related to their mechanism of checking for responses being valid as defined by schema. In theory that works great but one could not make this validation step optional and they had a few bugs in there + developers sometimes make tiny mistakes defining schemas in OpenAPI specs. Validation doesn't matter at all for LLMs and we can add this request/response validation later or not at all. A third party lib like pydanticv2 can do the validation of both.
What:
OpenAPI
library usage withopenapi-service-client
library abstractions.OpenAPIServiceToFunctions
OpenAPI schema -> LLM tools translation with use ofget_tools_definitions
invocationopenapi-service-client
library)openapi-service-client
library and the tests testing openapi integration in previous versions of these components do need to be duplicatedHow can it be used:
to:
How did you test it:
OpenAPIServiceClient
instead ofOpenAPI
. The mocking and assertions were adapted to the new implementation.Notes for the reviewer:
openapi3
is replaced withopenapi-service-client
to ensure that all of the intended functionality is preserved.