Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Amazon Bedrock Agents support #554

Open
wants to merge 96 commits into
base: main
Choose a base branch
from

Conversation

massi-ang
Copy link
Collaborator

Issue #, if available:
#277
Description of changes:

  • adds Bedrock Agents as a selectable "models" in the model dropdown. Agents must be manually created in the same region where Bedrock is accessed
  • restyle of the ChatUI following CloudScape guidelines

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

removed unused API resources
correctly replacing api_handler function
for better code diff
@@ -0,0 +1,67 @@
# Support additional models
Copy link
Collaborator

@charles-marion charles-marion Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc is possibly a copy of https://github.com/aws-samples/aws-genai-llm-chatbot/blob/main/lib/model-interfaces/langchain/README.md (or a work in progress?)

Is the content applicable?

@@ -0,0 +1,31 @@
import os
Copy link
Collaborator

@charles-marion charles-marion Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file needed? (Could be extended to support open ai agent equivalent?)

"interface": ModelInterface.AGENT.value,
"ragSupported": False,
"agentId": a["agentId"],
"agentVersion": "TSTALIASID",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this value?

lib/shared/layers/python-sdk/python/genai_core/models.py Outdated Show resolved Hide resolved
@@ -86,3 +88,24 @@ export class SharedAssetBundler extends Construct {
return Code.fromBucket(asset.bucket, asset.s3ObjectKey);
}
}

class BuildImageProvider extends Construct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,257 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this file is auto generated by the weather lambda? Is there a cli command to do this?

import os
import requests
from typing import Annotated
import pandas as pd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nip: I believe pandas is large and would cause cold start due to numpy. I would remove this dependency if it's easy (I believe Panda has smaller managed lambda layers)

}:017000801446:layer:AWSLambdaPowertoolsPythonV2:58`
);

const placeIndex = new geo.CfnPlaceIndex(this, "place-index", {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: other classes use this case for construct ids

Suggested change
const placeIndex = new geo.CfnPlaceIndex(this, "place-index", {
const placeIndex = new geo.CfnPlaceIndex(this, "PlaceIndex", {

@@ -349,7 +360,7 @@ export default function ChatInputPanel(props: ChatInputPanelProps) {
const { name, provider } = OptionsHelper.parseValue(
state.selectedModel.value
);

console.log(state.selectedModel.value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(state.selectedModel.value);

debug code?


const agent = new bedrock.Agent(this, "weather-agent", {
foundationModel:
bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_INSTANT_V1_2,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to switch to Sonnet 3 or Haiku now

{
type: "confirm",
name: "bedrockAgents",
message: "Do you want to deploy a sample Bedrock Agent?",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add something like (Agent with access to workspace and weather .. backed by Claude [insert model]) just to give an idea of the out of the box one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants