Skip to content

Commit ef75e15

Browse files
committed
update to chat/genai
1 parent baddca1 commit ef75e15

12 files changed

+234
-65
lines changed

build.sh

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

java-ai/build.sh

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
#!/bin/bash
22

3-
set -e
4-
5-
IMAGE_NAME=podsofkon
6-
#IMAGE_VERSION=latest
7-
IMAGE_VERSION=sustainableaijava
8-
#DOCKER_REGISTRY=us-ashburn-1.ocir.io/oradbclouducm/gd74087885
9-
DOCKER_REGISTRY=us-ashburn-1.ocir.io/oradbclouducm/podsofkon
10-
11-
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
12-
export IMAGE_VERSION=$IMAGE_VERSION
3+
#The following is temporary until release is available in maven and only required to be called once...
4+
#mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=lib/oci-java-sdk-generativeai-3.25.1-preview1-20230906.204234-1.jar
135

146
mvn clean package
15-
16-
#docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE .
17-
podman build -t=$IMAGE .
18-
#docker buildx build --platform=linux/amd64 -t=$IMAGE .
19-
20-
#docker push --platform linux/amd64 "$IMAGE"
21-
podman push "$IMAGE"

java-ai/build0.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
IMAGE_NAME=podsofkon
6+
#IMAGE_VERSION=latest
7+
IMAGE_VERSION=sustainableaijava
8+
#DOCKER_REGISTRY=us-ashburn-1.ocir.io/oradbclouducm/gd74087885
9+
DOCKER_REGISTRY=us-ashburn-1.ocir.io/oradbclouducm/podsofkon
10+
11+
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
12+
export IMAGE_VERSION=$IMAGE_VERSION
13+
14+
mvn clean package
15+
16+
#docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE .
17+
podman build -t=$IMAGE .
18+
#docker buildx build --platform=linux/amd64 -t=$IMAGE .
19+
20+
#docker push --platform linux/amd64 "$IMAGE"
21+
podman push "$IMAGE"
File renamed without changes.
File renamed without changes.
File renamed without changes.

java-ai/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<description>Oracle AI Demos</description>
1616

1717
<properties>
18-
<oci.sdk.version>3.44.2</oci.sdk.version>
18+
<oci.sdk.version>3.52.1</oci.sdk.version>
1919
</properties>
2020

2121
<dependencies>
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>com.oracle.cloud.spring</groupId>
4242
<artifactId>spring-cloud-oci-starter</artifactId>
43-
<version>1.2.0</version>
43+
<version>1.3.0</version>
4444
</dependency>
4545
<dependency>
4646
<groupId>com.oracle.oci.sdk</groupId>

run.sh renamed to java-ai/run.sh

File renamed without changes.
File renamed without changes.

java-ai/src/main/java/oracleai/ExplainAndAdviseOnHealthTestResults.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.fasterxml.jackson.databind.ObjectMapper;
44
import com.oracle.bmc.aivision.model.ImageTextDetectionFeature;
5+
import com.oracle.bmc.generativeaiinference.model.OnDemandServingMode;
56
import oracleai.services.ORDSCalls;
67
import oracleai.services.OracleGenAI;
78
import oracleai.services.OracleObjectStore;
@@ -43,8 +44,13 @@ public String analyzedoc(@RequestParam("file") MultipartFile multipartFile,
4344
}
4445
System.out.println(concatenatedText);
4546
System.out.println("analyzedoc fullText = " + concatenatedText);
47+
OnDemandServingMode chatServingMode = OnDemandServingMode.builder()
48+
.modelId("cohere.command-r-16k")
49+
.build();
4650
String explanationOfResults =
47-
OracleGenAI.chat("explain these test results in simple terms, in less than 100 words, " +
51+
OracleGenAI.builder().compartment(AIApplication.COMPARTMENT_ID)
52+
.servingMode(chatServingMode)
53+
.build().chat("explain these test results in simple terms, in less than 100 words, " +
4854
"and tell me what should I do to get better results: \"" + concatenatedText + "\"");
4955
System.out.println("ExplainAndAdviseOnHealthTestResults.analyzedoc explanationOfResults:" + explanationOfResults);
5056
model.addAttribute("results", "SUMMARY WITH ADVICE: " + explanationOfResults +

0 commit comments

Comments
 (0)