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
    Modifier
    Constructor
    Description
    protected
     
    protected
     
    protected
    ApiSchema(Location s3File, String inlineSchema)
     
    protected
    ApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    ApiSchema(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (experimental) Creates an API Schema from an inline string.
    (experimental) Creates an API Schema from a local file.
    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

      @Stability(Experimental) protected ApiSchema(@Nullable Location s3File)
      Parameters:
      s3File -
    • ApiSchema

      @Stability(Experimental) protected ApiSchema()
  • Method Details

    • fromInline

      @Stability(Experimental) @NotNull public static InlineApiSchema fromInline(@NotNull String schema)
      (experimental) Creates an API Schema from an inline string.

      Parameters:
      schema -
      • the JSON or YAML payload defining the OpenAPI schema for the action group.
      This parameter is required.
    • fromLocalAsset

      @Stability(Experimental) @NotNull public static AssetApiSchema fromLocalAsset(@NotNull String path)
      (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.
      This parameter is required.
    • 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.
      This parameter is required.
      objectKey -
      • object key in the bucket.
      This parameter is required.
    • getInlineSchema

      @Stability(Experimental) @Nullable public String getInlineSchema()
      (experimental) The inline OpenAPI schema definition as a string, if using an inline schema.

      Can be in JSON or YAML format.

    • getS3File

      @Stability(Experimental) @Nullable public Location getS3File()
      (experimental) The S3 location of the API schema file, if using an S3-based schema.

      Contains the bucket name and object key information.