generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 15
feat: [Orchestration] Spring AI integration #278
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
46f4ba4
WiP
CharlesDuboisSAP ebc21ff
WiP 2
CharlesDuboisSAP ed7c6e4
finito
CharlesDuboisSAP 3cc0dd0
WiP
CharlesDuboisSAP c5a43a0
WiP 2
CharlesDuboisSAP d496c13
finito
CharlesDuboisSAP 002f677
Merge remote-tracking branch 'origin/bean' into bean
CharlesDuboisSAP ccbcd64
Formatting
bot-sdk-js 605a51d
docs
CharlesDuboisSAP 7155ad5
Merge remote-tracking branch 'origin/bean' into bean
CharlesDuboisSAP d45a397
repo in parent pom
CharlesDuboisSAP 8c751be
Formatting
bot-sdk-js e7e5a9d
Update docs
CharlesDuboisSAP ab63181
Merge remote-tracking branch 'origin/bean' into bean
CharlesDuboisSAP 529b37e
Aligned headers
CharlesDuboisSAP d064734
Added no args constructor
CharlesDuboisSAP 2d20234
Removed spring-ai-app
CharlesDuboisSAP 15f4347
Merge branch 'refs/heads/main' into bean
CharlesDuboisSAP afa6f9f
Added images in index.html
CharlesDuboisSAP bc0f64a
Alex's review comments
CharlesDuboisSAP efe05e1
Shorter
CharlesDuboisSAP 2133fc4
Added instructions
CharlesDuboisSAP 6cdd6a7
M5
CharlesDuboisSAP 6c5a512
fixed copy
CharlesDuboisSAP 0fd5e10
Formatting
bot-sdk-js 5088e7d
removed warnings
CharlesDuboisSAP 6ade28f
green CI
CharlesDuboisSAP da7d72e
Fixed controller, added service
CharlesDuboisSAP be64b9e
Removed chat Memory
CharlesDuboisSAP 5ffb8ec
Merge branch 'main' into bean
CharlesDuboisSAP 5f6a163
Alex's review
CharlesDuboisSAP ad2b83b
Better documentation
CharlesDuboisSAP b94276d
Added images
CharlesDuboisSAP 6f549d9
Better images
CharlesDuboisSAP 46c84ca
mb
CharlesDuboisSAP 6e49163
added note
CharlesDuboisSAP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Spring AI Integration | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| - [Introduction](#introduction) | ||
| - [Orchestration Chat Completion](#orchestration-chat-completion) | ||
| - [Orchestration Masking](#orchestration-masking) | ||
|
|
||
| ## Introduction | ||
|
|
||
| This guide provides examples of how to use our Spring AI integration with our clients in SAP AI Core | ||
| for chat completion tasks using the SAP AI SDK for Java. | ||
|
|
||
| ## Orchestration Chat Completion | ||
|
|
||
| The Orchestration client is integrated in Spring AI classes: | ||
|
|
||
| ```java | ||
| ChatModel client = new OrchestrationChatModel(); | ||
| OrchestrationModuleConfig config = new OrchestrationModuleConfig().withLlmConfig(GPT_35_TURBO); | ||
| OrchestrationChatOptions opts = new OrchestrationChatOptions(config); | ||
|
|
||
| Prompt prompt = new Prompt("What is the capital of France?", opts); | ||
| ChatResponse response = client.call(prompt); | ||
| ``` | ||
|
|
||
| Please | ||
| find [an example in our Spring Boot application](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/SpringAiOrchestrationController.java). | ||
|
|
||
| ## Orchestration Masking | ||
|
|
||
| Configure Orchestration modules withing Spring AI: | ||
|
|
||
| ```java | ||
| ChatModel client = new OrchestrationChatModel(); | ||
| OrchestrationModuleConfig config = new OrchestrationModuleConfig().withLlmConfig(GPT_35_TURBO); | ||
|
|
||
| val masking = | ||
| DpiMasking.anonymization() | ||
| .withEntities(DPIEntities.EMAIL, DPIEntities.ADDRESS, DPIEntities.LOCATION); | ||
|
|
||
| val opts = new OrchestrationChatOptions(config.withMaskingConfig(masking)); | ||
| val prompt = | ||
| new Prompt( | ||
| "Please write 'Hello World!' to me via email. My email address is [email protected]", | ||
| opts); | ||
|
|
||
| ChatResponse response = client.call(prompt); | ||
| ``` | ||
|
|
||
| Please | ||
| find [an example in our Spring Boot application](../../sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/SpringAiOrchestrationController.java). |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Comment)
Why the drive-by changes 😅
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ## adds underlines which makes it more readable because the file is super long, it also aligns with the other files.
underline