Class: AWSCDK::BedrockAgentCore::InlineToolSchema
- Inherits:
-
ToolSchema
- Object
- ToolSchema
- AWSCDK::BedrockAgentCore::InlineToolSchema
- Defined in:
- bedrock_agent_core/inline_tool_schema.rb
Overview
Class to define a Tool Schema from an inline string.
The schema can be provided directly as a string in either JSON or YAML format.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(scope) ⇒ void
Bind the schema to a construct.
-
#bucket_owner_account_id ⇒ String?
The account ID of the S3 bucket owner for cross-account access.
-
#grant_permissions_to_role(_role) ⇒ void
Grant permissions to the role.
-
#initialize(schema) ⇒ InlineToolSchema
constructor
A new instance of InlineToolSchema.
-
#inline_schema ⇒ Array<AWSCDK::BedrockAgentCore::ToolDefinition>?
The inline tool schema definition as a string, if using an inline schema.
-
#s3_file ⇒ AWSCDK::S3::Location?
The S3 location of the tool schema file, if using an S3-based schema.
Constructor Details
#initialize(schema) ⇒ InlineToolSchema
Returns a new instance of InlineToolSchema.
11 12 13 14 15 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 11 def initialize(schema) schema = schema.is_a?(Array) ? schema.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::ToolDefinition.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : schema Jsii::Type.check_type(schema, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLlRvb2xEZWZpbml0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "schema") Jsii::Object.instance_method(:initialize).bind(self).call(schema) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 17 def self.jsii_overridable_methods { :bucket_owner_account_id => { kind: :property, name: "bucketOwnerAccountId", is_optional: true }, :inline_schema => { kind: :property, name: "inlineSchema", is_optional: true }, :s3_file => { kind: :property, name: "s3File", is_optional: true }, :bind => { kind: :method, name: "bind", is_optional: false }, :grant_permissions_to_role => { kind: :method, name: "grantPermissionsToRole", is_optional: false }, } end |
Instance Method Details
#bind(scope) ⇒ void
This method returns an undefined value.
Bind the schema to a construct.
56 57 58 59 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 56 def bind(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") jsii_call_method("bind", [scope]) end |
#bucket_owner_account_id ⇒ String?
The account ID of the S3 bucket owner for cross-account access.
30 31 32 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 30 def bucket_owner_account_id() jsii_get_property("bucketOwnerAccountId") end |
#grant_permissions_to_role(_role) ⇒ void
This method returns an undefined value.
Grant permissions to the role.
65 66 67 68 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 65 def (_role) Jsii::Type.check_type(_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "_role") jsii_call_method("grantPermissionsToRole", [_role]) end |
#inline_schema ⇒ Array<AWSCDK::BedrockAgentCore::ToolDefinition>?
The inline tool schema definition as a string, if using an inline schema.
Can be in JSON or YAML format.
39 40 41 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 39 def inline_schema() jsii_get_property("inlineSchema") end |
#s3_file ⇒ AWSCDK::S3::Location?
The S3 location of the tool schema file, if using an S3-based schema.
Contains the bucket name and object key information.
48 49 50 |
# File 'bedrock_agent_core/inline_tool_schema.rb', line 48 def s3_file() jsii_get_property("s3File") end |