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
15 changes: 7 additions & 8 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ RUN apt-get update && apt-get install -y \
libxkbcommon0 \
ca-certificates \
git \
golang \
unzip \
libc++1 \
vim \
curl \
procps \
&& apt-get clean autoclean

RUN curl -OL https://go.dev/dl/go1.24.0.linux-amd64.tar.gz && \
tar -C /usr/local -xzvf go1.24.0.linux-amd64.tar.gz && \
rm go1.24.0.linux-amd64.tar.gz
ENV PATH="$PATH:/usr/local/go/bin"

# Ensure UTF-8 encoding
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

ENV GOPATH=/go
ENV PATH=$GOPATH/bin:$PATH

WORKDIR /workspace

COPY . /workspace
28 changes: 0 additions & 28 deletions .github/workflows/create-releases.yml

This file was deleted.

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.13"
".": "0.1.0-alpha.14"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 14
configured_endpoints: 15
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 0.1.0-alpha.14 (2025-03-13)

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

### Features

* **api:** add endpoint to retrieve commit by id ([#64](https://github.com/openlayer-ai/openlayer-go/issues/64)) ([201cb4a](https://github.com/openlayer-ai/openlayer-go/commit/201cb4acd0e572cecb46ffdc29979c38a52846fb))
* **api:** api update ([1d5c8e7](https://github.com/openlayer-ai/openlayer-go/commit/1d5c8e7f9a98ab806517fbd7c2ac8c6ac456f04d))
* **client:** send `X-Stainless-Timeout` header ([d9948ef](https://github.com/openlayer-ai/openlayer-go/commit/d9948ef4b8b56ed71ddd2ea0f4519bf40dc5d52f))


### Bug Fixes

* **client:** don't truncate manually specified filenames ([f7b96d9](https://github.com/openlayer-ai/openlayer-go/commit/f7b96d9ebe96937df548fe0797fbbaf8ba77109a))
* do not call path.Base on ContentType ([0b98d8e](https://github.com/openlayer-ai/openlayer-go/commit/0b98d8e38cb8716cc61ee62f9aa4b58250a4b581))
* fix early cancel when RequestTimeout is provided for streaming requests ([f0c9a39](https://github.com/openlayer-ai/openlayer-go/commit/f0c9a39e93d5aab9a2f78b95f1a6ee0aa27632ca))
* fix interface implementation stub names for unions ([0d8c74f](https://github.com/openlayer-ai/openlayer-go/commit/0d8c74f4d02b5d154357d98e892ac074470b474b))
* fix unicode encoding for json ([cdaee21](https://github.com/openlayer-ai/openlayer-go/commit/cdaee2125cb3c27f1a94cefc70d87ad5e12b79cc))


### Chores

* add UnionUnmarshaler for responses that are interfaces ([3295c9b](https://github.com/openlayer-ai/openlayer-go/commit/3295c9bcc892bf7db4f1068120be3a86b86b1281))
* **internal:** codegen related update ([57b756f](https://github.com/openlayer-ai/openlayer-go/commit/57b756f1e31665115bc2cac4d7527f21965376ad))
* **internal:** codegen related update ([c2a18b7](https://github.com/openlayer-ai/openlayer-go/commit/c2a18b7d8ebe2df5f23428be410172a0dbd330cd))
* **internal:** codegen related update ([5582642](https://github.com/openlayer-ai/openlayer-go/commit/5582642f1d2b958566a842f4c9663baea39563cc))
* **internal:** fix devcontainers setup ([1d42cd7](https://github.com/openlayer-ai/openlayer-go/commit/1d42cd7adbc487450809a3da28cdb47cc11da3db))
* refactor client tests ([d2732fe](https://github.com/openlayer-ai/openlayer-go/commit/d2732fee321e2f829eafa4374c0c093d6e378f72))


### Documentation

* document raw responses ([1c66d2a](https://github.com/openlayer-ai/openlayer-go/commit/1c66d2a1e698e42799d142ff57ad1b2a51630b98))

## 0.1.0-alpha.13 (2025-01-02)

Full Changelog: [v0.1.0-alpha.12...v0.1.0-alpha.13](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.12...v0.1.0-alpha.13)
Expand Down
66 changes: 52 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

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

<!-- x-release-please-end -->
Expand Down Expand Up @@ -66,9 +66,9 @@ func main() {
Rows: openlayer.F([]map[string]interface{}{{
"user_query": "what is the meaning of life?",
"output": "42",
"tokens": map[string]interface{}{},
"cost": map[string]interface{}{},
"timestamp": map[string]interface{}{},
"tokens": 7,
"cost": 0.02,
"timestamp": 1610000000,
}}),
},
)
Expand Down Expand Up @@ -207,9 +207,9 @@ _, err := client.InferencePipelines.Data.Stream(
Rows: openlayer.F([]map[string]interface{}{{
"user_query": "what is the meaning of life?",
"output": "42",
"tokens": map[string]interface{}{},
"cost": map[string]interface{}{},
"timestamp": map[string]interface{}{},
"tokens": 7,
"cost": 0.02,
"timestamp": 1610000000,
}}),
},
)
Expand Down Expand Up @@ -251,9 +251,9 @@ client.InferencePipelines.Data.Stream(
Rows: openlayer.F([]map[string]interface{}{{
"user_query": "what is the meaning of life?",
"output": "42",
"tokens": map[string]interface{}{},
"cost": map[string]interface{}{},
"timestamp": map[string]interface{}{},
"tokens": 7,
"cost": 0.02,
"timestamp": 1610000000,
}}),
},
// This sets the per-retry timeout
Expand Down Expand Up @@ -303,15 +303,53 @@ client.InferencePipelines.Data.Stream(
Rows: openlayer.F([]map[string]interface{}{{
"user_query": "what is the meaning of life?",
"output": "42",
"tokens": map[string]interface{}{},
"cost": map[string]interface{}{},
"timestamp": map[string]interface{}{},
"tokens": 7,
"cost": 0.02,
"timestamp": 1610000000,
}}),
},
option.WithMaxRetries(5),
)
```

### Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when
you need to examine response headers, status codes, or other details.

```go
// Create a variable to store the HTTP response
var response *http.Response
response, err := client.InferencePipelines.Data.Stream(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
openlayer.InferencePipelineDataStreamParams{
Config: openlayer.F[openlayer.InferencePipelineDataStreamParamsConfigUnion](openlayer.InferencePipelineDataStreamParamsConfigLlmData{
InputVariableNames: openlayer.F([]string{"user_query"}),
OutputColumnName: openlayer.F("output"),
NumOfTokenColumnName: openlayer.F("tokens"),
CostColumnName: openlayer.F("cost"),
TimestampColumnName: openlayer.F("timestamp"),
}),
Rows: openlayer.F([]map[string]interface{}{{
"user_query": "what is the meaning of life?",
"output": "42",
"tokens": 7,
"cost": 0.02,
"timestamp": 1610000000,
}}),
},
option.WithResponseInto(&response),
)
if err != nil {
// handle error
}
fmt.Printf("%+v\n", response)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
```

### Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented
Expand Down Expand Up @@ -402,7 +440,7 @@ middleware has been applied.

This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
Expand Down
8 changes: 8 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ Methods:

# Commits

Response Types:

- <a href="https://pkg.go.dev/github.com/openlayer-ai/openlayer-go">openlayer</a>.<a href="https://pkg.go.dev/github.com/openlayer-ai/openlayer-go#CommitGetResponse">CommitGetResponse</a>

Methods:

- <code title="get /versions/{projectVersionId}">client.Commits.<a href="https://pkg.go.dev/github.com/openlayer-ai/openlayer-go#CommitService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, projectVersionID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/openlayer-ai/openlayer-go">openlayer</a>.<a href="https://pkg.go.dev/github.com/openlayer-ai/openlayer-go#CommitGetResponse">CommitGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## TestResults

Response Types:
Expand Down
Loading