Skip to content

Commit 02755f9

Browse files
committed
chore: wip
1 parent 40a7b5f commit 02755f9

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

config/ai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212

1313
models: [
1414
// 'amazon.titan-embed-text-v1',
15-
// 'amazon.titan-text-express-v1',
15+
'amazon.titan-text-express-v1',
1616
// 'amazon.titan-embed-image-v1',
1717
// 'amazon.titan-image-generator-v1',
1818
// 'anthropic.claude-v1',

storage/framework/.stacks/core/cloud/src/cloud/ai.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ export class AiStack {
2323

2424
// Defining the Node.js Lambda function
2525
const aiLambda = new lambda.Function(scope, 'LambdaFunction', {
26+
functionName: `${props.slug}-${props.appEnv}-ai`,
2627
runtime: lambda.Runtime.NODEJS_20_X,
2728
handler: 'index.handler',
2829
code: lambda.Code.fromAsset('src/cloud/lambda'), // path relative to the cloud root package dir
2930
layers: [awsSdkLayer],
3031
})
3132

3233
const api = new apigateway.LambdaRestApi(scope, 'ApiGateway', {
34+
restApiName: `${props.slug}-${props.appEnv}-ai`,
3335
handler: aiLambda,
3436
})
3537

storage/framework/.stacks/core/cloud/src/cloud/lambda/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ async function handler(event) {
88
console.log(`Question received: ${question}`)
99
const bedrockRuntime = new AWS.BedrockRuntime({ apiVersion: '2023-09-30' })
1010
const res = await bedrockRuntime.invokeModel({
11-
modelId: 'ai21.j2-ultra-v1',
11+
modelId: 'amazon.titan-text-express-v1',
1212
contentType: 'application/json',
1313
accept: '*/*',
1414
body: `{"prompt": "${question}","maxTokens":200,"temperature":0.7,"topP":1,"stopSequences":[],"countPenalty":{"scale":0},"presencePenalty":{"scale":0},"frequencyPenalty":{"scale":0}}`,

0 commit comments

Comments
 (0)