oscerd opened a new pull request, #23110: URL: https://github.com/apache/camel/pull/23110
## What this adds Wires the Bedrock Agent Runtime `InvokeFlow` API into the existing `aws-bedrock-agent-runtime` component ([CAMEL-23468](https://issues.apache.org/jira/browse/CAMEL-23468)). * New `invokeFlow` value on `BedrockAgentRuntimeOperations`. * New endpoint options on `BedrockAgentRuntimeConfiguration` (URI group `flow`): * `flowIdentifier` — id of the flow to invoke * `flowAliasIdentifier` — id of the flow alias to invoke * `enableTrace` — collect `FlowTraceEvent`s into a header * New `BedrockAgentRuntimeAsyncClient` slot on the configuration/endpoint with autowire support. The Netty-based async client is only built when the endpoint needs event streaming (`operation=invokeFlow`) or when the user provides one — existing `retrieveAndGenerate` users pay no new cost. * Per-exchange overrides via dedicated headers: * `CamelAwsBedrockAgentRuntimeFlowIdentifier` * `CamelAwsBedrockAgentRuntimeFlowAliasIdentifier` * `CamelAwsBedrockAgentRuntimeFlowEnableTrace` * `CamelAwsBedrockAgentRuntimeFlowExecutionId` (for multi-turn flow continuation) * Producer behaviour: * In-body conversion: `String` → single `FlowInput` targeting `FlowInputNode`/output `document`; or pass an already-built `FlowInput` / `List<FlowInput>`; or in `pojoRequest=true` mode, pass an `InvokeFlowRequest`. * Async invocation drives the `InvokeFlowResponseHandler` visitor and accumulates events. * Out-message headers: `CamelAwsBedrockAgentRuntimeFlowOutputs` (always), `CamelAwsBedrockAgentRuntimeFlowTraces` (when traces were emitted), `CamelAwsBedrockAgentRuntimeFlowCompletionReason` (when present). * Out-body: the document of the last `FlowOutputEvent` (decoded as `String` when the document is a string). ## Tests New unit tests (don't require AWS credentials): * `BedrockAgentRuntimeEndpointTest` — endpoint URI parsing for the new flow options, lazy async-client lifecycle (built on start for `invokeFlow`, NOT built for `retrieveAndGenerate` unless user supplied one). * `BedrockAgentRuntimeProducerInvokeFlowTest` — request building from `String` body, header overrides for flow id/alias/trace, validation error when `flowIdentifier` is missing. Uses Mockito to capture the `InvokeFlowRequest` against a mocked async client. End-to-end testing against real AWS is left to the existing integration-test pattern (manual run with credentials). ## Docs `aws-bedrock-agent-runtime-component.adoc` now lists supported operations and documents the `invokeFlow` workflow (mandatory/optional options, accepted body shapes, response headers, out-body contract). ## Out of scope / follow-up * CAMEL-23464 (drop `required = true` from `modelId`/`knowledgeBaseId` when they don't apply to the chosen operation) is intentionally not touched here — that ticket is open separately. Users invoking `invokeFlow` with the URI catalog will still see those two as required even though the producer doesn't read them. --- _Claude Code on behalf of Andrea Cosentino_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
