Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
80089ca
Initial
a-d Jan 23, 2025
b959d0e
intermediate
a-d Jan 28, 2025
f46b313
Remove hashmap extension
a-d Jan 30, 2025
14a461d
Refine; Add test code
a-d Jan 30, 2025
90c7924
Fix thresholds; Add missing test class
a-d Jan 30, 2025
d922bae
Update pom.xml
newtork Jan 31, 2025
3a9f057
Merge remote-tracking branch 'origin/main' into grounding-client
a-d Jan 31, 2025
3fb8af0
Fix merge conflict
a-d Jan 31, 2025
9964613
Merge remote-tracking branch 'origin/main' into grounding-client
a-d Feb 4, 2025
53a5ad1
Update generated code
a-d Feb 4, 2025
65f6dca
Mark the module for release
a-d Feb 5, 2025
939cd79
Extract service and destination to test root
a-d Feb 5, 2025
648a0b0
Formatting
bot-sdk-js Feb 5, 2025
7f2393f
Rename client class
a-d Feb 5, 2025
804428a
add test app controller and unit test
a-d Feb 6, 2025
8abc5e8
Merge branch 'main' into grounding-client
newtork Feb 10, 2025
73d7425
Merge remote-tracking branch 'origin/main' into grounding-client
a-d Feb 11, 2025
2806fdf
format
a-d Feb 12, 2025
2987e92
Remove Beta annotation on client
a-d Feb 13, 2025
affa192
Fix E2E tests
a-d Feb 13, 2025
a84ab71
Merge remote-tracking branch 'origin/grounding-client' into grounding…
a-d Feb 13, 2025
2f4bcc7
Merge remote-tracking branch 'origin/main' into grounding-client
a-d Feb 14, 2025
dcad8a1
Add extended test case for documents
a-d Feb 14, 2025
f9b8ab0
Update tests
a-d Feb 14, 2025
0a2ce03
Format, Syntax, checks
a-d Feb 14, 2025
1bda813
Add some frontend links
a-d Feb 14, 2025
08810c1
Migrate from public static factory method to constructor
a-d Feb 14, 2025
1bdf622
Merge branch 'main' into grounding-client
newtork Feb 17, 2025
eb7a00a
small changes
CharlesDuboisSAP Feb 17, 2025
f1132c8
Merge branch 'main' into grounding-client
newtork Feb 21, 2025
a96b058
Update thresholds
a-d Feb 21, 2025
bfab7e0
Update grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClie…
newtork Feb 21, 2025
4e73e29
Formatting
bot-sdk-js Feb 21, 2025
5430c52
Fix JavaDoc
a-d Feb 21, 2025
801c706
Update grounding/pom.xml
newtork Feb 21, 2025
10c715b
Fix test method name
a-d Feb 21, 2025
461e0e4
Merge remote-tracking branch 'origin/grounding-client' into grounding…
a-d Feb 21, 2025
af877e8
Add doc
a-d Feb 21, 2025
fce7127
Merge remote-tracking branch 'origin/main' into grounding-client
a-d Feb 24, 2025
a255bd5
Update docs/guides/GROUNDING.md
newtork Feb 24, 2025
c2951d5
Update docs/guides/GROUNDING.md
newtork Feb 24, 2025
8e927ae
Fix doc
a-d Feb 24, 2025
5b3ebd8
Update docs/guides/GROUNDING.md
newtork Feb 24, 2025
fb6252a
Merge branch 'grounding-client' of https://github.com/SAP/ai-sdk-java…
a-d Feb 24, 2025
4e20287
Migrate files from "api" namespace to "client" namespace
a-d Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .pipeline/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<suppress files="[/\\]core[/\\]client[/\\]" checks=".*"/>
<suppress files="[/\\]core[/\\]model[/\\]" checks=".*"/>
<suppress files="[/\\]orchestration[/\\]model[/\\]" checks=".*"/>
<suppress files="[/\\]grounding[/\\]api[/\\]" checks=".*"/>
<suppress files="[/\\]grounding[/\\]model[/\\]" checks=".*"/>
<!-- Suppress TODOs -->
<suppress files="OpenAiChatMessage.java" checks="TodoComment" lines="257,7" />
</suppressions>
2 changes: 2 additions & 0 deletions .pipeline/spotbugs-exclusions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<Package name="com.sap.ai.sdk.core.client"/>
<Package name="com.sap.ai.sdk.core.model"/>
<Package name="com.sap.ai.sdk.orchestration.model"/>
<Package name="com.sap.ai.sdk.grounding.api"/>
<Package name="com.sap.ai.sdk.grounding.model"/>
</Or>
</Match>
</FindBugsFilter>
155 changes: 155 additions & 0 deletions grounding/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<artifactId>grounding</artifactId>
<name>Grounding client</name>
<description>SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for the Orchestration Service.</description>

<url>https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation</url>
<organization>
<name>SAP SE</name>
<url>https://www.sap.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>SAP</name>
<email>cloudsdk@sap.com</email>
<organization>SAP SE</organization>
<organizationUrl>https://www.sap.com</organizationUrl>
</developer>
</developers>
<properties>
<project.rootdir>${project.basedir}/../</project.rootdir>
<coverage.complexity>76%</coverage.complexity>
<coverage.line>83%</coverage.line>
<coverage.instruction>88%</coverage.instruction>
<coverage.branch>100%</coverage.branch>
<coverage.method>83%</coverage.method>
<coverage.class>100%</coverage.class>
</properties>

<dependencies>
<!-- used by generated API classes -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<!-- scope "compile" -->
<dependency>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-connectivity</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- scope "provided" -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- scope "test" -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>generate</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>generate</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<configuration>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<apiMaturity>beta</apiMaturity>
<enableOneOfAnyOfGeneration>true</enableOneOfAnyOfGeneration>
<compileScope>COMPILE</compileScope>
<deleteOutputDirectory>true</deleteOutputDirectory>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>orchestration</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/spec/grounding.yaml</inputSpec>
<apiPackage>com.sap.ai.sdk.grounding.api</apiPackage>
<generateApis>true</generateApis>
<!-- TODO will change -->
<modelPackage>com.sap.ai.sdk.grounding.model</modelPackage>
<additionalProperties>
<pojoBuilderMethodName>create</pojoBuilderMethodName>
<pojoBuildMethodName/>
<pojoConstructorVisibility>protected</pojoConstructorVisibility>
<enumUnknownDefaultCase>true</enumUnknownDefaultCase>
<useOneOfInterfaces>true</useOneOfInterfaces>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.sap.ai.sdk.grounding;

import com.google.common.annotations.Beta;
import com.sap.ai.sdk.core.AiCoreService;
import com.sap.ai.sdk.grounding.api.PipelinesApi;
import com.sap.ai.sdk.grounding.api.RetrievalApi;
import com.sap.ai.sdk.grounding.api.VectorApi;
import javax.annotation.Nonnull;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;

/**
* Service class for the Grounding APIs.
*
* @since 1.3.0
*/
@Beta
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public class GroundingService {

final AiCoreService aiCoreService;
final String basePath;

static final String DEFAULT_BASE_PATH = "lm/document-grounding/";

/**
* Create a new instance of the GroundingService.
*
* @return A new instance of the GroundingService.
*/
@Nonnull
public static GroundingService create() {
return create(new AiCoreService());
}

/**
* Create a new instance of the GroundingService.
*
* @param aiCoreService The AiCoreService instance to use.
* @return A new instance of the GroundingService.
*/
@Nonnull
public static GroundingService create(@Nonnull final AiCoreService aiCoreService) {
return create(aiCoreService, DEFAULT_BASE_PATH);
}

/**
* Create a new instance of the GroundingService.
*
* @param aiCoreService The AiCoreService instance to use.
* @param basePath The base path to use for the API calls.
* @return A new instance of the GroundingService.
*/
@Nonnull
public static GroundingService create(
@Nonnull final AiCoreService aiCoreService, @Nonnull final String basePath) {
return new GroundingService(aiCoreService, basePath);
}

/**
* Get the Pipelines API.
*
* @return The Pipelines API.
*/
@Nonnull
public PipelinesApi pipelines() {
return new PipelinesApi(aiCoreService.getApiClient().setBasePath(basePath));
}

/**
* Get the Vector API.
*
* @return The Vector API.
*/
@Nonnull
public VectorApi vector() {
return new VectorApi(aiCoreService.getApiClient().setBasePath(basePath));
}

/**
* Get the Retrieval API.
*
* @return The Retrieval API.
*/
@Nonnull
public RetrievalApi retrieval() {
return new RetrievalApi(aiCoreService.getApiClient().setBasePath(basePath));
}
}
Loading
Loading