1import * as Alchemy from "alchemy";
2import * as AWS from "alchemy/AWS";
3import * as Output from "alchemy/Output";
4import * as Effect from "effect/Effect";
5import ChatFunction from "./src/ChatFunction.ts";
6
7// AWS.providers() already provides AWSEnvironment from the SSO profile
8// named by $AWS_PROFILE (defaults to "default").
9const aws = AWS.providers();
10
11export default Alchemy.Stack(
12 "BedrockAI",
13 {
14 providers: aws,
15 state: Alchemy.localState(),
16 },
17 Effect.gen(function* () {
18 const func = yield* ChatFunction;
19 return {
20 url: func.functionUrl,
21 streamUrl: Output.interpolate`${func.functionUrl}stream?prompt=Write+a+haiku`,
22 weatherUrl: Output.interpolate`${func.functionUrl}weather?prompt=What's+the+weather+in+Seattle%3F`,
23 };
24 }),
25);