@@ -2649,41 +2649,51 @@ class DTableWebAPI {
26492649 return this . req . delete ( url ) ;
26502650 }
26512651
2652+ // embedding collections
26522653 listEmbeddingCollections ( dtableUuid ) {
26532654 const url = this . server + '/api/v2.1/embedding-collections/?dtable_uuid=' + dtableUuid ;
26542655 return this . req . get ( url ) ;
26552656 }
26562657
2657- createEmbeddingCollection ( dtableUuid , tableId ) {
2658+ createEmbeddingCollection ( dtableUuid , tableIds ) {
26582659 let url = this . server + '/api/v2.1/embedding-collections/' ;
26592660 let data = {
26602661 'dtable_uuid' : dtableUuid ,
2661- 'table_id ' : tableId ,
2662+ 'table_ids ' : tableIds ,
26622663 } ;
2663- return this . _sendPostRequest ( url , data , { headers : { 'Content-Type' : 'application/json' } } ) ;
2664+ return this . _sendPostRequest ( url , data , { headers : { 'Content-Type' : 'application/json' } } ) ;
2665+ }
2666+
2667+ deleteEmbeddingCollection ( collectionId ) {
2668+ const url = this . server + '/api/v2.1/embedding-collections/' + collectionId + '/' ;
2669+ return this . req . delete ( url ) ;
26642670 }
26652671
2666- semanticSearch ( dtableUuid , tableId , query ) {
2672+ updateEmbeddingCollection ( collectionId ) {
2673+ const url = this . server + '/api/v2.1/embedding-collections/' + collectionId + '/' ;
2674+ return this . req . put ( url ) ;
2675+ }
2676+
2677+ queryEmbeddingCollectionStatus ( taskId ) {
2678+ const url = this . server + '/api/v2.1/embedding-collections/task-status/?task_id=' + taskId ;
2679+ return this . req . get ( url ) ;
2680+ }
2681+
2682+ semanticSearch ( dtableUuid , query , { tableIds, count } = { } ) {
26672683 let url = this . server + '/api/v2.1/similarity-search/' ;
26682684 let params = {
26692685 'dtable_uuid' : dtableUuid ,
2670- 'table_id' : tableId ,
2671- 'query' : query
2686+ 'query' : query ,
26722687 } ;
2688+ if ( tableIds ) {
2689+ params [ 'table_ids' ] = tableIds ;
2690+ }
2691+ if ( count ) {
2692+ params [ 'count' ] = count ;
2693+ }
26732694 return this . _sendPostRequest ( url , params , { headers : { 'Content-Type' : 'application/json' } } ) ;
26742695 }
26752696
2676- deleteEmbeddingCollection ( dtableUuid , collectionId ) {
2677- const url = this . server + '/api/v2.1/embedding-collections/' + collectionId + '/?dtable_uuid=' + dtableUuid ;
2678- return this . req . delete ( url ) ;
2679- }
2680-
2681- updateEmbeddingCollection ( dtableUuid , collectionId ) {
2682- const url = this . server + '/api/v2.1/embedding-collections/' + collectionId + '/' ;
2683- let params = { dtable_uuid : dtableUuid } ;
2684- return this . req . put ( url , params ) ;
2685- }
2686-
26872697 // org admin api
26882698 orgAdminUpdateOrgInfo ( newOrgName ) {
26892699 let url = this . server + '/api/v2.1/org/admin/info/' ;
0 commit comments