1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Amazon Bedrock AgentCore SDK for Rust.
//!
//! The `runtime` module hosts an agent on
//! [AgentCore Runtime](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agents-tools-runtime.html).
//! It serves `POST /invocations` and `GET /ping` as the Runtime HTTP contract requires.
//!
// The example needs the `runtime` feature. Without it the code block is not compiled.
//! use bedrock_agentcore::{RequestContext, runtime::BedrockAgentCoreApp};
//! use serde_json::{Value, json};
//!
//! async fn handle(payload: Value, ctx: RequestContext) -> Result<Value, std::convert::Infallible> {
//! Ok(json!({ "echo": payload, "session_id": ctx.session_id() }))
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), bedrock_agentcore::Error> {
//! BedrockAgentCoreApp::builder().invocation(handle).build()?.run().await
//! }
//! ```
//!
//! The `identity` module gets the credentials that the agent needs for the services
//! it calls, such as API keys, from
//! [AgentCore Identity](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html).
//!
//! # Features
//!
//! - `runtime` (default): the HTTP server in the `runtime` module.
//! - `identity` (default): the client of AgentCore Identity in the `identity` module.
//! It depends on the AWS SDK for Rust.
//!
//! With neither feature the crate has no networking dependencies. The [`context`]
//! and [`tasks`] modules are always available.
pub use RequestContext;
pub use ;
/// The `http` crate, whose header types appear in [`RequestContext`]. With this
/// re-export a caller can write `bedrock_agentcore::http::HeaderValue` without a
/// dependency on `http` of its own.
pub use http;