1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the Swift Bedrock Library open source project
4+ //
5+ // Copyright (c) 2025 Amazon.com, Inc. or its affiliates
6+ // and the Swift Bedrock Library project authors
7+ // Licensed under Apache License v2.0
8+ //
9+ // See LICENSE.txt for license information
10+ // See CONTRIBUTORS.txt for the list of Swift Bedrock Library project authors
11+ //
12+ // SPDX-License-Identifier: Apache-2.0
13+ //
14+ //===----------------------------------------------------------------------===//
15+
16+ @preconcurrency import AWSBedrockAgentRuntime
17+
18+ public struct RetrieveRequest : Sendable {
19+ public let knowledgeBaseId : String
20+ public let retrievalQuery : String
21+ public let numberOfResults : Int
22+
23+ public init (
24+ knowledgeBaseId: String ,
25+ retrievalQuery: String ,
26+ numberOfResults: Int = 3
27+ ) {
28+ self . knowledgeBaseId = knowledgeBaseId
29+ self . retrievalQuery = retrievalQuery
30+ self . numberOfResults = numberOfResults
31+ }
32+
33+ internal var input : RetrieveInput {
34+ return RetrieveInput (
35+ knowledgeBaseId: knowledgeBaseId,
36+ retrievalConfiguration: BedrockAgentRuntimeClientTypes . KnowledgeBaseRetrievalConfiguration (
37+ vectorSearchConfiguration: BedrockAgentRuntimeClientTypes . KnowledgeBaseVectorSearchConfiguration (
38+ numberOfResults: numberOfResults
39+ )
40+ ) ,
41+ retrievalQuery: BedrockAgentRuntimeClientTypes . KnowledgeBaseQuery ( text: retrievalQuery)
42+ )
43+ }
44+ }
0 commit comments