-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathrag-tool.ts
48 lines (38 loc) · 1.3 KB
/
rag-tool.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import * as Core from '../../core';
import * as Shared from '../shared';
export class RagTool extends APIResource {
/**
* Index documents so they can be used by the RAG system
*/
insert(body: RagToolInsertParams, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.post('/v1/tool-runtime/rag-tool/insert', {
body,
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
/**
* Query the RAG system for context; typically invoked by the agent
*/
query(body: RagToolQueryParams, options?: Core.RequestOptions): Core.APIPromise<Shared.QueryResult> {
return this._client.post('/v1/tool-runtime/rag-tool/query', { body, ...options });
}
}
export interface RagToolInsertParams {
chunk_size_in_tokens: number;
documents: Array<Shared.Document>;
vector_db_id: string;
}
export interface RagToolQueryParams {
/**
* A image content item
*/
content: Shared.InterleavedContent;
vector_db_ids: Array<string>;
query_config?: Shared.QueryConfig;
}
export declare namespace RagTool {
export { type RagToolInsertParams as RagToolInsertParams, type RagToolQueryParams as RagToolQueryParams };
}