Class ApiSchema
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrock.alpha.ApiSchema
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
AssetApiSchema
,InlineApiSchema
,S3ApiSchema
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)",
date="2025-07-16T11:43:25.119Z")
@Stability(Experimental)
public abstract class ApiSchema
extends software.amazon.jsii.JsiiObject
(experimental) Represents the concept of an API Schema for a Bedrock Agent Action Group.
Example:
IBucket bucket = Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket"); S3ApiSchema s3Schema = ApiSchema.fromS3File(bucket, "schemas/action-group.yaml"); Function actionGroupFunction = Function.Builder.create(this, "ActionGroupFunction") .runtime(Runtime.PYTHON_3_12) .handler("index.handler") .code(Code.fromAsset(join(__dirname, "../lambda/action-group"))) .build(); AgentActionGroup actionGroup = AgentActionGroup.Builder.create() .name("query-library") .description("Use these functions to get information about the books in the library.") .executor(ActionGroupExecutor.fromLambda(actionGroupFunction)) .enabled(true) .apiSchema(s3Schema) .build(); Agent agent = Agent.Builder.create(this, "Agent") .foundationModel(BedrockFoundationModel.ANTHROPIC_CLAUDE_HAIKU_V1_0) .instruction("You are a helpful and friendly agent that answers questions about literature.") .build(); agent.addActionGroup(actionGroup);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InlineApiSchema
fromInline
(String schema) (experimental) Creates an API Schema from an inline string.static AssetApiSchema
fromLocalAsset
(String path) (experimental) Creates an API Schema from a local file.static S3ApiSchema
fromS3File
(IBucket bucket, String objectKey) (experimental) Creates an API Schema from an S3 File.(experimental) The inline OpenAPI schema definition as a string, if using an inline schema.(experimental) The S3 location of the API schema file, if using an S3-based schema.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ApiSchema
protected ApiSchema(software.amazon.jsii.JsiiObjectRef objRef) -
ApiSchema
protected ApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ApiSchema
@Stability(Experimental) protected ApiSchema(@Nullable Location s3File, @Nullable String inlineSchema) - Parameters:
s3File
-inlineSchema
-
-
ApiSchema
- Parameters:
s3File
-
-
ApiSchema
@Stability(Experimental) protected ApiSchema()
-
-
Method Details
-
fromInline
(experimental) Creates an API Schema from an inline string.- Parameters:
schema
-- the JSON or YAML payload defining the OpenAPI schema for the action group.
-
fromLocalAsset
(experimental) Creates an API Schema from a local file.- Parameters:
path
-- the path to the local file containing the OpenAPI schema for the action group.
-
fromS3File
@Stability(Experimental) @NotNull public static S3ApiSchema fromS3File(@NotNull IBucket bucket, @NotNull String objectKey) (experimental) Creates an API Schema from an S3 File.- Parameters:
bucket
-- the bucket containing the local file containing the OpenAPI schema for the action group.
objectKey
-- object key in the bucket.
-
getInlineSchema
(experimental) The inline OpenAPI schema definition as a string, if using an inline schema.Can be in JSON or YAML format.
-
getS3File
(experimental) The S3 location of the API schema file, if using an S3-based schema.Contains the bucket name and object key information.
-