| 1 | import type * as bedrock from "@distilled.cloud/aws/bedrock-agent"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { DataSource } from "./DataSource.ts"; |
| 5 | |
| 6 | /** |
| 7 | * The `ListKnowledgeBaseDocuments` request with the binding-injected |
| 8 | * `knowledgeBaseId` and `dataSourceId` removed — they are supplied |
| 9 | * automatically from the bound {@link DataSource}. |
| 10 | */ |
| 11 | export interface ListKnowledgeBaseDocumentsRequest extends Omit< |
| 12 | bedrock.ListKnowledgeBaseDocumentsRequest, |
| 13 | "knowledgeBaseId" | "dataSourceId" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Runtime binding for `bedrock-agent:ListKnowledgeBaseDocuments` — list the |
| 18 | * documents tracked in the bound {@link DataSource} together with their |
| 19 | * ingestion status. |
| 20 | * |
| 21 | * The binding grants the function `bedrock:ListKnowledgeBaseDocuments` |
| 22 | * scoped to the data source's parent knowledge base. |
| 23 | * |
| 24 | * ### Direct Document Ingestion |
| 25 | * **Example:** List Tracked Documents |
| 26 | * ```typescript |
| 27 | * // init |
| 28 | * const listDocuments = yield* Bedrock.ListKnowledgeBaseDocuments(dataSource); |
| 29 | * |
| 30 | * // runtime |
| 31 | * const { documentDetails } = yield* listDocuments({ maxResults: 25 }); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface ListKnowledgeBaseDocuments extends Binding.Service< |
| 37 | ListKnowledgeBaseDocuments, |
| 38 | "AWS.Bedrock.ListKnowledgeBaseDocuments", |
| 39 | <D extends DataSource>( |
| 40 | dataSource: D, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: ListKnowledgeBaseDocumentsRequest, |
| 44 | ) => Effect.Effect< |
| 45 | bedrock.ListKnowledgeBaseDocumentsResponse, |
| 46 | bedrock.ListKnowledgeBaseDocumentsError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const ListKnowledgeBaseDocuments = |
| 51 | Binding.Service<ListKnowledgeBaseDocuments>( |
| 52 | "AWS.Bedrock.ListKnowledgeBaseDocuments", |
| 53 | ); |