Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions .github/workflows/java-server-sdk-ai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: java-server-sdk-ai

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
build-test-java-server-sdk-ai:
strategy:
matrix:
java-version: [8, 11, 17]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/sdk/server-ai'
java_version: ${{ matrix.java-version }}
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"lib/sdk/server-ai": "0.1.0",
"lib/java-server-sdk-otel": "0.2.0",
"lib/java-server-sdk-redis-store": "3.1.1",
"lib/shared/common": "2.4.0",
Expand Down
9 changes: 9 additions & 0 deletions lib/sdk/server-ai/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

6 changes: 6 additions & 0 deletions lib/sdk/server-ai/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
bin
4 changes: 4 additions & 0 deletions lib/sdk/server-ai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Change log

All notable changes to the LaunchDarkly Server-Side AI SDK for Java will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org).
39 changes: 39 additions & 0 deletions lib/sdk/server-ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# LaunchDarkly Server-Side AI SDK for Java

[![Circle CI](https://img.shields.io/badge/status-in%20development-orange)](https://github.com/launchdarkly/java-core)

> **Status:** In active development toward `v1.0.0`. APIs are not yet stable.

This library provides LaunchDarkly AI Config support for the LaunchDarkly Server-Side SDK for Java.
It is built on top of [`launchdarkly-java-server-sdk`](https://github.com/launchdarkly/java-core/tree/main/lib/sdk/server)
and lets you retrieve, interpolate, and track AI Configs (models, providers, messages, agents, and judges)
managed in the LaunchDarkly dashboard.

## Supported Java versions

This library has a minimum Java version of 8.

## Getting started

This module is part of the [`java-core`](https://github.com/launchdarkly/java-core) monorepo and is
published to Maven Central as `com.launchdarkly:launchdarkly-java-server-sdk-ai`.

Full usage documentation, including AI Config retrieval, tracking, and manual judge evaluation, will be
added as the SDK is built out (see epic AIC-2629).

## Internal API convention

Public, supported types live directly under `com.launchdarkly.sdk.server.ai` (and its documented
subpackages). Anything under `com.launchdarkly.sdk.server.ai.internal` is implementation detail: it is
**not** part of the supported API, is excluded from the published Javadoc and sources jars, and may
change without notice.

## Contributing

We encourage pull requests and other contributions from the community. Check out our
[contributing guidelines](../../CONTRIBUTING.md) for instructions on how to contribute.

## About LaunchDarkly

LaunchDarkly is a feature management platform that serves trillions of feature flags daily to help teams
build better software, faster. [Get started](https://launchdarkly.com) using LaunchDarkly today!
177 changes: 177 additions & 0 deletions lib/sdk/server-ai/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@

buildscript {
repositories {
mavenCentral()
mavenLocal()
}
}

plugins {
id "java"
id "java-library"
id "checkstyle"
id "jacoco"
id "signing"
id "maven-publish"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "idea"
}

configurations.all {
// check for updates every build for dependencies with: 'changing: true'
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

repositories {
mavenLocal()
// Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots:
maven { url "https://oss.sonatype.org/content/groups/public/" }
mavenCentral()
}

allprojects {
group = 'com.launchdarkly'
version = "${version}"
archivesBaseName = 'launchdarkly-java-server-sdk-ai'
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

ext {
sdkBasePackage = "com.launchdarkly.sdk.server.ai"
}

ext.versions = [
// The *lowest* version of the base SDK we are compatible with. LDClientInterface
// appears in this library's public signature, so it is exposed as an `api` dependency.
"sdk": "7.14.0"
// NOTE: a Mustache templating dependency (for AI Config message/instruction interpolation)
// will be added in a later step once it has been fully audited (license / maintenance /
// transitive deps). See AIC-2662.
]

ext.libraries = [:]

dependencies {
// Exposed on the public API surface (LDClientInterface), therefore `api` not `implementation`.
api "com.launchdarkly:launchdarkly-java-server-sdk:${versions.sdk}"

testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:3.12.4"
}

// Non-public implementation detail lives in `com.launchdarkly.sdk.server.ai.internal` and its
// subpackages. We deliberately exclude it from the published Javadoc and sources jars so it is
// not part of the supported, documented surface. See package-info / README for the convention.
def internalPackageGlob = "**/com/launchdarkly/sdk/server/ai/internal/**"

java {
withJavadocJar()
withSourcesJar()
}

javadoc {
// exclude internal implementation classes from the published API documentation
exclude internalPackageGlob
// The foundation module (AIC-2661) intentionally ships no public types yet, only
// package-info.java. The javadoc tool reports "No public or protected classes found to
// document" in that state, so we tolerate it here. TODO(AIC-2662): set failOnError = true
// once the data-model public types land.
failOnError = false
options {
// suppress noisy "no comment" warnings; checkstyle enforces Javadoc on the public surface
addStringOption('Xdoclint:all,-missing', '-quiet')
}
}

tasks.named('sourcesJar') {
// keep internal implementation classes out of the published sources jar
exclude internalPackageGlob
}

test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
showStandardStreams = true
exceptionFormat = 'full'
}
}

jacoco {
toolVersion = "0.8.11"
}

jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}

checkstyle {
toolVersion = "9.3"
configFile = file("${project.rootDir}/checkstyle.xml")
}

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java

groupId = 'com.launchdarkly'
artifactId = project.archivesBaseName

pom {
name = project.archivesBaseName
description = 'LaunchDarkly Server-Side AI SDK for Java'
url = 'https://github.com/launchdarkly/java-core'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'LaunchDarkly'
email = 'team@launchdarkly.com'
}
}
scm {
connection = 'scm:git:git://github.com/launchdarkly/java-core.git'
developerConnection = 'scm:git:ssh:git@github.com:launchdarkly/java-core.git'
url = 'https://github.com/launchdarkly/java-core'
}
}
}
}
repositories {
mavenLocal()
}
}

nexusPublishing {
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}

signing {
sign publishing.publications.mavenJava
}

tasks.withType(Sign) {
onlyIf { !"1".equals(project.findProperty("LD_SKIP_SIGNING")) } // so we can build jars for testing in CI
}
14 changes: 14 additions & 0 deletions lib/sdk/server-ai/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
</module>
<module name="JavadocType">
<property name="scope" value="public"/>
</module>
</module>
</module>
8 changes: 8 additions & 0 deletions lib/sdk/server-ai/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#x-release-please-start-version
version=0.1.0
#x-release-please-end

# The following empty ossrh properties are used by LaunchDarkly's internal integration testing framework
# and should not be needed for typical development purposes (including by third-party developers).
sonatypeUsername=
sonatypePassword=
Binary file not shown.
6 changes: 6 additions & 0 deletions lib/sdk/server-ai/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading