Skip to content
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.17"
".": "0.1.0"
}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.1.0 (2025-09-22)

Full Changelog: [v0.1.0-alpha.17...v0.1.0](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.17...v0.1.0)

### Bug Fixes

* use slices.Concat instead of sometimes modifying r.Options ([19cb06e](https://github.com/openlayer-ai/openlayer-go/commit/19cb06ee0bd56001bae8e04a0e21147b55da957c))


### Chores

* bump minimum go version to 1.22 ([4bbbeb0](https://github.com/openlayer-ai/openlayer-go/commit/4bbbeb01e4132c1775b72c88c95f888b8d7b0131))
* do not install brew dependencies in ./scripts/bootstrap by default ([039a9bd](https://github.com/openlayer-ai/openlayer-go/commit/039a9bdaef3563687eca21b7667fb968c670febc))
* update more docs for 1.22 ([8ef189a](https://github.com/openlayer-ai/openlayer-go/commit/8ef189a98c9ffa26c5a41634ae09643390672df7))

## 0.1.0-alpha.17 (2025-09-09)

Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.16...v0.1.0-alpha.17)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ ./scripts/build

This will install all the required dependencies and build the SDK.

You can also [install go 1.18+ manually](https://go.dev/doc/install).
You can also [install go 1.22+ manually](https://go.dev/doc/install).

## Modifying/Adding code

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/openlayer-ai/openlayer-go@v0.1.0-alpha.17'
go get -u 'github.com/openlayer-ai/openlayer-go@v0.1.0'
```

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

## Requirements

This library requires Go 1.18+.
This library requires Go 1.22+.

## Usage

Expand Down
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"net/http"
"os"
"slices"

"github.com/openlayer-ai/openlayer-go/internal/requestconfig"
"github.com/openlayer-ai/openlayer-go/option"
Expand Down Expand Up @@ -84,7 +85,7 @@ func NewClient(opts ...option.RequestOption) (r *Client) {
// For even greater flexibility, see [option.WithResponseInto] and
// [option.WithResponseBodyInto].
func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error {
opts = append(r.Options, opts...)
opts = slices.Concat(r.Options, opts)
return requestconfig.ExecuteNewRequest(ctx, method, path, params, res, opts...)
}

Expand Down
3 changes: 2 additions & 1 deletion commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"net/http"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -37,7 +38,7 @@ func NewCommitService(opts ...option.RequestOption) (r *CommitService) {

// Retrieve a project version (commit) by its id.
func (r *CommitService) Get(ctx context.Context, projectVersionID string, opts ...option.RequestOption) (res *CommitGetResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectVersionID == "" {
err = errors.New("missing required projectVersionId parameter")
return
Expand Down
3 changes: 2 additions & 1 deletion committestresult.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"reflect"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -41,7 +42,7 @@ func NewCommitTestResultService(opts ...option.RequestOption) (r *CommitTestResu

// List the test results for a project commit (project version).
func (r *CommitTestResultService) List(ctx context.Context, projectVersionID string, query CommitTestResultListParams, opts ...option.RequestOption) (res *CommitTestResultListResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectVersionID == "" {
err = errors.New("missing required projectVersionId parameter")
return
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/openlayer-ai/openlayer-go

go 1.21
go 1.22

require (
github.com/tidwall/gjson v1.14.4
Expand Down
7 changes: 4 additions & 3 deletions inferencepipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/url"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -44,7 +45,7 @@ func NewInferencePipelineService(opts ...option.RequestOption) (r *InferencePipe

// Retrieve inference pipeline.
func (r *InferencePipelineService) Get(ctx context.Context, inferencePipelineID string, query InferencePipelineGetParams, opts ...option.RequestOption) (res *InferencePipelineGetResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if inferencePipelineID == "" {
err = errors.New("missing required inferencePipelineId parameter")
return
Expand All @@ -56,7 +57,7 @@ func (r *InferencePipelineService) Get(ctx context.Context, inferencePipelineID

// Update inference pipeline.
func (r *InferencePipelineService) Update(ctx context.Context, inferencePipelineID string, body InferencePipelineUpdateParams, opts ...option.RequestOption) (res *InferencePipelineUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if inferencePipelineID == "" {
err = errors.New("missing required inferencePipelineId parameter")
return
Expand All @@ -68,7 +69,7 @@ func (r *InferencePipelineService) Update(ctx context.Context, inferencePipeline

// Delete inference pipeline.
func (r *InferencePipelineService) Delete(ctx context.Context, inferencePipelineID string, opts ...option.RequestOption) (err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
if inferencePipelineID == "" {
err = errors.New("missing required inferencePipelineId parameter")
Expand Down
3 changes: 2 additions & 1 deletion inferencepipelinedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"net/http"
"slices"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
"github.com/openlayer-ai/openlayer-go/internal/param"
Expand Down Expand Up @@ -35,7 +36,7 @@ func NewInferencePipelineDataService(opts ...option.RequestOption) (r *Inference

// Publish an inference data point to an inference pipeline.
func (r *InferencePipelineDataService) Stream(ctx context.Context, inferencePipelineID string, body InferencePipelineDataStreamParams, opts ...option.RequestOption) (res *InferencePipelineDataStreamResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if inferencePipelineID == "" {
err = errors.New("missing required inferencePipelineId parameter")
return
Expand Down
3 changes: 2 additions & 1 deletion inferencepipelinerow.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/url"
"slices"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
"github.com/openlayer-ai/openlayer-go/internal/apiquery"
Expand Down Expand Up @@ -37,7 +38,7 @@ func NewInferencePipelineRowService(opts ...option.RequestOption) (r *InferenceP

// Update an inference data point in an inference pipeline.
func (r *InferencePipelineRowService) Update(ctx context.Context, inferencePipelineID string, params InferencePipelineRowUpdateParams, opts ...option.RequestOption) (res *InferencePipelineRowUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if inferencePipelineID == "" {
err = errors.New("missing required inferencePipelineId parameter")
return
Expand Down
3 changes: 2 additions & 1 deletion inferencepipelinetestresult.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"reflect"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -41,7 +42,7 @@ func NewInferencePipelineTestResultService(opts ...option.RequestOption) (r *Inf

// List the latest test results for an inference pipeline.
func (r *InferencePipelineTestResultService) List(ctx context.Context, inferencePipelineID string, query InferencePipelineTestResultListParams, opts ...option.RequestOption) (res *InferencePipelineTestResultListResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if inferencePipelineID == "" {
err = errors.New("missing required inferencePipelineId parameter")
return
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.1.0-alpha.17" // x-release-please-version
const PackageVersion = "0.1.0" // x-release-please-version
5 changes: 3 additions & 2 deletions project.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"net/http"
"net/url"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -42,15 +43,15 @@ func NewProjectService(opts ...option.RequestOption) (r *ProjectService) {

// Create a project in your workspace.
func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *ProjectNewResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
path := "projects"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}

// List your workspace's projects.
func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *ProjectListResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
path := "projects"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
return
Expand Down
5 changes: 3 additions & 2 deletions projectcommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/url"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -38,7 +39,7 @@ func NewProjectCommitService(opts ...option.RequestOption) (r *ProjectCommitServ

// Create a new commit (project version) in a project.
func (r *ProjectCommitService) New(ctx context.Context, projectID string, body ProjectCommitNewParams, opts ...option.RequestOption) (res *ProjectCommitNewResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand All @@ -50,7 +51,7 @@ func (r *ProjectCommitService) New(ctx context.Context, projectID string, body P

// List the commits (project versions) in a project.
func (r *ProjectCommitService) List(ctx context.Context, projectID string, query ProjectCommitListParams, opts ...option.RequestOption) (res *ProjectCommitListResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand Down
5 changes: 3 additions & 2 deletions projectinferencepipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/url"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -38,7 +39,7 @@ func NewProjectInferencePipelineService(opts ...option.RequestOption) (r *Projec

// Create an inference pipeline in a project.
func (r *ProjectInferencePipelineService) New(ctx context.Context, projectID string, body ProjectInferencePipelineNewParams, opts ...option.RequestOption) (res *ProjectInferencePipelineNewResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand All @@ -50,7 +51,7 @@ func (r *ProjectInferencePipelineService) New(ctx context.Context, projectID str

// List the inference pipelines in a project.
func (r *ProjectInferencePipelineService) List(ctx context.Context, projectID string, query ProjectInferencePipelineListParams, opts ...option.RequestOption) (res *ProjectInferencePipelineListResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand Down
7 changes: 4 additions & 3 deletions projecttest.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"reflect"
"slices"
"time"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
Expand Down Expand Up @@ -41,7 +42,7 @@ func NewProjectTestService(opts ...option.RequestOption) (r *ProjectTestService)

// Create a test.
func (r *ProjectTestService) New(ctx context.Context, projectID string, body ProjectTestNewParams, opts ...option.RequestOption) (res *ProjectTestNewResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand All @@ -53,7 +54,7 @@ func (r *ProjectTestService) New(ctx context.Context, projectID string, body Pro

// Update tests.
func (r *ProjectTestService) Update(ctx context.Context, projectID string, body ProjectTestUpdateParams, opts ...option.RequestOption) (res *ProjectTestUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand All @@ -65,7 +66,7 @@ func (r *ProjectTestService) Update(ctx context.Context, projectID string, body

// List tests under a project.
func (r *ProjectTestService) List(ctx context.Context, projectID string, query ProjectTestListParams, opts ...option.RequestOption) (res *ProjectTestListResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
if projectID == "" {
err = errors.New("missing required projectId parameter")
return
Expand Down
14 changes: 11 additions & 3 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
brew bundle
;;
*)
;;
esac
echo
}
fi

Expand Down
3 changes: 2 additions & 1 deletion storagepresignedurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"net/http"
"net/url"
"slices"

"github.com/openlayer-ai/openlayer-go/internal/apijson"
"github.com/openlayer-ai/openlayer-go/internal/apiquery"
Expand Down Expand Up @@ -35,7 +36,7 @@ func NewStoragePresignedURLService(opts ...option.RequestOption) (r *StoragePres

// Retrieve a presigned url to post storage artifacts.
func (r *StoragePresignedURLService) New(ctx context.Context, body StoragePresignedURLNewParams, opts ...option.RequestOption) (res *StoragePresignedURLNewResponse, err error) {
opts = append(r.Options[:], opts...)
opts = slices.Concat(r.Options, opts)
path := "storage/presigned-url"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
Expand Down