Skip to content

v2.0.0

Compare
Choose a tag to compare
@madebywelch madebywelch released this 24 Oct 21:11
· 28 commits to main since this release

Full Changelog: v1.0.1...v2.0.0

Changelog v2.0.0

Highlights:

  • Introducing Functional Options: A major shift to enhance the developer experience. Functional options simplify and make it more intuitive to send completion requests.
  • New Utilities: Added utilities to streamline creating prompts, understanding supported regions, and managing IP allowlists.
  • Integration Tests: Incorporated integration tests for the Complete method.

Details:

Functional Options:

  • Adopted functional options to construct a completion request, providing a more flexible and idiomatic way to specify various parameters.
  • Replaced the previous method of direct struct population with functional options, ensuring backward compatibility.

Utilities:

Prompts:

  • GetPrompt(userQuestion string): Easily construct a valid Anthropic prompt with this utility function.
  • GetChatPrompt(chat []Message): Construct a series of back-and-forths for the Anthropic API.

Regions:

  • New SupportedRegions array to quickly determine if a region is supported.

IP Allowlists:

  • Added utility functions to handle Anthropic's provided IP ranges.

Completion Requests:

Regular Completion Request:

  • Simpler and cleaner approach to send completion requests without streaming.
  • See example in the repository for detailed usage.

Streaming Completion Request:

  • Added streaming capabilities for the completion requests.
  • Enables real-time, chunked responses from the Anthropic API.
  • Enhanced the developer experience by making it more intuitive to decide between streaming and non-streaming requests.