@@ -1554,6 +1554,50 @@ export interface RetrieveAndGenerateInput {
1554
1554
text : string | undefined ;
1555
1555
}
1556
1556
1557
+ /**
1558
+ * @public
1559
+ * @enum
1560
+ */
1561
+ export const SearchType = {
1562
+ HYBRID : "HYBRID" ,
1563
+ SEMANTIC : "SEMANTIC" ,
1564
+ } as const ;
1565
+
1566
+ /**
1567
+ * @public
1568
+ */
1569
+ export type SearchType = ( typeof SearchType ) [ keyof typeof SearchType ] ;
1570
+
1571
+ /**
1572
+ * @public
1573
+ * Knowledge base vector search configuration
1574
+ */
1575
+ export interface KnowledgeBaseVectorSearchConfiguration {
1576
+ /**
1577
+ * @public
1578
+ * Top-K results to retrieve from knowledge base.
1579
+ */
1580
+ numberOfResults ?: number ;
1581
+
1582
+ /**
1583
+ * @public
1584
+ * Override the type of query to be performed on data store
1585
+ */
1586
+ overrideSearchType ?: SearchType ;
1587
+ }
1588
+
1589
+ /**
1590
+ * @public
1591
+ * Search parameters for retrieving from knowledge base.
1592
+ */
1593
+ export interface KnowledgeBaseRetrievalConfiguration {
1594
+ /**
1595
+ * @public
1596
+ * Knowledge base vector search configuration
1597
+ */
1598
+ vectorSearchConfiguration : KnowledgeBaseVectorSearchConfiguration | undefined ;
1599
+ }
1600
+
1557
1601
/**
1558
1602
* @public
1559
1603
* Configurations for retrieval and generation for knowledge base.
@@ -1570,6 +1614,12 @@ export interface KnowledgeBaseRetrieveAndGenerateConfiguration {
1570
1614
* Arn of a Bedrock model.
1571
1615
*/
1572
1616
modelArn : string | undefined ;
1617
+
1618
+ /**
1619
+ * @public
1620
+ * Search parameters for retrieving from knowledge base.
1621
+ */
1622
+ retrievalConfiguration ?: KnowledgeBaseRetrievalConfiguration ;
1573
1623
}
1574
1624
1575
1625
/**
@@ -1679,30 +1729,6 @@ export interface RetrieveAndGenerateResponse {
1679
1729
citations ?: Citation [ ] ;
1680
1730
}
1681
1731
1682
- /**
1683
- * @public
1684
- * Knowledge base vector search configuration
1685
- */
1686
- export interface KnowledgeBaseVectorSearchConfiguration {
1687
- /**
1688
- * @public
1689
- * Top-K results to retrieve from knowledge base.
1690
- */
1691
- numberOfResults : number | undefined ;
1692
- }
1693
-
1694
- /**
1695
- * @public
1696
- * Search parameters for retrieving from knowledge base.
1697
- */
1698
- export interface KnowledgeBaseRetrievalConfiguration {
1699
- /**
1700
- * @public
1701
- * Knowledge base vector search configuration
1702
- */
1703
- vectorSearchConfiguration : KnowledgeBaseVectorSearchConfiguration | undefined ;
1704
- }
1705
-
1706
1732
/**
1707
1733
* @public
1708
1734
* Knowledge base input query.
@@ -1811,12 +1837,72 @@ export const InvokeAgentRequestFilterSensitiveLog = (obj: InvokeAgentRequest): a
1811
1837
...( obj . inputText && { inputText : SENSITIVE_STRING } ) ,
1812
1838
} ) ;
1813
1839
1840
+ /**
1841
+ * @internal
1842
+ */
1843
+ export const TextResponsePartFilterSensitiveLog = ( obj : TextResponsePart ) : any => ( {
1844
+ ...obj ,
1845
+ } ) ;
1846
+
1847
+ /**
1848
+ * @internal
1849
+ */
1850
+ export const GeneratedResponsePartFilterSensitiveLog = ( obj : GeneratedResponsePart ) : any => ( {
1851
+ ...obj ,
1852
+ ...( obj . textResponsePart && { textResponsePart : SENSITIVE_STRING } ) ,
1853
+ } ) ;
1854
+
1855
+ /**
1856
+ * @internal
1857
+ */
1858
+ export const RetrievalResultContentFilterSensitiveLog = ( obj : RetrievalResultContent ) : any => ( {
1859
+ ...obj ,
1860
+ } ) ;
1861
+
1862
+ /**
1863
+ * @internal
1864
+ */
1865
+ export const RetrievalResultLocationFilterSensitiveLog = ( obj : RetrievalResultLocation ) : any => ( {
1866
+ ...obj ,
1867
+ } ) ;
1868
+
1869
+ /**
1870
+ * @internal
1871
+ */
1872
+ export const RetrievedReferenceFilterSensitiveLog = ( obj : RetrievedReference ) : any => ( {
1873
+ ...obj ,
1874
+ ...( obj . content && { content : SENSITIVE_STRING } ) ,
1875
+ ...( obj . location && { location : SENSITIVE_STRING } ) ,
1876
+ } ) ;
1877
+
1878
+ /**
1879
+ * @internal
1880
+ */
1881
+ export const CitationFilterSensitiveLog = ( obj : Citation ) : any => ( {
1882
+ ...obj ,
1883
+ ...( obj . generatedResponsePart && {
1884
+ generatedResponsePart : GeneratedResponsePartFilterSensitiveLog ( obj . generatedResponsePart ) ,
1885
+ } ) ,
1886
+ ...( obj . retrievedReferences && {
1887
+ retrievedReferences : obj . retrievedReferences . map ( ( item ) => RetrievedReferenceFilterSensitiveLog ( item ) ) ,
1888
+ } ) ,
1889
+ } ) ;
1890
+
1891
+ /**
1892
+ * @internal
1893
+ */
1894
+ export const AttributionFilterSensitiveLog = ( obj : Attribution ) : any => ( {
1895
+ ...obj ,
1896
+ ...( obj . citations && { citations : obj . citations . map ( ( item ) => CitationFilterSensitiveLog ( item ) ) } ) ,
1897
+ } ) ;
1898
+
1814
1899
/**
1815
1900
* @internal
1816
1901
*/
1817
1902
export const PayloadPartFilterSensitiveLog = ( obj : PayloadPart ) : any => ( {
1818
1903
...obj ,
1819
1904
...( obj . bytes && { bytes : SENSITIVE_STRING } ) ,
1905
+ ...( obj . attribution && { attribution : AttributionFilterSensitiveLog ( obj . attribution ) } ) ,
1820
1906
} ) ;
1821
1907
1822
1908
/**
@@ -1865,6 +1951,16 @@ export const FinalResponseFilterSensitiveLog = (obj: FinalResponse): any => ({
1865
1951
...( obj . text && { text : SENSITIVE_STRING } ) ,
1866
1952
} ) ;
1867
1953
1954
+ /**
1955
+ * @internal
1956
+ */
1957
+ export const KnowledgeBaseLookupOutputFilterSensitiveLog = ( obj : KnowledgeBaseLookupOutput ) : any => ( {
1958
+ ...obj ,
1959
+ ...( obj . retrievedReferences && {
1960
+ retrievedReferences : obj . retrievedReferences . map ( ( item ) => RetrievedReferenceFilterSensitiveLog ( item ) ) ,
1961
+ } ) ,
1962
+ } ) ;
1963
+
1868
1964
/**
1869
1965
* @internal
1870
1966
*/
@@ -1881,6 +1977,9 @@ export const ObservationFilterSensitiveLog = (obj: Observation): any => ({
1881
1977
...( obj . actionGroupInvocationOutput && {
1882
1978
actionGroupInvocationOutput : ActionGroupInvocationOutputFilterSensitiveLog ( obj . actionGroupInvocationOutput ) ,
1883
1979
} ) ,
1980
+ ...( obj . knowledgeBaseLookupOutput && {
1981
+ knowledgeBaseLookupOutput : KnowledgeBaseLookupOutputFilterSensitiveLog ( obj . knowledgeBaseLookupOutput ) ,
1982
+ } ) ,
1884
1983
...( obj . finalResponse && { finalResponse : FinalResponseFilterSensitiveLog ( obj . finalResponse ) } ) ,
1885
1984
...( obj . repromptResponse && { repromptResponse : SENSITIVE_STRING } ) ,
1886
1985
} ) ;
@@ -2030,6 +2129,7 @@ export const RetrieveAndGenerateOutputFilterSensitiveLog = (obj: RetrieveAndGene
2030
2129
export const RetrieveAndGenerateResponseFilterSensitiveLog = ( obj : RetrieveAndGenerateResponse ) : any => ( {
2031
2130
...obj ,
2032
2131
...( obj . output && { output : SENSITIVE_STRING } ) ,
2132
+ ...( obj . citations && { citations : obj . citations . map ( ( item ) => CitationFilterSensitiveLog ( item ) ) } ) ,
2033
2133
} ) ;
2034
2134
2035
2135
/**
@@ -2047,6 +2147,15 @@ export const RetrieveRequestFilterSensitiveLog = (obj: RetrieveRequest): any =>
2047
2147
...( obj . retrievalQuery && { retrievalQuery : SENSITIVE_STRING } ) ,
2048
2148
} ) ;
2049
2149
2150
+ /**
2151
+ * @internal
2152
+ */
2153
+ export const KnowledgeBaseRetrievalResultFilterSensitiveLog = ( obj : KnowledgeBaseRetrievalResult ) : any => ( {
2154
+ ...obj ,
2155
+ ...( obj . content && { content : SENSITIVE_STRING } ) ,
2156
+ ...( obj . location && { location : SENSITIVE_STRING } ) ,
2157
+ } ) ;
2158
+
2050
2159
/**
2051
2160
* @internal
2052
2161
*/
0 commit comments