Class: AWSCDK::BedrockAgentCore::DataSourceConfig
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::BedrockAgentCore::DataSourceConfig
- Defined in:
- bedrock_agent_core/data_source_config.rb
Overview
Configuration for the data source used in online evaluation.
Use the static factory methods to create data source configurations:
DataSourceConfig.fromAgentRuntimeEndpoint()for AgentCore Runtime (recommended)DataSourceConfig.fromAgentRuntimeEndpointName()for AgentCore Runtime using endpoint name stringDataSourceConfig.fromCloudWatchLogs()for external agents or custom log groups
Class Method Summary collapse
-
.from_agent_runtime_endpoint(runtime, endpoint = nil) ⇒ AWSCDK::BedrockAgentCore::DataSourceConfig
Creates a data source configuration from an AgentCore Runtime and optional endpoint.
-
.from_agent_runtime_endpoint_name(runtime, endpoint_name) ⇒ AWSCDK::BedrockAgentCore::DataSourceConfig
Creates a data source configuration from an AgentCore Runtime and an endpoint name string.
-
.from_cloud_watch_logs(config) ⇒ AWSCDK::BedrockAgentCore::DataSourceConfig
Creates a CloudWatch Logs data source configuration.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#bind ⇒ AWSCDK::BedrockAgentCore::DataSourceConfigBindResult
Binds the data source configuration to produce the L1 property.
-
#cloud_watch_logs_config ⇒ AWSCDK::BedrockAgentCore::CloudWatchLogsDataSourceConfig
The CloudWatch Logs configuration.
-
#initialize(*args) ⇒ DataSourceConfig
constructor
A new instance of DataSourceConfig.
Constructor Details
#initialize(*args) ⇒ DataSourceConfig
Returns a new instance of DataSourceConfig.
21 22 23 |
# File 'bedrock_agent_core/data_source_config.rb', line 21 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_bedrockagentcore.DataSourceConfig does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.from_agent_runtime_endpoint(runtime, endpoint = nil) ⇒ AWSCDK::BedrockAgentCore::DataSourceConfig
Creates a data source configuration from an AgentCore Runtime and optional endpoint.
This is the recommended way to configure evaluation for AgentCore Runtime agents. It automatically derives the CloudWatch log group and service name from the runtime and endpoint.
46 47 48 49 50 |
# File 'bedrock_agent_core/data_source_config.rb', line 46 def self.from_agent_runtime_endpoint(runtime, endpoint = nil) Jsii::Type.check_type(runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5JQmVkcm9ja0FnZW50UnVudGltZSJ9")), "runtime") Jsii::Type.check_type(endpoint, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5JUnVudGltZUVuZHBvaW50In0=")), "endpoint") unless endpoint.nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.DataSourceConfig", "fromAgentRuntimeEndpoint", [runtime, endpoint]) end |
.from_agent_runtime_endpoint_name(runtime, endpoint_name) ⇒ AWSCDK::BedrockAgentCore::DataSourceConfig
Creates a data source configuration from an AgentCore Runtime and an endpoint name string.
Use this method when you want to reference an endpoint by name without
having a construct reference. For construct references, prefer from_agent_runtime_endpoint().
64 65 66 67 68 |
# File 'bedrock_agent_core/data_source_config.rb', line 64 def self.from_agent_runtime_endpoint_name(runtime, endpoint_name) Jsii::Type.check_type(runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5JQmVkcm9ja0FnZW50UnVudGltZSJ9")), "runtime") Jsii::Type.check_type(endpoint_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpointName") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.DataSourceConfig", "fromAgentRuntimeEndpointName", [runtime, endpoint_name]) end |
.from_cloud_watch_logs(config) ⇒ AWSCDK::BedrockAgentCore::DataSourceConfig
Creates a CloudWatch Logs data source configuration.
Use this when your agent traces are stored in CloudWatch Logs, such as for external agents or when you need to specify log groups directly.
82 83 84 85 86 |
# File 'bedrock_agent_core/data_source_config.rb', line 82 def self.from_cloud_watch_logs(config) config = config.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::CloudWatchLogsDataSourceConfig.new(**config.transform_keys(&:to_sym)) : config Jsii::Type.check_type(config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5DbG91ZFdhdGNoTG9nc0RhdGFTb3VyY2VDb25maWcifQ==")), "config") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.DataSourceConfig", "fromCloudWatchLogs", [config]) end |
.jsii_overridable_methods ⇒ Object
25 26 27 28 29 30 |
# File 'bedrock_agent_core/data_source_config.rb', line 25 def self.jsii_overridable_methods { :cloud_watch_logs_config => { kind: :property, name: "cloudWatchLogsConfig", is_optional: false }, :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind ⇒ AWSCDK::BedrockAgentCore::DataSourceConfigBindResult
Binds the data source configuration to produce the L1 property.
98 99 100 |
# File 'bedrock_agent_core/data_source_config.rb', line 98 def bind() jsii_call_method("bind", []) end |
#cloud_watch_logs_config ⇒ AWSCDK::BedrockAgentCore::CloudWatchLogsDataSourceConfig
The CloudWatch Logs configuration.
91 92 93 |
# File 'bedrock_agent_core/data_source_config.rb', line 91 def cloud_watch_logs_config() jsii_get_property("cloudWatchLogsConfig") end |