DavidSouther / ailly

Your AI Writing Ally
Other
9 stars 6 forks source link

Error running `npx @ailly/cli --prompt 'Tell me a joke'` #148

Closed tkhill-AWS closed 2 months ago

tkhill-AWS commented 3 months ago

Following the CLI instructions, led to:

b0be835864fc :: ~/ailly » npx @ailly/cli --prompt 'Tell me a joke'
(node:44640) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

There was an error calling Bedrock. Please enable model access to model with id anthropic.claude-3-haiku-20240307-v1:0 in the AWS region async () => {
    if (runtimeConfig.region === void 0) {
      throw new Error("Region is missing from runtimeConfig");
    }
    const region = runtimeConfig.region;
    if (typeof region === "string") {
      return region;
    }
    return region();
  }.
There were errors when generating responses:
  stdout: There was an error calling Bedrock. Please enable model access to model with id anthropic.claude-3-haiku-20240307-v1:0 in the AWS region async () => {
    if (runtimeConfig.region === void 0) {
      throw new Error("Region is missing from runtimeConfig");
    }
    const region = runtimeConfig.region;
    if (typeof region === "string") {
      return region;
    }
    return region();
  }.
b0be835864fc :: ~/ailly »

Node version: v21.6.2 Mac: OS version 14.5 Shell: zsh Terminal: iTerm, Build 3.5.0

DavidSouther commented 3 months ago

Looks like there's three issues in here:

  1. Something uses "punycode" which Ailly users don't care about, and got deprecated in 21 so isn't showing up in 20.
  2. When AWS_REGION isn't set, the Bedrock Client's config.region function isn't getting called.
  3. When running stdout, it's printing both individual and summary errors. It only needs to print individual errors.
DavidSouther commented 2 months ago

2 and 3 closed in #150