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

[Orchestration] OSS Generator Improvements #158

Merged

Conversation

MatKuhr
Copy link
Member

@MatKuhr MatKuhr commented Nov 13, 2024

Context

  • Remove handling of streaming responses for simpler coding
  • Remove obsolete classes
  • Skip code generation by default with -Dgenerate property flag
  • Use maven clean plugin to keep generated code clean and fully generated
  • Fix checkstyle, PMD, etc.

Also contains a merge from main branch

@MatKuhr MatKuhr added the please-review Request to review a pull-request label Nov 14, 2024
JsonParser parser, DeserializationContext context, JavaType concreteType) throws IOException {
var defaultDeserializer = context.findRootValueDeserializer(concreteType);
return (LLMModuleResult) defaultDeserializer.deserialize(parser, context);
return mapper.readValue(rootNode.toString(), LLMModuleResultSynchronous.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed we'll only consider one implementation for the interface during deserialization.
I'm only wondering whether this can be solved in an easier way than dedicated deserializer.

Comment on lines +18 to +20
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.9.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

(Comment/Minor)

Still wondering whether this can be disabled?

@newtork newtork merged commit 5b4cdf6 into openapi-generator-orchestration Nov 14, 2024
3 checks passed
@newtork newtork deleted the openapi-generator-orchestration-fixes branch November 14, 2024 11:50
Copy link
Contributor

@newtork newtork left a comment

Choose a reason for hiding this comment

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

LGTM

MatKuhr added a commit that referenced this pull request Nov 14, 2024
* All hail the new orchestration client

* Leftovers

* Update code generatino ADR

* Minor comments

* Formatting

* Add javadoc and logging

* Added. More. Javadoc.

* Update sample HTML page

* Switch to error for empty content filter configs

* Simplify Exception

* Fix finish reason

* Fix type of Orchestration Response Messages

* Minor improvements

* Switch to deployment

* Update pom for using OSS generator

* Using original orchestration spec. Test contain descriminator

* Used OpenAPI generator for orchestration

* Using discriminator spec everywhere. test success.

* LLMModule specific deserializer ready. Test success.

* Generalized Fallback deserializer ready. Test success.

* OSS generator on customer facing orchestration spec

- Introduce a generic fallback and LLMModuleResult specific
  deserializers.

- Generator ignoring all interfaces

- Adapt jackson annotations

* Merging changes from main

* Merging changes from main

* Merging changes from main

* Formatting

* Clean up

- Remove Generic fallback deserializer
- Beta Annotation on all concrete model classes.
- Introduce Mixin to override model annotations
- Improve variable naming

* Update generated models

* Add test and improve deserializer

- Make deserializer lenient to allowed values

* [Orchestration] OSS Generator Improvements (#158)

* Simplifications and cleanup

* Remove parsing for streaming

* Reduce visibility of mixin class

* replace solution with custom deserializer to mixin

* remove unnecessary dependency jackson-databind-nullable

* Minor newline-reduction

* Minor syntax sugar

---------

Co-authored-by: Matthias Kuhr <matthias.kuhr@sap.com>
Co-authored-by: SAP Cloud SDK Bot <cloudsdk@sap.com>
Co-authored-by: Roshin Rajan Panackal <roshin.rajan.panackal@sap.com>
Co-authored-by: I538344 <charles.dubois@sap.com>
Co-authored-by: Matthias Kuhr <52661546+MatKuhr@users.noreply.github.com>
Co-authored-by: Alexander Dümont <alexander_duemont@web.de>
Co-authored-by: Alexander Dümont <22489773+newtork@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please-review Request to review a pull-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants