Skip to content
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

release: 0.1.0-alpha.4 #37

Merged
merged 9 commits into from
Sep 23, 2024
Merged
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
Empty file modified .devcontainer/Dockerfile
100755 → 100644
Empty file.
Empty file modified .devcontainer/devcontainer.json
100755 → 100644
Empty file.
Empty file modified .gitattributes
100755 → 100644
Empty file.
Empty file modified .github/workflows/ci.yml
100755 → 100644
Empty file.
Empty file modified .github/workflows/publish-sonatype.yml
100755 → 100644
Empty file.
Empty file modified .github/workflows/release-doctor.yml
100755 → 100644
Empty file.
Empty file modified .gitignore
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.3"
".": "0.1.0-alpha.4"
}
Empty file modified .stats.yml
100755 → 100644
Empty file.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.4 (2024-09-23)

Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)

### Features

* **api:** OpenAPI spec update via Stainless API ([#36](https://github.com/openlayer-ai/openlayer-java/issues/36)) ([5d56754](https://github.com/openlayer-ai/openlayer-java/commit/5d56754e57ac66410dba08160d168cc2f9e1d6d6))

## 0.1.0-alpha.3 (2024-08-22)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
Expand Down
Empty file modified LICENSE
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.3)
[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.4)

<!-- x-release-please-end -->

Expand All @@ -27,7 +27,7 @@ The REST API documentation can be found on [openlayer.com](https://openlayer.co
<!-- x-release-please-start-version -->

```kotlin
implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.3")
implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.4")
```

#### Maven
Expand All @@ -36,7 +36,7 @@ implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.3")
<dependency>
<groupId>com.openlayer.api</groupId>
<artifactId>openlayer-java</artifactId>
<version>0.1.0-alpha.3</version>
<version>0.1.0-alpha.4</version>
</dependency>
```

Expand Down
Empty file modified SECURITY.md
100755 → 100644
Empty file.
Empty file modified bin/check-release-environment
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion build.gradle.kts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.openlayer.api"
version = "0.1.0-alpha.3" // x-release-please-version
version = "0.1.0-alpha.4" // x-release-please-version
}


Empty file modified buildSrc/build.gradle.kts
100755 → 100644
Empty file.
Empty file modified buildSrc/src/main/kotlin/openlayer.java.gradle.kts
100755 → 100644
Empty file.
Empty file modified buildSrc/src/main/kotlin/openlayer.kotlin.gradle.kts
100755 → 100644
Empty file.
Empty file modified buildSrc/src/main/kotlin/openlayer.publish.gradle.kts
100755 → 100644
Empty file.
Empty file modified examples/.keep
100755 → 100644
Empty file.
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# `openlayer-java-example`

This is an example project to demonstrate how a java project would look like
that uses the `openlayer-java` sdk.

## Running an example

`./gradlew runStreamData`
20 changes: 20 additions & 0 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
id("application")
id("openlayer.java")
}

dependencies {
implementation(project(":openlayer-java"))
}

// Dynamically create a task for each example
val examples = listOf("StreamData") // Add the names of your example classes here

examples.forEach { example ->
tasks.create("run$example", org.gradle.api.tasks.JavaExec::class.java) {
group = "Examples"
description = "Run $example"
classpath = sourceSets.getByName("main").runtimeClasspath
mainClass.set("com.langsmith.example.$example")
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/*
* This source file was generated by the Gradle 'init' task
*/
package org.example;
package com.openlayer.api.example;

import com.openlayer.api.client.OpenlayerClient;
import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
import com.openlayer.api.core.JsonNumber;
import com.openlayer.api.core.JsonString;
import com.openlayer.api.models.InferencePipelineDataStreamParams;
import com.openlayer.api.models.InferencePipelineDataStreamResponse;

import java.util.List;
import java.util.Arrays;

public class StreamData {
public static void main(String[] args) {
Expand Down Expand Up @@ -42,20 +41,20 @@ public static void main(String[] args) {
// Create Inference Pipeline Data Stream Parameters
InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder()
.inferencePipelineId(inferencePipelineId)
.rows(List.of(row))
.config(InferencePipelineDataStreamParams.Config
.ofLlmData(InferencePipelineDataStreamParams.Config.LlmData.builder()
.rows(Arrays.asList(row))
.config(InferencePipelineDataStreamParams.Config.ofLlmData(
InferencePipelineDataStreamParams.Config.LlmData.builder()
.outputColumnName("output")
.costColumnName("cost")
.inputVariableNames(List.of("user_query"))
.inputVariableNames(Arrays.asList("user_query"))
.numOfTokenColumnName("tokens")
.timestampColumnName("timestamp")
.build()))
.build();

// Execute the request
InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse = client.inferencePipelines().data()
.stream(params);
InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse =
client.inferencePipelines().data().stream(params);

// Print the response
System.out.println(inferencePipelineDataStreamResponse);
Expand Down
Empty file modified gradle.properties
100755 → 100644
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.jar
100755 → 100644
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.properties
100755 → 100644
Empty file.
Empty file modified gradlew.bat
100755 → 100644
Empty file.
Empty file modified openlayer-java-client-okhttp/build.gradle.kts
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified openlayer-java-core/build.gradle.kts
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
26 changes: 2 additions & 24 deletions openlayer-java-core/src/main/kotlin/com/openlayer/api/models/CommitTestResultListParams.kt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ constructor(
private val type: Type?,
private val additionalQueryParams: Map<String, List<String>>,
private val additionalHeaders: Map<String, List<String>>,
private val additionalBodyProperties: Map<String, JsonValue>,
) {

fun projectVersionId(): String = projectVersionId
Expand Down Expand Up @@ -63,8 +62,6 @@ constructor(

fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
Expand All @@ -78,8 +75,7 @@ constructor(
this.status == other.status &&
this.type == other.type &&
this.additionalQueryParams == other.additionalQueryParams &&
this.additionalHeaders == other.additionalHeaders &&
this.additionalBodyProperties == other.additionalBodyProperties
this.additionalHeaders == other.additionalHeaders
}

override fun hashCode(): Int {
Expand All @@ -92,12 +88,11 @@ constructor(
type,
additionalQueryParams,
additionalHeaders,
additionalBodyProperties,
)
}

override fun toString() =
"CommitTestResultListParams{projectVersionId=$projectVersionId, includeArchived=$includeArchived, page=$page, perPage=$perPage, status=$status, type=$type, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
"CommitTestResultListParams{projectVersionId=$projectVersionId, includeArchived=$includeArchived, page=$page, perPage=$perPage, status=$status, type=$type, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}"

fun toBuilder() = Builder().from(this)

Expand All @@ -117,7 +112,6 @@ constructor(
private var type: Type? = null
private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf()
private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf()
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(commitTestResultListParams: CommitTestResultListParams) = apply {
Expand All @@ -129,7 +123,6 @@ constructor(
this.type = commitTestResultListParams.type
additionalQueryParams(commitTestResultListParams.additionalQueryParams)
additionalHeaders(commitTestResultListParams.additionalHeaders)
additionalBodyProperties(commitTestResultListParams.additionalBodyProperties)
}

fun projectVersionId(projectVersionId: String) = apply {
Expand Down Expand Up @@ -199,20 +192,6 @@ constructor(

fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }

fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
this.additionalBodyProperties.clear()
this.additionalBodyProperties.putAll(additionalBodyProperties)
}

fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
this.additionalBodyProperties.put(key, value)
}

fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
}

fun build(): CommitTestResultListParams =
CommitTestResultListParams(
checkNotNull(projectVersionId) { "`projectVersionId` is required but was not set" },
Expand All @@ -223,7 +202,6 @@ constructor(
type,
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalBodyProperties.toUnmodifiable(),
)
}

Expand Down
Loading
Loading