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

Openapi generator orchestration #146

Merged
merged 40 commits into from
Nov 14, 2024
Merged

Conversation

rpanackal
Copy link
Member

@rpanackal rpanackal commented Nov 8, 2024

Context

AI/ai-sdk-java-backlog#99.

Support oneOf from Orchestration spec using OpenAPI code generator.
Avoid template and spec modification.

Feature scope:

  • Generate model classes only
  • Freeze Interfaces generated, or rather avoid overwrite
  • Improved annotation of interfaces: Deserialisation by existence of properties.
  • Introduce property type based implementation resolver for oneOfs.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

MatKuhr and others added 28 commits October 22, 2024 21:55
- Introduce a generic fallback and LLMModuleResult specific
  deserializers.

- Generator ignoring all interfaces

- Adapt jackson annotations
# Conflicts:
#	orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java
#	orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java
#	sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java
#	sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
@rpanackal rpanackal self-assigned this Nov 8, 2024
@rpanackal rpanackal added the please-review Request to review a pull-request label Nov 8, 2024
@rpanackal rpanackal removed the please-review Request to review a pull-request label Nov 11, 2024
Roshin Rajan Panackal added 4 commits November 12, 2024 11:05
- Remove Generic fallback deserializer
- Beta Annotation on all concrete model classes.
- Introduce Mixin to override model annotations
- Improve variable naming
…SAP/ai-sdk-java into openapi-generator-orchestration

# Conflicts:
#	orchestration/src/main/java/com/sap/ai/sdk/orchestration/client/model/AzureContentSafetyFilterConfig.java
- Make deserializer lenient to allowed values
@rpanackal rpanackal added the please-review Request to review a pull-request label Nov 12, 2024
orchestration/pom.xml Outdated Show resolved Hide resolved
orchestration/pom.xml Outdated Show resolved Hide resolved
Comment on lines +30 to +35
assertThat(
((LLMModuleResultSynchronous) result.getOrchestrationResult())
.getChoices()
.get(0)
.getMessage()
.getContent())
Copy link
Contributor

@newtork newtork Nov 12, 2024

Choose a reason for hiding this comment

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

(Question/Major)

If I understand correctly, the PR changes public API in a way, that requires users to cast a result object to a specific class, before being able to read the response content. Is that correct? Is that the expected result?

Please also update the /docs/guides/ orchestration document.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

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

Beautiful stuff, LGTM

@MatKuhr MatKuhr merged commit a71d721 into main Nov 14, 2024
5 checks passed
@MatKuhr MatKuhr deleted the openapi-generator-orchestration branch November 14, 2024 12:29
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.

6 participants