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

chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.289 to 0.1.290 #5917

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions examples/event_handler_bedrock_agents/cdk/bedrock_agent_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
)
from aws_cdk.aws_lambda import Runtime
from aws_cdk.aws_lambda_python_alpha import PythonFunction
from cdklabs.generative_ai_cdk_constructs.bedrock import (
ActionGroupExecutor,
Agent,
AgentActionGroup,
ApiSchema,
BedrockFoundationModel,
)
from cdklabs.generative_ai_cdk_constructs import bedrock
from constructs import Construct


Expand All @@ -27,22 +21,20 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
handler="lambda_handler",
)

agent = Agent(
agent = bedrock.Agent(
self,
"Agent",
foundation_model=BedrockFoundationModel.ANTHROPIC_CLAUDE_INSTANT_V1_2,
foundation_model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_INSTANT_V1_2,
instruction="You are a helpful and friendly agent that answers questions about insurance claims.",
)

executor_group = ActionGroupExecutor(lambda_=action_group_function)

action_group = AgentActionGroup(
self,
"ActionGroup",
action_group_name="InsureClaimsSupport",
action_group: bedrock.AgentActionGroup = bedrock.AgentActionGroup(
name="InsureClaimsSupport",
description="Use these functions for insurance claims support",
action_group_executor=executor_group,
action_group_state="ENABLED",
api_schema=ApiSchema.from_asset("./lambda/openapi.json"), # (2)!
executor=bedrock.ActionGroupExecutor.fromlambda_function(
lambda_function=action_group_function,
),
enabled=True,
api_schema=bedrock.ApiSchema.from_local_asset("./lambda/openapi.json"), # (2)!
)
agent.add_action_group(action_group)
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading