-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvector-io.ts
74 lines (58 loc) · 1.83 KB
/
vector-io.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// 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 VectorIo extends APIResource {
insert(body: VectorIoInsertParams, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.post('/v1/vector-io/insert', {
body,
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
query(body: VectorIoQueryParams, options?: Core.RequestOptions): Core.APIPromise<QueryChunksResponse> {
return this._client.post('/v1/vector-io/query', { body, ...options });
}
}
export interface QueryChunksResponse {
chunks: Array<QueryChunksResponse.Chunk>;
scores: Array<number>;
}
export namespace QueryChunksResponse {
export interface Chunk {
/**
* A image content item
*/
content: Shared.InterleavedContent;
metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
}
}
export interface VectorIoInsertParams {
chunks: Array<VectorIoInsertParams.Chunk>;
vector_db_id: string;
ttl_seconds?: number;
}
export namespace VectorIoInsertParams {
export interface Chunk {
/**
* A image content item
*/
content: Shared.InterleavedContent;
metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
}
}
export interface VectorIoQueryParams {
/**
* A image content item
*/
query: Shared.InterleavedContent;
vector_db_id: string;
params?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
}
export declare namespace VectorIo {
export {
type QueryChunksResponse as QueryChunksResponse,
type VectorIoInsertParams as VectorIoInsertParams,
type VectorIoQueryParams as VectorIoQueryParams,
};
}