Class InlineApiSchema
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrock.alpha.ApiSchema
software.amazon.awscdk.services.bedrock.alpha.InlineApiSchema
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T13:52:15.619Z")
@Stability(Experimental)
public class InlineApiSchema
extends ApiSchema
(experimental) Class to define an API Schema from an inline string.
The schema can be provided directly as a string in either JSON or YAML format.
Example:
InlineApiSchema inlineSchema = ApiSchema.fromInline("\nopenapi: 3.0.3\ninfo:\n title: Library API\n version: 1.0.0\npaths:\n /search:\n get:\n summary: Search for books\n operationId: searchBooks\n parameters:\n - name: query\n in: query\n required: true\n schema:\n type: string\n");
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(inlineSchema)
.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
ConstructorsModifierConstructorDescriptionInlineApiSchema(String schema) protectedInlineApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedInlineApiSchema(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.bedrock.alpha.ApiSchema
fromInline, fromLocalAsset, fromS3File, getInlineSchema, getS3FileMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
InlineApiSchema
protected InlineApiSchema(software.amazon.jsii.JsiiObjectRef objRef) -
InlineApiSchema
protected InlineApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
InlineApiSchema
- Parameters:
schema- This parameter is required.
-