Skip to content

Commit 67840db

Browse files
authored
Merge branch 'main' into openapi-generator-orchestration
2 parents 4e7eb97 + 74df6a1 commit 67840db

File tree

253 files changed

+671
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+671
-511
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Bug Report
2+
description: Released feature does not work as expected in the SAP Cloud SDK for AI (Java).
3+
labels:
4+
- bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
This repository is for Java related issues only. Please open [JavaScript / TypeScript issues here](https://github.com/SAP/ai-sdk-js/issues/new/choose)
10+
For any issue with the AI Core client, use the [Slack Support Channel for AI Core](https://sap-ml.slack.com/archives/C01DZC6EGB0) then simply type `/support-request`
11+
**Missing information may result in delayed response**
12+
- type: textarea
13+
attributes:
14+
label: "Describe the Bug"
15+
description: "A clear and concise description of what the bug is."
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: "Steps to Reproduce"
21+
description: "Steps to reproduce the behavior."
22+
placeholder: |
23+
1. Set up ...
24+
2. Execute ...
25+
3. Confirm ...
26+
4. See error
27+
validations:
28+
required: true
29+
- type: textarea
30+
attributes:
31+
label: "Expected Behavior"
32+
description: "A clear and concise description of what you expected to happen."
33+
validations:
34+
required: true
35+
- type: textarea
36+
attributes:
37+
label: "Screenshots"
38+
description: "Add screenshots to help explain your problem."
39+
validations:
40+
required: false
41+
- type: textarea
42+
attributes:
43+
label: "Used Versions"
44+
description: "Provide versions used in the project."
45+
value: |
46+
- Java and Maven version via `mvn --version`: ...
47+
- SAP Cloud SDK for AI version: ...
48+
- Spring Boot or CAP version: ...
49+
- <details><summary>Dependency tree via `mvn dependency:tree`</summary>
50+
51+
```
52+
Dependency tree here
53+
```
54+
</details>
55+
validations:
56+
required: true
57+
- type: textarea
58+
attributes:
59+
label: "Code Examples"
60+
description: "Add code snippets as examples to help explain your problem. Please remove sensitive information."
61+
value: |
62+
```java
63+
// Your code here
64+
```
65+
validations:
66+
required: false
67+
- type: textarea
68+
attributes:
69+
label: "Stack Trace"
70+
description: "Add your stack trace here. Please remove sensitive information."
71+
validations:
72+
required: false
73+
- type: textarea
74+
attributes:
75+
label: "Log File"
76+
description: "Add your log file or related error message. Please remove sensitive information."
77+
value: |
78+
<details><summary>Log file</summary>
79+
...
80+
</details>
81+
validations:
82+
required: false
83+
- type: dropdown
84+
attributes:
85+
label: "Affected Development Phase"
86+
description: "Choose the development phase affected by this issue."
87+
multiple: false
88+
options:
89+
- Getting Started
90+
- Development
91+
- Release
92+
- Production
93+
validations:
94+
required: true
95+
- type: dropdown
96+
attributes:
97+
label: "Impact"
98+
description: "Choose the impact severity."
99+
multiple: false
100+
options:
101+
- No Impact
102+
- Inconvenience
103+
- Impaired
104+
- Blocked
105+
validations:
106+
required: true
107+
- type: textarea
108+
attributes:
109+
label: "Timeline"
110+
description: "Please briefly state your timeline, e.g., Go-Live in 12 weeks."
111+
validations:
112+
required: false
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Feature Request
2+
description: Request a new feature to help your project using the SAP Cloud SDK for AI (Java).
3+
labels:
4+
- feature request
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
This repository is for Java related issues only. Please open [JavaScript / TypeScript issues here](https://github.com/SAP/ai-sdk-js/issues/new/choose)
10+
- type: textarea
11+
attributes:
12+
label: "Describe the Problem"
13+
description: "A clear and concise description of what the missing feature is"
14+
validations:
15+
required: true
16+
- type: textarea
17+
attributes:
18+
label: "Propose a Solution"
19+
description: "A clear and concise description of what you want to happen."
20+
validations:
21+
required: true
22+
- type: textarea
23+
attributes:
24+
label: "Describe Alternatives"
25+
description: "A clear and concise description of any alternative solutions or features you've considered."
26+
validations:
27+
required: false
28+
- type: dropdown
29+
attributes:
30+
label: "Affected Development Phase"
31+
description: "Choose the development phase affected by this issue."
32+
multiple: false
33+
options:
34+
- Getting Started
35+
- Development
36+
- Release
37+
- Production
38+
validations:
39+
required: true
40+
- type: dropdown
41+
attributes:
42+
label: "Impact"
43+
description: "Choose the impact severity."
44+
multiple: false
45+
options:
46+
- No Impact
47+
- Inconvenience
48+
- Impaired
49+
- Blocked
50+
validations:
51+
required: true
52+
- type: textarea
53+
attributes:
54+
label: "Timeline"
55+
description: "Please briefly state your timeline, e.g., Go-Live in 12 weeks."
56+
validations:
57+
required: false
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Question
2+
description: Ask a question about the SAP Cloud SDK for AI (Java).
3+
labels:
4+
- question
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
This repository is for Java related issues only. Please open [JavaScript / TypeScript issues here](https://github.com/SAP/ai-sdk-js/issues/new/choose)
10+
- type: textarea
11+
attributes:
12+
label: "Ask the Question"
13+
description: Give a clear and concise description.
14+
validations:
15+
required: true

.github/ISSUE_TEMPLATE/sdk-issue.md

Lines changed: 0 additions & 86 deletions
This file was deleted.

.pipeline/pmd.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes">
2828
<priority>3</priority>
2929
</rule>
30-
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement">
30+
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitch">
3131
<priority>3</priority>
3232
</rule>
3333
<rule ref="category/java/bestpractices.xml/PreserveStackTrace">

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Additional methods (not recommended for production):
8484
**1. Obtain Service Credentials:**
8585

8686
- Log into the **SAP BTP Cockpit**
87-
- Navigate to **Instances and Subscriptions** -> **Instances** -> **AI Core**
87+
- Navigate to **Services** -> **Instances and Subscriptions** -> **Instances** -> **AI Core**
8888
- Click **View Credentials** and copy the JSON content
8989

9090
**2. Create `.env` file:**
@@ -177,7 +177,8 @@ After restarting your application, you should see an "aicore" entry in the `VCAP
177177

178178
```java
179179
Destination destination = DestinationAccessor.getDestination("my-aicore");
180-
AiCoreService client = new AiCoreService().withDestination(destination);
180+
AiCoreService aiCoreService = new AiCoreService().withDestination(destination);
181+
DeploymentApi client = new DeploymentApi(aiCoreService);
181182
```
182183

183184
</details>
@@ -253,14 +254,7 @@ For more detailed information and advanced usage, please refer to the following:
253254

254255
### _"How to add a custom header to AI Core requests?"_
255256

256-
To add a header to AI Core requests, use the following code:
257-
258-
```java
259-
ApiClient client = new AiCoreService().client().addDefaultHeader("header-key", "header-value");
260-
DeploymentApi api = new DeploymentApi(client);
261-
```
262-
263-
For more customization, creating a [HeaderProvider](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations#about-headerproviders) is also possible.
257+
Create a [HeaderProvider](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations#about-headerproviders).
264258

265259

266260
### _"There's a vulnerability warning `CVE-2021-41251`?"_

core/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
<removeOperationIdPrefix>true</removeOperationIdPrefix>
183183
<removeOperationIdPrefixDelimiter>\.</removeOperationIdPrefixDelimiter>
184184
<removeOperationIdPrefixCount>3</removeOperationIdPrefixCount>
185+
<aiSdkConstructor>true</aiSdkConstructor>
185186
</additionalProperties>
186187
</configuration>
187188
</execution>

core/src/main/java/com/sap/ai/sdk/core/AiCoreService.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public AiCoreDeployment forDeployment(@Nonnull final String deploymentId) {
135135
public AiCoreDeployment forDeploymentByModel(@Nonnull final AiModel model)
136136
throws NoSuchElementException {
137137
return new AiCoreDeployment(
138-
this, () -> DEPLOYMENT_CACHE.getDeploymentIdByModel(this.client(), resourceGroup, model));
138+
this, () -> DEPLOYMENT_CACHE.getDeploymentIdByModel(this, resourceGroup, model));
139139
}
140140

141141
/**
@@ -150,8 +150,7 @@ public AiCoreDeployment forDeploymentByModel(@Nonnull final AiModel model)
150150
public AiCoreDeployment forDeploymentByScenario(@Nonnull final String scenarioId)
151151
throws NoSuchElementException {
152152
return new AiCoreDeployment(
153-
this,
154-
() -> DEPLOYMENT_CACHE.getDeploymentIdByScenario(client(), resourceGroup, scenarioId));
153+
this, () -> DEPLOYMENT_CACHE.getDeploymentIdByScenario(this, resourceGroup, scenarioId));
155154
}
156155

157156
/**
@@ -193,7 +192,6 @@ protected DefaultHttpDestination.Builder getDestinationBuilder(
193192
* @throws DestinationAccessException If the destination cannot be accessed.
194193
* @throws DestinationNotFoundException If the destination cannot be found.
195194
*/
196-
@SuppressWarnings("UnstableApiUsage")
197195
@Nonnull
198196
protected ApiClient getApiClient(@Nonnull final Destination destination) {
199197
val objectMapper =
@@ -223,6 +221,6 @@ protected ApiClient getApiClient(@Nonnull final Destination destination) {
223221
* @param resourceGroup the resource group of the deleted deployment, usually "default".
224222
*/
225223
public void reloadCachedDeployments(@Nonnull final String resourceGroup) {
226-
DEPLOYMENT_CACHE.resetCache(client(), resourceGroup);
224+
DEPLOYMENT_CACHE.resetCache(this, resourceGroup);
227225
}
228226
}

0 commit comments

Comments
 (0)