@airweave/sdk 0.6.36 → 0.6.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/index.d.ts +1 -1
- package/dist/cjs/api/index.js +1 -1
- package/dist/cjs/api/resources/collections/client/Client.d.ts +32 -56
- package/dist/cjs/api/resources/collections/client/Client.js +65 -86
- package/dist/cjs/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.d.ts → SearchGetLegacyCollectionsReadableIdSearchGetRequest.d.ts} +3 -3
- package/dist/cjs/api/resources/collections/client/requests/index.d.ts +1 -2
- package/dist/cjs/api/resources/collections/index.d.ts +1 -0
- package/dist/cjs/api/resources/collections/index.js +1 -0
- package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.d.ts +5 -0
- package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.js +5 -0
- package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.d.ts +5 -0
- package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.js +5 -0
- package/dist/cjs/api/resources/collections/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/collections/types/index.js +18 -0
- package/dist/cjs/api/resources/index.d.ts +2 -1
- package/dist/cjs/api/resources/index.js +3 -2
- package/dist/cjs/api/types/LegacySearchRequest.d.ts +39 -0
- package/dist/cjs/api/{resources/collections/client/requests/SearchRequest.js → types/LegacySearchRequest.js} +5 -5
- package/dist/cjs/api/types/LegacySearchResponse.d.ts +17 -0
- package/dist/cjs/api/types/LegacySearchResponse.js +5 -0
- package/dist/cjs/api/types/OrganizationMetrics.d.ts +42 -0
- package/dist/cjs/api/types/OrganizationMetrics.js +5 -0
- package/dist/cjs/api/types/RetrievalStrategy.d.ts +12 -0
- package/dist/cjs/api/types/RetrievalStrategy.js +11 -0
- package/dist/cjs/api/types/SearchRequest.d.ts +29 -0
- package/dist/cjs/api/types/SearchRequest.js +5 -0
- package/dist/cjs/api/types/SearchResponse.d.ts +1 -6
- package/dist/cjs/api/types/User.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +5 -0
- package/dist/cjs/api/types/index.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/index.d.mts +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/resources/collections/client/Client.d.mts +32 -56
- package/dist/esm/api/resources/collections/client/Client.mjs +65 -86
- package/dist/esm/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.d.mts → SearchGetLegacyCollectionsReadableIdSearchGetRequest.d.mts} +3 -3
- package/dist/esm/api/resources/collections/client/requests/index.d.mts +1 -2
- package/dist/esm/api/resources/collections/index.d.mts +1 -0
- package/dist/esm/api/resources/collections/index.mjs +1 -0
- package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.d.mts +5 -0
- package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.mjs +4 -0
- package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.d.mts +5 -0
- package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.mjs +4 -0
- package/dist/esm/api/resources/collections/types/index.d.mts +2 -0
- package/dist/esm/api/resources/collections/types/index.mjs +2 -0
- package/dist/esm/api/resources/index.d.mts +2 -1
- package/dist/esm/api/resources/index.mjs +2 -1
- package/dist/esm/api/types/LegacySearchRequest.d.mts +39 -0
- package/dist/esm/api/types/LegacySearchRequest.mjs +11 -0
- package/dist/esm/api/types/LegacySearchResponse.d.mts +17 -0
- package/dist/esm/api/types/LegacySearchResponse.mjs +4 -0
- package/dist/esm/api/types/OrganizationMetrics.d.mts +42 -0
- package/dist/esm/api/types/OrganizationMetrics.mjs +4 -0
- package/dist/esm/api/types/RetrievalStrategy.d.mts +12 -0
- package/dist/esm/api/types/RetrievalStrategy.mjs +8 -0
- package/dist/esm/api/types/SearchRequest.d.mts +29 -0
- package/dist/esm/api/types/SearchRequest.mjs +4 -0
- package/dist/esm/api/types/SearchResponse.d.mts +1 -6
- package/dist/esm/api/types/User.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +5 -0
- package/dist/esm/api/types/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +39 -65
- package/dist/cjs/api/resources/collections/client/requests/SearchRequest.d.ts +0 -50
- package/dist/esm/api/resources/collections/client/requests/SearchRequest.d.mts +0 -50
- package/dist/esm/api/resources/collections/client/requests/SearchRequest.mjs +0 -11
- /package/dist/cjs/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.js → SearchGetLegacyCollectionsReadableIdSearchGetRequest.js} +0 -0
- /package/dist/esm/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.mjs → SearchGetLegacyCollectionsReadableIdSearchGetRequest.mjs} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Comprehensive organization metrics for admin dashboard.
|
|
6
|
+
*
|
|
7
|
+
* Combines organization info with billing and usage metrics from the Usage model.
|
|
8
|
+
*/
|
|
9
|
+
export interface OrganizationMetrics {
|
|
10
|
+
/** Organization ID */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Organization name */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Organization description */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** When organization was created */
|
|
17
|
+
created_at: string;
|
|
18
|
+
/** Last modification time */
|
|
19
|
+
modified_at: string;
|
|
20
|
+
/** Auth0 organization ID */
|
|
21
|
+
auth0_org_id?: string;
|
|
22
|
+
/** Current billing plan (trial, starter, pro, enterprise) */
|
|
23
|
+
billing_plan?: string;
|
|
24
|
+
/** Billing status (active, cancelled, past_due, etc.) */
|
|
25
|
+
billing_status?: string;
|
|
26
|
+
/** Stripe customer ID */
|
|
27
|
+
stripe_customer_id?: string;
|
|
28
|
+
/** When trial ends */
|
|
29
|
+
trial_ends_at?: string;
|
|
30
|
+
/** Number of users in organization */
|
|
31
|
+
user_count?: number;
|
|
32
|
+
/** Number of source connections (from Usage.source_connections) */
|
|
33
|
+
source_connection_count?: number;
|
|
34
|
+
/** Total number of entities (from Usage.entities) */
|
|
35
|
+
entity_count?: number;
|
|
36
|
+
/** Total number of queries (from Usage.queries) */
|
|
37
|
+
query_count?: number;
|
|
38
|
+
/** Whether the current admin user is already a member */
|
|
39
|
+
is_member?: boolean;
|
|
40
|
+
/** Admin's role in this organization (if member) */
|
|
41
|
+
member_role?: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Retrieval strategies for search.
|
|
6
|
+
*/
|
|
7
|
+
export type RetrievalStrategy = "hybrid" | "neural" | "keyword";
|
|
8
|
+
export declare const RetrievalStrategy: {
|
|
9
|
+
readonly Hybrid: "hybrid";
|
|
10
|
+
readonly Neural: "neural";
|
|
11
|
+
readonly Keyword: "keyword";
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RetrievalStrategy = void 0;
|
|
7
|
+
exports.RetrievalStrategy = {
|
|
8
|
+
Hybrid: "hybrid",
|
|
9
|
+
Neural: "neural",
|
|
10
|
+
Keyword: "keyword",
|
|
11
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as AirweaveSDK from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Search request schema.
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchRequest {
|
|
9
|
+
/** The search query text */
|
|
10
|
+
query: string;
|
|
11
|
+
/** The retrieval strategy to use */
|
|
12
|
+
retrieval_strategy?: AirweaveSDK.RetrievalStrategy;
|
|
13
|
+
/** Qdrant native filter for metadata-based filtering */
|
|
14
|
+
filter?: AirweaveSDK.Filter;
|
|
15
|
+
/** Number of results to skip */
|
|
16
|
+
offset?: number;
|
|
17
|
+
/** Maximum number of results to return */
|
|
18
|
+
limit?: number;
|
|
19
|
+
/** Weight recent content higher than older content; 0 = no recency effect, 1 = only recent items matter */
|
|
20
|
+
temporal_relevance?: number;
|
|
21
|
+
/** Generate a few query variations to improve recall */
|
|
22
|
+
expand_query?: boolean;
|
|
23
|
+
/** Extract structured filters from natural-language query */
|
|
24
|
+
interpret_filters?: boolean;
|
|
25
|
+
/** Reorder the top candidate results for improved relevance. Max number of results that can be reranked is capped to around 1000. */
|
|
26
|
+
rerank?: boolean;
|
|
27
|
+
/** Generate a natural-language answer to the query */
|
|
28
|
+
generate_answer?: boolean;
|
|
29
|
+
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as AirweaveSDK from "../index.js";
|
|
5
4
|
/**
|
|
6
5
|
* Comprehensive search response containing results and metadata.
|
|
7
6
|
*/
|
|
8
7
|
export interface SearchResponse {
|
|
9
8
|
/** Array of search result objects containing the found documents, records, or data entities. */
|
|
10
9
|
results: Record<string, unknown>[];
|
|
11
|
-
/**
|
|
12
|
-
response_type: AirweaveSDK.ResponseType;
|
|
13
|
-
/** AI-generated natural language answer when response_type is 'completion'. This provides natural language answers to your query based on the content found across your connected data sources. */
|
|
10
|
+
/** This provides natural language answers to your query based on the content found across your connected data sources when generate_answer is true. */
|
|
14
11
|
completion?: string;
|
|
15
|
-
/** Status of the search operation indicating the quality and availability of results:<br/>• **success**: Search found relevant results matching your query<br/>• **no_relevant_results**: Search completed but found no sufficiently relevant matches<br/>• **no_results**: Search found no results at all, possibly indicating empty collections or very specific queries */
|
|
16
|
-
status: AirweaveSDK.SearchStatus;
|
|
17
12
|
}
|
|
@@ -58,6 +58,8 @@ export * from "./InvitationCreate.js";
|
|
|
58
58
|
export * from "./InvitationResponse.js";
|
|
59
59
|
export * from "./IsEmptyCondition.js";
|
|
60
60
|
export * from "./IsNullCondition.js";
|
|
61
|
+
export * from "./LegacySearchRequest.js";
|
|
62
|
+
export * from "./LegacySearchResponse.js";
|
|
61
63
|
export * from "./MatchAny.js";
|
|
62
64
|
export * from "./MatchExcept.js";
|
|
63
65
|
export * from "./MatchPhrase.js";
|
|
@@ -75,13 +77,16 @@ export * from "./OAuthTokenAuthentication.js";
|
|
|
75
77
|
export * from "./OAuthType.js";
|
|
76
78
|
export * from "./Organization.js";
|
|
77
79
|
export * from "./OrganizationCreate.js";
|
|
80
|
+
export * from "./OrganizationMetrics.js";
|
|
78
81
|
export * from "./OrganizationWithRole.js";
|
|
79
82
|
export * from "./PayloadField.js";
|
|
80
83
|
export * from "./QueryExpansionStrategy.js";
|
|
81
84
|
export * from "./ResponseType.js";
|
|
85
|
+
export * from "./RetrievalStrategy.js";
|
|
82
86
|
export * from "./ScheduleConfig.js";
|
|
83
87
|
export * from "./ScheduleDetails.js";
|
|
84
88
|
export * from "./ScheduleResponse.js";
|
|
89
|
+
export * from "./SearchRequest.js";
|
|
85
90
|
export * from "./SearchResponse.js";
|
|
86
91
|
export * from "./SearchStatus.js";
|
|
87
92
|
export * from "./SingleActionCheckResponse.js";
|
|
@@ -74,6 +74,8 @@ __exportStar(require("./InvitationCreate.js"), exports);
|
|
|
74
74
|
__exportStar(require("./InvitationResponse.js"), exports);
|
|
75
75
|
__exportStar(require("./IsEmptyCondition.js"), exports);
|
|
76
76
|
__exportStar(require("./IsNullCondition.js"), exports);
|
|
77
|
+
__exportStar(require("./LegacySearchRequest.js"), exports);
|
|
78
|
+
__exportStar(require("./LegacySearchResponse.js"), exports);
|
|
77
79
|
__exportStar(require("./MatchAny.js"), exports);
|
|
78
80
|
__exportStar(require("./MatchExcept.js"), exports);
|
|
79
81
|
__exportStar(require("./MatchPhrase.js"), exports);
|
|
@@ -91,13 +93,16 @@ __exportStar(require("./OAuthTokenAuthentication.js"), exports);
|
|
|
91
93
|
__exportStar(require("./OAuthType.js"), exports);
|
|
92
94
|
__exportStar(require("./Organization.js"), exports);
|
|
93
95
|
__exportStar(require("./OrganizationCreate.js"), exports);
|
|
96
|
+
__exportStar(require("./OrganizationMetrics.js"), exports);
|
|
94
97
|
__exportStar(require("./OrganizationWithRole.js"), exports);
|
|
95
98
|
__exportStar(require("./PayloadField.js"), exports);
|
|
96
99
|
__exportStar(require("./QueryExpansionStrategy.js"), exports);
|
|
97
100
|
__exportStar(require("./ResponseType.js"), exports);
|
|
101
|
+
__exportStar(require("./RetrievalStrategy.js"), exports);
|
|
98
102
|
__exportStar(require("./ScheduleConfig.js"), exports);
|
|
99
103
|
__exportStar(require("./ScheduleDetails.js"), exports);
|
|
100
104
|
__exportStar(require("./ScheduleResponse.js"), exports);
|
|
105
|
+
__exportStar(require("./SearchRequest.js"), exports);
|
|
101
106
|
__exportStar(require("./SearchResponse.js"), exports);
|
|
102
107
|
__exportStar(require("./SearchStatus.js"), exports);
|
|
103
108
|
__exportStar(require("./SingleActionCheckResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "v0.6.
|
|
1
|
+
export declare const SDK_VERSION = "v0.6.38";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -11,8 +11,8 @@ export class AirweaveSDKClient {
|
|
|
11
11
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
12
12
|
"X-Fern-Language": "JavaScript",
|
|
13
13
|
"X-Fern-SDK-Name": "@airweave/sdk",
|
|
14
|
-
"X-Fern-SDK-Version": "v0.6.
|
|
15
|
-
"User-Agent": "@airweave/sdk/v0.6.
|
|
14
|
+
"X-Fern-SDK-Version": "v0.6.38",
|
|
15
|
+
"User-Agent": "@airweave/sdk/v0.6.38",
|
|
16
16
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
17
17
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
18
18
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
package/dist/esm/api/index.d.mts
CHANGED
package/dist/esm/api/index.mjs
CHANGED
|
@@ -98,88 +98,64 @@ export declare class Collections {
|
|
|
98
98
|
delete(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
|
|
99
99
|
private __delete;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Trigger data synchronization for all source connections in the collection.
|
|
102
102
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
103
|
+
* The sync jobs run asynchronously in the background, so this endpoint
|
|
104
|
+
* returns immediately with job details that you can use to track progress. You can
|
|
105
|
+
* monitor the status of individual data synchronization using the source connection
|
|
106
|
+
* endpoints.
|
|
105
107
|
*
|
|
106
|
-
* @param {string} readableId - The unique readable identifier of the collection to
|
|
107
|
-
* @param {AirweaveSDK.SearchCollectionsReadableIdSearchGetRequest} request
|
|
108
|
+
* @param {string} readableId - The unique readable identifier of the collection to refresh
|
|
108
109
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
110
|
*
|
|
110
111
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
111
112
|
*
|
|
112
113
|
* @example
|
|
113
|
-
* await client.collections.
|
|
114
|
-
* query: "customer payment issues",
|
|
115
|
-
* response_type: "raw",
|
|
116
|
-
* limit: 1,
|
|
117
|
-
* offset: 1,
|
|
118
|
-
* recency_bias: 1.1
|
|
119
|
-
* })
|
|
114
|
+
* await client.collections.refreshAllSourceConnections("readable_id")
|
|
120
115
|
*/
|
|
121
|
-
|
|
122
|
-
private
|
|
116
|
+
refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob[]>;
|
|
117
|
+
private __refreshAllSourceConnections;
|
|
123
118
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* This endpoint
|
|
127
|
-
*
|
|
128
|
-
* - Pagination with offset and limit
|
|
129
|
-
* - Score threshold filtering
|
|
130
|
-
* - Query expansion strategies (default: AUTO, generates up to 4 variations)
|
|
131
|
-
* - Automatic filter extraction from natural language (default: ON)
|
|
132
|
-
* - LLM-based result reranking (default: ON)
|
|
133
|
-
*
|
|
134
|
-
* Default behavior:
|
|
135
|
-
* - Query expansion: ON (AUTO strategy)
|
|
136
|
-
* - Query interpretation: ON (extracts filters from natural language)
|
|
137
|
-
* - Reranking: ON (improves relevance using LLM)
|
|
138
|
-
* - Score threshold: None (no filtering)
|
|
139
|
-
*
|
|
140
|
-
* To disable features, explicitly set:
|
|
141
|
-
* - enable_reranking: false
|
|
142
|
-
* - enable_query_interpretation: false
|
|
143
|
-
* - expansion_strategy: "no_expansion"
|
|
119
|
+
* Legacy GET search endpoint for backwards compatibility.
|
|
120
|
+
*
|
|
121
|
+
* DEPRECATED: This endpoint uses the old schema. Please migrate to POST with the new
|
|
122
|
+
* SearchRequest format for access to all features.
|
|
144
123
|
*
|
|
145
124
|
* @param {string} readableId - The unique readable identifier of the collection to search
|
|
146
|
-
* @param {AirweaveSDK.
|
|
125
|
+
* @param {AirweaveSDK.SearchGetLegacyCollectionsReadableIdSearchGetRequest} request
|
|
147
126
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
148
127
|
*
|
|
149
128
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
150
129
|
*
|
|
151
130
|
* @example
|
|
152
|
-
* await client.collections.
|
|
153
|
-
* query: "
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* },
|
|
159
|
-
* limit: 10,
|
|
160
|
-
* score_threshold: 0.7,
|
|
161
|
-
* response_type: "completion"
|
|
131
|
+
* await client.collections.searchGetLegacy("readable_id", {
|
|
132
|
+
* query: "query",
|
|
133
|
+
* response_type: "raw",
|
|
134
|
+
* limit: 1,
|
|
135
|
+
* offset: 1,
|
|
136
|
+
* recency_bias: 1.1
|
|
162
137
|
* })
|
|
163
138
|
*/
|
|
164
|
-
|
|
165
|
-
private
|
|
139
|
+
searchGetLegacy(readableId: string, request: AirweaveSDK.SearchGetLegacyCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.LegacySearchResponse>;
|
|
140
|
+
private __searchGetLegacy;
|
|
166
141
|
/**
|
|
167
|
-
*
|
|
142
|
+
* Search your collection.
|
|
168
143
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* monitor the status of individual data synchronization using the source connection
|
|
172
|
-
* endpoints.
|
|
144
|
+
* Accepts both new SearchRequest and legacy LegacySearchRequest formats
|
|
145
|
+
* for backwards compatibility.
|
|
173
146
|
*
|
|
174
|
-
* @param {string} readableId - The unique readable identifier of the collection
|
|
147
|
+
* @param {string} readableId - The unique readable identifier of the collection
|
|
148
|
+
* @param {AirweaveSDK.SearchCollectionsReadableIdSearchPostRequest} request
|
|
175
149
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
150
|
*
|
|
177
151
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
178
152
|
*
|
|
179
153
|
* @example
|
|
180
|
-
* await client.collections.
|
|
154
|
+
* await client.collections.search("readable_id", {
|
|
155
|
+
* query: "query"
|
|
156
|
+
* })
|
|
181
157
|
*/
|
|
182
|
-
|
|
183
|
-
private
|
|
158
|
+
search(readableId: string, request: AirweaveSDK.SearchCollectionsReadableIdSearchPostRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchCollectionsReadableIdSearchPostResponse>;
|
|
159
|
+
private __search;
|
|
184
160
|
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
185
161
|
}
|
|
@@ -283,53 +283,33 @@ export class Collections {
|
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
286
|
-
*
|
|
286
|
+
* Trigger data synchronization for all source connections in the collection.
|
|
287
287
|
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
288
|
+
* The sync jobs run asynchronously in the background, so this endpoint
|
|
289
|
+
* returns immediately with job details that you can use to track progress. You can
|
|
290
|
+
* monitor the status of individual data synchronization using the source connection
|
|
291
|
+
* endpoints.
|
|
290
292
|
*
|
|
291
|
-
* @param {string} readableId - The unique readable identifier of the collection to
|
|
292
|
-
* @param {AirweaveSDK.SearchCollectionsReadableIdSearchGetRequest} request
|
|
293
|
+
* @param {string} readableId - The unique readable identifier of the collection to refresh
|
|
293
294
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
295
|
*
|
|
295
296
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
296
297
|
*
|
|
297
298
|
* @example
|
|
298
|
-
* await client.collections.
|
|
299
|
-
* query: "customer payment issues",
|
|
300
|
-
* response_type: "raw",
|
|
301
|
-
* limit: 1,
|
|
302
|
-
* offset: 1,
|
|
303
|
-
* recency_bias: 1.1
|
|
304
|
-
* })
|
|
299
|
+
* await client.collections.refreshAllSourceConnections("readable_id")
|
|
305
300
|
*/
|
|
306
|
-
|
|
307
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
301
|
+
refreshAllSourceConnections(readableId, requestOptions) {
|
|
302
|
+
return core.HttpResponsePromise.fromPromise(this.__refreshAllSourceConnections(readableId, requestOptions));
|
|
308
303
|
}
|
|
309
|
-
|
|
304
|
+
__refreshAllSourceConnections(readableId, requestOptions) {
|
|
310
305
|
return __awaiter(this, void 0, void 0, function* () {
|
|
311
306
|
var _a, _b, _c;
|
|
312
|
-
const { query, response_type: responseType, limit, offset, recency_bias: recencyBias } = request;
|
|
313
|
-
const _queryParams = {};
|
|
314
|
-
_queryParams["query"] = query;
|
|
315
|
-
if (responseType != null) {
|
|
316
|
-
_queryParams["response_type"] = responseType;
|
|
317
|
-
}
|
|
318
|
-
if (limit != null) {
|
|
319
|
-
_queryParams["limit"] = limit.toString();
|
|
320
|
-
}
|
|
321
|
-
if (offset != null) {
|
|
322
|
-
_queryParams["offset"] = offset.toString();
|
|
323
|
-
}
|
|
324
|
-
if (recencyBias != null) {
|
|
325
|
-
_queryParams["recency_bias"] = recencyBias.toString();
|
|
326
|
-
}
|
|
327
307
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
328
308
|
const _response = yield core.fetcher({
|
|
329
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/
|
|
330
|
-
method: "
|
|
309
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/refresh_all`),
|
|
310
|
+
method: "POST",
|
|
331
311
|
headers: _headers,
|
|
332
|
-
queryParameters:
|
|
312
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
333
313
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
334
314
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
335
315
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -357,7 +337,7 @@ export class Collections {
|
|
|
357
337
|
rawResponse: _response.rawResponse,
|
|
358
338
|
});
|
|
359
339
|
case "timeout":
|
|
360
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling
|
|
340
|
+
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/refresh_all.");
|
|
361
341
|
case "unknown":
|
|
362
342
|
throw new errors.AirweaveSDKError({
|
|
363
343
|
message: _response.error.errorMessage,
|
|
@@ -367,61 +347,53 @@ export class Collections {
|
|
|
367
347
|
});
|
|
368
348
|
}
|
|
369
349
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* This endpoint supports:
|
|
373
|
-
* - Metadata filtering using Qdrant's native filter syntax
|
|
374
|
-
* - Pagination with offset and limit
|
|
375
|
-
* - Score threshold filtering
|
|
376
|
-
* - Query expansion strategies (default: AUTO, generates up to 4 variations)
|
|
377
|
-
* - Automatic filter extraction from natural language (default: ON)
|
|
378
|
-
* - LLM-based result reranking (default: ON)
|
|
379
|
-
*
|
|
380
|
-
* Default behavior:
|
|
381
|
-
* - Query expansion: ON (AUTO strategy)
|
|
382
|
-
* - Query interpretation: ON (extracts filters from natural language)
|
|
383
|
-
* - Reranking: ON (improves relevance using LLM)
|
|
384
|
-
* - Score threshold: None (no filtering)
|
|
350
|
+
* Legacy GET search endpoint for backwards compatibility.
|
|
385
351
|
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* - enable_query_interpretation: false
|
|
389
|
-
* - expansion_strategy: "no_expansion"
|
|
352
|
+
* DEPRECATED: This endpoint uses the old schema. Please migrate to POST with the new
|
|
353
|
+
* SearchRequest format for access to all features.
|
|
390
354
|
*
|
|
391
355
|
* @param {string} readableId - The unique readable identifier of the collection to search
|
|
392
|
-
* @param {AirweaveSDK.
|
|
356
|
+
* @param {AirweaveSDK.SearchGetLegacyCollectionsReadableIdSearchGetRequest} request
|
|
393
357
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
394
358
|
*
|
|
395
359
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
396
360
|
*
|
|
397
361
|
* @example
|
|
398
|
-
* await client.collections.
|
|
399
|
-
* query: "
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
* },
|
|
405
|
-
* limit: 10,
|
|
406
|
-
* score_threshold: 0.7,
|
|
407
|
-
* response_type: "completion"
|
|
362
|
+
* await client.collections.searchGetLegacy("readable_id", {
|
|
363
|
+
* query: "query",
|
|
364
|
+
* response_type: "raw",
|
|
365
|
+
* limit: 1,
|
|
366
|
+
* offset: 1,
|
|
367
|
+
* recency_bias: 1.1
|
|
408
368
|
* })
|
|
409
369
|
*/
|
|
410
|
-
|
|
411
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
370
|
+
searchGetLegacy(readableId, request, requestOptions) {
|
|
371
|
+
return core.HttpResponsePromise.fromPromise(this.__searchGetLegacy(readableId, request, requestOptions));
|
|
412
372
|
}
|
|
413
|
-
|
|
373
|
+
__searchGetLegacy(readableId, request, requestOptions) {
|
|
414
374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
415
375
|
var _a, _b, _c;
|
|
376
|
+
const { query, response_type: responseType, limit, offset, recency_bias: recencyBias } = request;
|
|
377
|
+
const _queryParams = {};
|
|
378
|
+
_queryParams["query"] = query;
|
|
379
|
+
if (responseType != null) {
|
|
380
|
+
_queryParams["response_type"] = responseType;
|
|
381
|
+
}
|
|
382
|
+
if (limit != null) {
|
|
383
|
+
_queryParams["limit"] = limit.toString();
|
|
384
|
+
}
|
|
385
|
+
if (offset != null) {
|
|
386
|
+
_queryParams["offset"] = offset.toString();
|
|
387
|
+
}
|
|
388
|
+
if (recencyBias != null) {
|
|
389
|
+
_queryParams["recency_bias"] = recencyBias.toString();
|
|
390
|
+
}
|
|
416
391
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
417
392
|
const _response = yield core.fetcher({
|
|
418
393
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
|
|
419
|
-
method: "
|
|
394
|
+
method: "GET",
|
|
420
395
|
headers: _headers,
|
|
421
|
-
|
|
422
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
423
|
-
requestType: "json",
|
|
424
|
-
body: request,
|
|
396
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
425
397
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
426
398
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
427
399
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -449,7 +421,7 @@ export class Collections {
|
|
|
449
421
|
rawResponse: _response.rawResponse,
|
|
450
422
|
});
|
|
451
423
|
case "timeout":
|
|
452
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling
|
|
424
|
+
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /collections/{readable_id}/search.");
|
|
453
425
|
case "unknown":
|
|
454
426
|
throw new errors.AirweaveSDKError({
|
|
455
427
|
message: _response.error.errorMessage,
|
|
@@ -459,39 +431,46 @@ export class Collections {
|
|
|
459
431
|
});
|
|
460
432
|
}
|
|
461
433
|
/**
|
|
462
|
-
*
|
|
434
|
+
* Search your collection.
|
|
463
435
|
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
* monitor the status of individual data synchronization using the source connection
|
|
467
|
-
* endpoints.
|
|
436
|
+
* Accepts both new SearchRequest and legacy LegacySearchRequest formats
|
|
437
|
+
* for backwards compatibility.
|
|
468
438
|
*
|
|
469
|
-
* @param {string} readableId - The unique readable identifier of the collection
|
|
439
|
+
* @param {string} readableId - The unique readable identifier of the collection
|
|
440
|
+
* @param {AirweaveSDK.SearchCollectionsReadableIdSearchPostRequest} request
|
|
470
441
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
471
442
|
*
|
|
472
443
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
473
444
|
*
|
|
474
445
|
* @example
|
|
475
|
-
* await client.collections.
|
|
446
|
+
* await client.collections.search("readable_id", {
|
|
447
|
+
* query: "query"
|
|
448
|
+
* })
|
|
476
449
|
*/
|
|
477
|
-
|
|
478
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
450
|
+
search(readableId, request, requestOptions) {
|
|
451
|
+
return core.HttpResponsePromise.fromPromise(this.__search(readableId, request, requestOptions));
|
|
479
452
|
}
|
|
480
|
-
|
|
453
|
+
__search(readableId, request, requestOptions) {
|
|
481
454
|
return __awaiter(this, void 0, void 0, function* () {
|
|
482
455
|
var _a, _b, _c;
|
|
483
456
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
484
457
|
const _response = yield core.fetcher({
|
|
485
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/
|
|
458
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
|
|
486
459
|
method: "POST",
|
|
487
460
|
headers: _headers,
|
|
461
|
+
contentType: "application/json",
|
|
488
462
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
463
|
+
requestType: "json",
|
|
464
|
+
body: request,
|
|
489
465
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
490
466
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
491
467
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
492
468
|
});
|
|
493
469
|
if (_response.ok) {
|
|
494
|
-
return {
|
|
470
|
+
return {
|
|
471
|
+
data: _response.body,
|
|
472
|
+
rawResponse: _response.rawResponse,
|
|
473
|
+
};
|
|
495
474
|
}
|
|
496
475
|
if (_response.error.reason === "status-code") {
|
|
497
476
|
switch (_response.error.statusCode) {
|
|
@@ -513,7 +492,7 @@ export class Collections {
|
|
|
513
492
|
rawResponse: _response.rawResponse,
|
|
514
493
|
});
|
|
515
494
|
case "timeout":
|
|
516
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/
|
|
495
|
+
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/search.");
|
|
517
496
|
case "unknown":
|
|
518
497
|
throw new errors.AirweaveSDKError({
|
|
519
498
|
message: _response.error.errorMessage,
|
|
@@ -5,14 +5,14 @@ import * as AirweaveSDK from "../../../../index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* query: "
|
|
8
|
+
* query: "query",
|
|
9
9
|
* response_type: "raw",
|
|
10
10
|
* limit: 1,
|
|
11
11
|
* offset: 1,
|
|
12
12
|
* recency_bias: 1.1
|
|
13
13
|
* }
|
|
14
14
|
*/
|
|
15
|
-
export interface
|
|
15
|
+
export interface SearchGetLegacyCollectionsReadableIdSearchGetRequest {
|
|
16
16
|
/** The search query text to find relevant documents and data */
|
|
17
17
|
query: string;
|
|
18
18
|
/** Format of the response: 'raw' returns search results, 'completion' returns AI-generated answers */
|
|
@@ -21,6 +21,6 @@ export interface SearchCollectionsReadableIdSearchGetRequest {
|
|
|
21
21
|
limit?: number;
|
|
22
22
|
/** Number of results to skip for pagination */
|
|
23
23
|
offset?: number;
|
|
24
|
-
/** How much to weigh recency vs similarity (0..1)
|
|
24
|
+
/** How much to weigh recency vs similarity (0..1) */
|
|
25
25
|
recency_bias?: number;
|
|
26
26
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { type ListCollectionsGetRequest } from "./ListCollectionsGetRequest.mjs";
|
|
2
2
|
export { type CollectionCreate } from "./CollectionCreate.mjs";
|
|
3
|
-
export { type
|
|
4
|
-
export { type SearchRequest } from "./SearchRequest.mjs";
|
|
3
|
+
export { type SearchGetLegacyCollectionsReadableIdSearchGetRequest } from "./SearchGetLegacyCollectionsReadableIdSearchGetRequest.mjs";
|