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

fix(deps): update dependency @anthropic-ai/sdk to v0.21.1 #134

Merged
merged 1 commit into from
May 29, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 29, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@anthropic-ai/sdk 0.20.9 -> 0.21.1 age adoption passing confidence

Release Notes

anthropics/anthropic-sdk-typescript (@​anthropic-ai/sdk)

v0.21.1

Full Changelog: sdk-v0.21.0...sdk-v0.21.1

Chores

v0.21.0

Full Changelog: sdk-v0.20.9...sdk-v0.21.0

Features
  • api: add tool_choice param, image block params inside tool_result.content, and streaming for tool_use blocks (#​418) (421a1e6)
Chores

Configuration

📅 Schedule: Branch creation - "* 0-4 * * 3" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Copy link

[puLL-Merge] - anthropics/[email protected]

Description

This PR makes several changes to the Anthropic SDK, including:

  • Adds streaming support for the beta Tools API, including a new ToolsBetaMessageStream class and client.beta.tools.messages.stream() method
  • Updates the OpenAPI spec and regenerates the SDK, adding some new types and updating documentation links
  • Bumps the SDK version to 0.21.1
  • Adds a new examples/tools-streaming.ts example showing how to use the new streaming functionality
  • Updates the build and lint scripts
Changes

Changes

  • .github/workflows/ci.yml: Updates the build and lint steps in the CI workflow
  • .release-please-manifest.json, CHANGELOG.md, package.json: Bumps version to 0.21.1
  • SECURITY.md: Adds a new security policy file with instructions for reporting vulnerabilities
  • api.md: Regenerated API docs, adding new InputJsonDelta type and ToolsBetaMessageStreamEvent types
  • examples/tools-streaming.ts: New example demonstrating the Tools streaming API
  • scripts/:
    • Updates build-all script to call build subscript
    • Adds format script to run eslint with --fix flag
    • Updates lint script to print a message
    • Removes extra blank lines from test script
  • src/:
    • Adds ToolsBetaMessageStream class in lib/ for Tools streaming
    • Regenerates SDK from updated OpenAPI spec, adding new stream types and methods
    • Adds partial JSON parser in _vendor/ for parsing JSON stream deltas
  • tests/api-resources/beta/tools/messages.test.ts: Adds tool_choice param in test

Security Hotspots

None. The changes are to the SDK itself and do not introduce any new major security risks.

Copy link

bedrock debug - [puLL-Merge] - anthropics/[email protected]

Description

This PR updates the Anthropic SDK with the latest API changes for the beta Tools feature. It adds support for streaming and partial JSON parsing for tool_use content blocks, and a new tool_choice parameter to control how the model uses tools. The PR also updates links to the latest Anthropic docs, fixes some typos, and makes other minor improvements.

Changes

Changes

  • api.md: Regenerated with latest resource and type definitions
  • CHANGELOG.md, package.json, src/version.ts: Version bumped to 0.21.1
  • scripts/:
    • Added format script to run eslint --fix
    • Improved logging in build scripts
  • src/:
    • Added ToolsBetaMessageStream class to support streaming for Tools beta
    • Added InputJsonDelta type and other new event types for streaming tool_use blocks
    • Added tool_choice parameter to MessageCreateParams
    • Vendored in partial-json-parser to support partial JSON parsing for tool_use input deltas
    • Updated doc links to point to new URLs
  • examples/: Added tools-streaming.ts example demonstrating the new streaming functionality
  • tests/: Updated messages test with new tool_choice param

Possible Issues

No major issues noticed. The new partial JSON parsing and streaming functionality looks solid.

Security Hotspots

None noticed. The vendored partial-json-parser library could potentially be a security risk, but the code looks safe and it is only used for parsing the model's output, not arbitrary user input.

Copy link

openai debug - [puLL-Merge] - anthropics/[email protected]

Description

This pull request primarily introduces support for streaming tool messages and refines the build and testing processes. Key changes include:

  • Enhancements to the GitHub Actions CI workflow.
  • Updates of dependencies and versions.
  • Introduction of ToolsBetaMessageStream for handling message streams.
  • Updates to API resources and parameters.
  • Addition of security policies and improved documentation.

Possible Issues

  • Backward Compatibility: The change in the build script name from build to build-all might break existing automated workflows/scripts that still call build.
  • Documentation Synchronization: Ensure all references to build in the documentation are updated to build-all to avoid confusion.

Security Hotspots

None identified.

Changes

Changes

  • .github/workflows/ci.yml

    • Simplified the commands for installing dependencies and running type checks.
    • Changed the type checking command from yarn build to ./scripts/lint.
  • .release-please-manifest.json

    • Updated versions for the main package and sub-packages.
  • .stats.yml

    • Updated the openapi_spec_url to a new file.
  • CHANGELOG.md and packages/*/CHANGELOG.md

    • Added entries for the new versions with details on changes.
  • SECURITY.md

    • Added a new security policy file describing how to report security vulnerabilities.
  • api.md

    • Documented new stream handling methods and types.
  • examples/tools-streaming.ts

    • Added a new example script to demonstrate the use of the new streaming tools API.
  • package.json

    • Updated version from 0.20.9 to 0.21.1.
    • Changed the build script from ./scripts/build to ./scripts/build-all.
  • scripts/build-all

    • Updated to call bash ./scripts/build instead of yarn build.
  • scripts/format

    • New script to run eslint --fix.
  • scripts/lint

    • Added a log message before running eslint.
  • scripts/test

    • Simplified by removing redundant comments; retains the core functionality to run tests using Jest.
  • src/_vendor/partial-json-parser/*

    • Added a new partial JSON parser vendor directory with typescript conversion.
  • src/lib/ToolsBetaMessageStream.ts

    • Added a new library to handle message streaming.
  • src/resources/beta/tools/index.ts and src/resources/beta/tools/messages.ts

    • Enhanced to include new streaming events and parameters.
  • src/resources/messages.ts and src/resources/completions.ts

    • Updated the URLs in the comments to point to the new locations.
  • src/version.ts

    • Incremented the SDK version.
  • tests/api-resources/beta/tools/messages.test.ts

    • Added a new test to validate tool_choice: { type: 'auto' }.

Copy link

anthropic debug - [puLL-Merge] - anthropics/[email protected]

Description

This PR adds support for streaming response events in the beta Tools API. It also updates the underlying OpenAPI spec and regenerates the SDK.

The key changes are:

  • Adds a new ToolsBetaMessageStream class for conveniently handling streamed responses
  • Adds new event types and interfaces for streamed Tools API responses, including InputJsonDelta for partial JSON updates to tool_use inputs
  • Updates the Messages.create() method to return a stream when called with stream: true
  • Adds a new Messages.stream() method as a convenience for creating a ToolsBetaMessageStream
Changes

Changes

  • .github/workflows/ci.yml: Updates the CI workflow to run linting with a script
  • .release-please-manifest.json, package.json, CHANGELOG.md, api.md: Version bump and changelog update
  • SECURITY.md: Adds a new security policy file
  • examples/tools-streaming.ts: Adds an example of using the new streaming functionality
  • scripts/build-all, scripts/format, scripts/lint: Updates build and lint scripts
  • src/_vendor/partial-json-parser/*: Vendors a 3rd party partial JSON parser and converts it to TypeScript
  • src/lib/ToolsBetaMessageStream.ts: Implements the new ToolsBetaMessageStream class
  • src/resources/beta/tools/*: Regenerated beta Tools API types and methods
  • src/resources/completions.ts, src/resources/messages.ts: Documentation link updates
  • tests/api-resources/beta/tools/messages.test.ts: Adds tool_choice to test

@thypon thypon merged commit bdbb575 into main May 29, 2024
9 checks passed
@thypon thypon deleted the renovate/anthropic-ai-sdk-0.x branch May 29, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant