-
Notifications
You must be signed in to change notification settings - Fork 8
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: (Grounding) Initial client classes with generated API and model #317
base: main
Are you sure you want to change the base?
Conversation
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.
generally lgtm, I assume we do all the other release-relevant things once we actually set this to be released.
grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java
Outdated
Show resolved
Hide resolved
grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingServiceTest.java
Outdated
Show resolved
Hide resolved
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.
LGTM so far 👍🏻
if we set this to released, we'd also need some minimal E2E test, sample code, docs & release note. Do you want to do this in a separate PR? (if so, maybe set this to unreleased for now so that we don't release it by accident 😉 )
For E2E tests / sample code, I'd consider at least a GET request. Maybe you can also copy the JS test where they cover creating and deleting a collection == repository. If so, please do that in the dedicated RG for Java.
grounding/src/main/java/com/sap/ai/sdk/grounding/GroundingClient.java
Outdated
Show resolved
Hide resolved
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java
Outdated
Show resolved
Hide resolved
|
||
// we don't have testable data yet, but the endpoint works without errors |
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.
When will we get data?
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.
I created a backlog item for that.
JS colleagues also have no test yet.
} | ||
} | ||
|
||
void testCollectionsGetAll() { |
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.
When will this be tested?
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.
It's tested as part of the big test suite testCreateDeleteCollection()
.
If you prefer, I'm okay with testing it as additional dedicated @Test
case.
grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java
Outdated
Show resolved
Hide resolved
"response": { | ||
"status": 200, | ||
"headers": { | ||
"Content-Type": "application/json" |
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.
how does the unit testing work?
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.
WireMock supports file-based stubbing
With that, you can define {"reqest: ": {...}, "response": {...}}
in JSON format.
(+) less verbose JSON in unit test code
(-) payload decoupled from unit test cases
I wanted to see it in comparison with our other tests. We used the approach in Cloud SDK in some cases.
I'm fine with changing from this implicit to our regular explicit format, if requested.
…ntTest.java Co-authored-by: Charles Dubois <[email protected]>
Co-authored-by: Charles Dubois <[email protected]>
Context
https://github.com/SAP/ai-sdk-java-backlog/issues/160
Generated model and API classes for grounding services.
Feature scope:
API for Grounding
The PR suggests the following API to interact with Grounding:
Definition of Done
Error handling created / updated & covered by the tests aboveAligned changes with the JavaScript SDKDocumentation updatedRelease notes updated