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.2.0-alpha.5 #53

Merged
merged 12 commits into from
Dec 1, 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
25 changes: 0 additions & 25 deletions .github/workflows/handle-release-pr-title-edit.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.2.0-alpha.4"
".": "0.2.0-alpha.5"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 10
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-0a2d1f4a05e7dbaf05fb3b162f6551f429a33f33b9fc555ae1d4dcc776e77a32.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-cf96271afd65b396dc71c4e897d1d55a9526c122e3890bc87b5ff33316c93853.yml
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 0.2.0-alpha.5 (2024-12-01)

Full Changelog: [v0.2.0-alpha.4...v0.2.0-alpha.5](https://github.com/anthropics/anthropic-sdk-go/compare/v0.2.0-alpha.4...v0.2.0-alpha.5)

### Bug Fixes

* **api:** escape key values when encoding maps ([#56](https://github.com/anthropics/anthropic-sdk-go/issues/56)) ([fa49eb8](https://github.com/anthropics/anthropic-sdk-go/commit/fa49eb8c4f8d6fa7e45ec4e7eb457a87218349c4))
* **client:** no panic on missing BaseURL ([#61](https://github.com/anthropics/anthropic-sdk-go/issues/61)) ([7438b15](https://github.com/anthropics/anthropic-sdk-go/commit/7438b15855bd6b5902d62fdbf02f143544eee986))
* correct required fields for flattened unions ([#59](https://github.com/anthropics/anthropic-sdk-go/issues/59)) ([735c07c](https://github.com/anthropics/anthropic-sdk-go/commit/735c07c66a3bbf54bff97db7fe5290d7635c0774))
* forward error and close for bedrock decoder ([#66](https://github.com/anthropics/anthropic-sdk-go/issues/66)) ([5f6f6fd](https://github.com/anthropics/anthropic-sdk-go/commit/5f6f6fd822b029dffd90aa49b06add0661251de0))
* **types:** remove anthropic-instant-1.2 model ([#57](https://github.com/anthropics/anthropic-sdk-go/issues/57)) ([23fbc37](https://github.com/anthropics/anthropic-sdk-go/commit/23fbc3752122462a1e29e15327b1736072032ba3))


### Chores

* **api:** update spec version ([#62](https://github.com/anthropics/anthropic-sdk-go/issues/62)) ([1526051](https://github.com/anthropics/anthropic-sdk-go/commit/1526051561d4e1fe7792d90f0c2299036fedbc21))
* **ci:** remove unneeded workflow ([#55](https://github.com/anthropics/anthropic-sdk-go/issues/55)) ([0181fc2](https://github.com/anthropics/anthropic-sdk-go/commit/0181fc2796bc5fea1a21e2744257900caef8ee72))
* fix references to content block param types ([dea6478](https://github.com/anthropics/anthropic-sdk-go/commit/dea647890542036c1ed4cc55409002fd2e00adb6))
* **tests:** limit array example length ([#64](https://github.com/anthropics/anthropic-sdk-go/issues/64)) ([9fb231b](https://github.com/anthropics/anthropic-sdk-go/commit/9fb231b806af753b6c9aae82c023e087c2ecaefb))


### Documentation

* add missing docs for some enums ([#54](https://github.com/anthropics/anthropic-sdk-go/issues/54)) ([56db6b8](https://github.com/anthropics/anthropic-sdk-go/commit/56db6b832d0e0454895b6d4ab43d32bd6b7418b4))


### Refactors

* sort fields for squashed union structs ([#51](https://github.com/anthropics/anthropic-sdk-go/issues/51)) ([a9874d1](https://github.com/anthropics/anthropic-sdk-go/commit/a9874d193998572a28475781dd8de296d4021bf2))

## 0.2.0-alpha.4 (2024-11-04)

Full Changelog: [v0.2.0-alpha.3...v0.2.0-alpha.4](https://github.com/anthropics/anthropic-sdk-go/compare/v0.2.0-alpha.3...v0.2.0-alpha.4)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/anthropics/[email protected].4'
go get -u 'github.com/anthropics/[email protected].5'
```

<!-- x-release-please-end -->
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Params Types:

- <a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go">anthropic</a>.<a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go#ContentBlockParamUnion">ContentBlockParamUnion</a>
- <a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go">anthropic</a>.<a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go#ImageBlockParam">ImageBlockParam</a>
- <a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go">anthropic</a>.<a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go#MessageParam">MessageParam</a>
- <a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go">anthropic</a>.<a href="https://pkg.go.dev/github.com/anthropics/anthropic-sdk-go#MetadataParam">MetadataParam</a>
Expand Down
4 changes: 2 additions & 2 deletions bedrock/bedrock.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ type eventstreamDecoder struct {
}

func (e *eventstreamDecoder) Close() error {
return nil
return e.rc.Close()
}

func (e *eventstreamDecoder) Err() error {
return nil
return e.err
}

func (e *eventstreamDecoder) Next() bool {
Expand Down
4 changes: 2 additions & 2 deletions beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ func (r BetaAuthenticationErrorType) IsKnown() bool {
}

type BetaError struct {
Type BetaErrorType `json:"type,required"`
Message string `json:"message,required"`
Type BetaErrorType `json:"type,required"`
JSON betaErrorJSON `json:"-"`
union BetaErrorUnion
}

// betaErrorJSON contains the JSON metadata for the struct [BetaError]
type betaErrorJSON struct {
Type apijson.Field
Message apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down
102 changes: 51 additions & 51 deletions betamessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ func (r BetaCacheControlEphemeralType) IsKnown() bool {

type BetaContentBlock struct {
Type BetaContentBlockType `json:"type,required"`
Text string `json:"text"`
ID string `json:"id"`
Name string `json:"name"`
// This field can have the runtime type of [interface{}].
Input interface{} `json:"input,required"`
Input interface{} `json:"input"`
Name string `json:"name"`
Text string `json:"text"`
JSON betaContentBlockJSON `json:"-"`
union BetaContentBlockUnion
}
Expand All @@ -181,10 +181,10 @@ type BetaContentBlock struct {
// [BetaContentBlock]
type betaContentBlockJSON struct {
Type apijson.Field
Text apijson.Field
ID apijson.Field
Name apijson.Field
Input apijson.Field
Name apijson.Field
Text apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -248,16 +248,16 @@ func (r BetaContentBlockType) IsKnown() bool {
}

type BetaContentBlockParam struct {
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
Type param.Field[BetaContentBlockParamType] `json:"type,required"`
Text param.Field[string] `json:"text"`
Source param.Field[interface{}] `json:"source,required"`
ID param.Field[string] `json:"id"`
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
Content param.Field[interface{}] `json:"content"`
Input param.Field[interface{}] `json:"input"`
IsError param.Field[bool] `json:"is_error"`
Name param.Field[string] `json:"name"`
Input param.Field[interface{}] `json:"input,required"`
Source param.Field[interface{}] `json:"source"`
Text param.Field[string] `json:"text"`
ToolUseID param.Field[string] `json:"tool_use_id"`
IsError param.Field[bool] `json:"is_error"`
Content param.Field[interface{}] `json:"content,required"`
}

func (r BetaContentBlockParam) MarshalJSON() (data []byte, err error) {
Expand Down Expand Up @@ -679,8 +679,8 @@ func (r BetaRawContentBlockDeltaEvent) implementsBetaRawMessageStreamEvent() {}

type BetaRawContentBlockDeltaEventDelta struct {
Type BetaRawContentBlockDeltaEventDeltaType `json:"type,required"`
Text string `json:"text"`
PartialJSON string `json:"partial_json"`
Text string `json:"text"`
JSON betaRawContentBlockDeltaEventDeltaJSON `json:"-"`
union BetaRawContentBlockDeltaEventDeltaUnion
}
Expand All @@ -689,8 +689,8 @@ type BetaRawContentBlockDeltaEventDelta struct {
// [BetaRawContentBlockDeltaEventDelta]
type betaRawContentBlockDeltaEventDeltaJSON struct {
Type apijson.Field
Text apijson.Field
PartialJSON apijson.Field
Text apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -796,11 +796,11 @@ func (r BetaRawContentBlockStartEvent) implementsBetaRawMessageStreamEvent() {}

type BetaRawContentBlockStartEventContentBlock struct {
Type BetaRawContentBlockStartEventContentBlockType `json:"type,required"`
Text string `json:"text"`
ID string `json:"id"`
Name string `json:"name"`
// This field can have the runtime type of [interface{}].
Input interface{} `json:"input,required"`
Input interface{} `json:"input"`
Name string `json:"name"`
Text string `json:"text"`
JSON betaRawContentBlockStartEventContentBlockJSON `json:"-"`
union BetaRawContentBlockStartEventContentBlockUnion
}
Expand All @@ -809,10 +809,10 @@ type BetaRawContentBlockStartEventContentBlock struct {
// struct [BetaRawContentBlockStartEventContentBlock]
type betaRawContentBlockStartEventContentBlockJSON struct {
Type apijson.Field
Text apijson.Field
ID apijson.Field
Name apijson.Field
Input apijson.Field
Name apijson.Field
Text apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -1098,11 +1098,15 @@ func (r BetaRawMessageStopEventType) IsKnown() bool {
}

type BetaRawMessageStreamEvent struct {
Type BetaRawMessageStreamEventType `json:"type,required"`
Message BetaMessage `json:"message"`
Type BetaRawMessageStreamEventType `json:"type,required"`
// This field can have the runtime type of
// [BetaRawContentBlockStartEventContentBlock].
ContentBlock interface{} `json:"content_block"`
// This field can have the runtime type of [BetaRawMessageDeltaEventDelta],
// [BetaRawContentBlockDeltaEventDelta].
Delta interface{} `json:"delta,required"`
Delta interface{} `json:"delta"`
Index int64 `json:"index"`
Message BetaMessage `json:"message"`
// Billing and rate-limit usage.
//
// Anthropic's API bills and rate-limits by token counts, as tokens represent the
Expand All @@ -1115,24 +1119,20 @@ type BetaRawMessageStreamEvent struct {
//
// For example, `output_tokens` will be non-zero, even for an empty string response
// from Claude.
Usage BetaMessageDeltaUsage `json:"usage"`
Index int64 `json:"index"`
// This field can have the runtime type of
// [BetaRawContentBlockStartEventContentBlock].
ContentBlock interface{} `json:"content_block,required"`
JSON betaRawMessageStreamEventJSON `json:"-"`
union BetaRawMessageStreamEventUnion
Usage BetaMessageDeltaUsage `json:"usage"`
JSON betaRawMessageStreamEventJSON `json:"-"`
union BetaRawMessageStreamEventUnion
}

// betaRawMessageStreamEventJSON contains the JSON metadata for the struct
// [BetaRawMessageStreamEvent]
type betaRawMessageStreamEventJSON struct {
Type apijson.Field
Message apijson.Field
ContentBlock apijson.Field
Delta apijson.Field
Usage apijson.Field
Index apijson.Field
ContentBlock apijson.Field
Message apijson.Field
Usage apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -1668,10 +1668,10 @@ func (r BetaToolResultBlockParamType) IsKnown() bool {
}

type BetaToolResultBlockParamContent struct {
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
Type param.Field[BetaToolResultBlockParamContentType] `json:"type,required"`
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
Source param.Field[interface{}] `json:"source"`
Text param.Field[string] `json:"text"`
Source param.Field[interface{}] `json:"source,required"`
}

func (r BetaToolResultBlockParamContent) MarshalJSON() (data []byte, err error) {
Expand Down Expand Up @@ -1750,26 +1750,26 @@ func (r BetaToolTextEditor20241022Type) IsKnown() bool {
}

type BetaToolUnionParam struct {
Type param.Field[BetaToolUnionType] `json:"type"`
// Name of the tool.
//
// This is how the tool will be called by the model and in tool_use blocks.
Name param.Field[string] `json:"name,required"`
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
// Description of what this tool does.
//
// Tool descriptions should be as detailed as possible. The more information that
// the model has about what the tool is and how to use it, the better it will
// perform. You can use natural language descriptions to reinforce important
// aspects of the tool input JSON schema.
Description param.Field[string] `json:"description"`
// Name of the tool.
//
// This is how the tool will be called by the model and in tool_use blocks.
Name param.Field[string] `json:"name,required"`
InputSchema param.Field[interface{}] `json:"input_schema,required"`
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
// The height of the display in pixels.
DisplayHeightPx param.Field[int64] `json:"display_height_px"`
// The width of the display in pixels.
DisplayWidthPx param.Field[int64] `json:"display_width_px"`
// The X11 display number (e.g. 0, 1) for the display.
DisplayNumber param.Field[int64] `json:"display_number"`
// The width of the display in pixels.
DisplayWidthPx param.Field[int64] `json:"display_width_px"`
InputSchema param.Field[interface{}] `json:"input_schema"`
Type param.Field[BetaToolUnionType] `json:"type"`
}

func (r BetaToolUnionParam) MarshalJSON() (data []byte, err error) {
Expand Down Expand Up @@ -2349,26 +2349,26 @@ func (r BetaMessageCountTokensParamsSystemArray) ImplementsBetaMessageCountToken
}

type BetaMessageCountTokensParamsTool struct {
Type param.Field[BetaMessageCountTokensParamsToolsType] `json:"type"`
// Name of the tool.
//
// This is how the tool will be called by the model and in tool_use blocks.
Name param.Field[string] `json:"name,required"`
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
// Description of what this tool does.
//
// Tool descriptions should be as detailed as possible. The more information that
// the model has about what the tool is and how to use it, the better it will
// perform. You can use natural language descriptions to reinforce important
// aspects of the tool input JSON schema.
Description param.Field[string] `json:"description"`
// Name of the tool.
//
// This is how the tool will be called by the model and in tool_use blocks.
Name param.Field[string] `json:"name,required"`
InputSchema param.Field[interface{}] `json:"input_schema,required"`
CacheControl param.Field[BetaCacheControlEphemeralParam] `json:"cache_control"`
// The height of the display in pixels.
DisplayHeightPx param.Field[int64] `json:"display_height_px"`
// The width of the display in pixels.
DisplayWidthPx param.Field[int64] `json:"display_width_px"`
// The X11 display number (e.g. 0, 1) for the display.
DisplayNumber param.Field[int64] `json:"display_number"`
// The width of the display in pixels.
DisplayWidthPx param.Field[int64] `json:"display_width_px"`
InputSchema param.Field[interface{}] `json:"input_schema"`
Type param.Field[BetaMessageCountTokensParamsToolsType] `json:"type"`
}

func (r BetaMessageCountTokensParamsTool) MarshalJSON() (data []byte, err error) {
Expand Down
Loading