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

feat(api): OpenAPI spec update via Stainless API #13

Merged
merged 1 commit into from
Jul 17, 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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).

## Documentation

The REST API documentation can be found [on openlayer.com](https://openlayer.com/docs/api-reference/rest/overview).
The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview).

---

Expand Down Expand Up @@ -250,3 +250,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/openlayer-ai/openlayer-java/issues) with questions, bugs, or suggestions.

## Requirements

This library requires Java 8 or later.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ constructor(
/** Configuration for the data stream. Depends on your **Openlayer project task type**. */
@JsonProperty("config") fun config(): Config? = config

/** A list of entries that represent rows of a csv file */
/** A list of inference data points with inputs and outputs */
@JsonProperty("rows") fun rows(): List<Row>? = rows

@JsonAnyGetter
Expand Down Expand Up @@ -135,7 +135,7 @@ constructor(
*/
@JsonProperty("config") fun config(config: Config) = apply { this.config = config }

/** A list of entries that represent rows of a csv file */
/** A list of inference data points with inputs and outputs */
@JsonProperty("rows") fun rows(rows: List<Row>) = apply { this.rows = rows }

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
Expand Down Expand Up @@ -248,13 +248,13 @@ constructor(
this.config = Config.ofTextClassificationData(textClassificationData)
}

/** A list of entries that represent rows of a csv file */
/** A list of inference data points with inputs and outputs */
fun rows(rows: List<Row>) = apply {
this.rows.clear()
this.rows.addAll(rows)
}

/** A list of entries that represent rows of a csv file */
/** A list of inference data points with inputs and outputs */
fun addRow(row: Row) = apply { this.rows.add(row) }

fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.concurrent.CompletableFuture

interface DataServiceAsync {

/** Stream production data to an inference pipeline. */
/** Create an inference data point in an inference pipeline. */
@JvmOverloads
fun stream(
params: InferencePipelineDataStreamParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ constructor(
jsonHandler<InferencePipelineDataStreamResponse>(clientOptions.jsonMapper)
.withErrorHandler(errorHandler)

/** Stream production data to an inference pipeline. */
/** Create an inference data point in an inference pipeline. */
override fun stream(
params: InferencePipelineDataStreamParams,
requestOptions: RequestOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.openlayer.api.models.InferencePipelineDataStreamResponse

interface DataService {

/** Stream production data to an inference pipeline. */
/** Create an inference data point in an inference pipeline. */
@JvmOverloads
fun stream(
params: InferencePipelineDataStreamParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ constructor(
jsonHandler<InferencePipelineDataStreamResponse>(clientOptions.jsonMapper)
.withErrorHandler(errorHandler)

/** Stream production data to an inference pipeline. */
/** Create an inference data point in an inference pipeline. */
override fun stream(
params: InferencePipelineDataStreamParams,
requestOptions: RequestOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ProjectCommitListResponseTest {
.dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z"))
.gitCommitRef("main")
.gitCommitSha(123L)
.gitCommitUrl("string")
.gitCommitUrl("gitCommitUrl")
.build()
)
.dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z"))
Expand Down Expand Up @@ -94,7 +94,7 @@ class ProjectCommitListResponseTest {
.dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z"))
.gitCommitRef("main")
.gitCommitSha(123L)
.gitCommitUrl("string")
.gitCommitUrl("gitCommitUrl")
.build()
)
.dateArchived(OffsetDateTime.parse("2024-03-22T11:31:01.185Z"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ class ProjectCreateResponseTest {
.dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.gitId(123L)
.name("string")
.name("name")
.private_(true)
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.slug("string")
.url("string")
.branch("string")
.rootDir("string")
.slug("slug")
.url("url")
.branch("branch")
.rootDir("rootDir")
.build()
)
.build()
Expand Down Expand Up @@ -86,13 +86,13 @@ class ProjectCreateResponseTest {
.dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.gitId(123L)
.name("string")
.name("name")
.private_(true)
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.slug("string")
.url("string")
.branch("string")
.rootDir("string")
.slug("slug")
.url("url")
.branch("branch")
.rootDir("rootDir")
.build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ProjectInferencePipelineListParamsTest {
fun createProjectInferencePipelineListParams() {
ProjectInferencePipelineListParams.builder()
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.name("string")
.name("name")
.page(123L)
.perPage(100L)
.build()
Expand All @@ -23,12 +23,12 @@ class ProjectInferencePipelineListParamsTest {
val params =
ProjectInferencePipelineListParams.builder()
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.name("string")
.name("name")
.page(123L)
.perPage(100L)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("name", listOf("string"))
expected.put("name", listOf("name"))
expected.put("page", listOf("123"))
expected.put("perPage", listOf("100"))
assertThat(params.getQueryParams()).isEqualTo(expected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ProjectListParamsTest {
@Test
fun createProjectListParams() {
ProjectListParams.builder()
.name("string")
.name("name")
.page(123L)
.perPage(100L)
.taskType(ProjectListParams.TaskType.LLM_BASE)
Expand All @@ -22,13 +22,13 @@ class ProjectListParamsTest {
fun getQueryParams() {
val params =
ProjectListParams.builder()
.name("string")
.name("name")
.page(123L)
.perPage(100L)
.taskType(ProjectListParams.TaskType.LLM_BASE)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("name", listOf("string"))
expected.put("name", listOf("name"))
expected.put("page", listOf("123"))
expected.put("perPage", listOf("100"))
expected.put("taskType", listOf(ProjectListParams.TaskType.LLM_BASE.toString()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class ProjectListResponseTest {
.dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.gitId(123L)
.name("string")
.name("name")
.private_(true)
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.slug("string")
.url("string")
.branch("string")
.rootDir("string")
.slug("slug")
.url("url")
.branch("branch")
.rootDir("rootDir")
.build()
)
.build()
Expand Down Expand Up @@ -107,13 +107,13 @@ class ProjectListResponseTest {
.dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z"))
.gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.gitId(123L)
.name("string")
.name("name")
.private_(true)
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.slug("string")
.url("string")
.branch("string")
.rootDir("string")
.slug("slug")
.url("url")
.branch("branch")
.rootDir("rootDir")
.build()
)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ProjectServiceTest {
val projectListResponse =
projectService.list(
ProjectListParams.builder()
.name("string")
.name("name")
.page(123L)
.perPage(100L)
.taskType(ProjectListParams.TaskType.LLM_BASE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class InferencePipelineServiceTest {
inferencePipelineService.list(
ProjectInferencePipelineListParams.builder()
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.name("string")
.name("name")
.page(123L)
.perPage(100L)
.build()
Expand Down