0.1.3 • Published 6 months ago

@winglibs/bedrock v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

bedrock

A Wing library for working with Amazon Bedrock.

Prerequisites

Installation

npm i @winglibs/bedrock

Usage

bring bedrock;

pub class JokeMaker {
  claud: bedrock.Model;

  new() {
    this.claud = new bedrock.Model("anthropic.claude-v2") as "claude";
  }

  pub inflight makeJoke(topic: str): str {
    let res = this.claud.invoke({
      prompt: "\n\nHuman: Tell me a joke about {topic}\n\nAssistant:",
      max_tokens_to_sample: 300,
      temperature: 0.5,
      top_k: 250,
      top_p: 1,
      stop_sequences: [
        "\n\nHuman:"
      ],
      anthropic_version: "bedrock-2023-05-31"
    });

    return res["completion"].asStr();
  }
}

Development & Testing

When running in simulator using wing run, request are sent to Amazon Bedrock. When running tests using wing test or by running tests from within Wing Console, requests are handled by the mocked service.

Maintainers

@eladb, @ekeren

License

This library is licensed under the MIT License.

0.1.3

6 months ago

0.1.2

10 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago