-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathfolders.ts
More file actions
139 lines (119 loc) · 3.42 KB
/
folders.ts
File metadata and controls
139 lines (119 loc) · 3.42 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as AgentsAPI from './agents';
import * as ArchivesAPI from '../archives/archives';
import * as ModelsAPI from '../models/models';
import { APIPromise } from '../../core/api-promise';
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Folders extends APIResource {
/**
* Get the folders associated with an agent.
*/
list(
agentID: string,
query: FolderListParams | null | undefined = {},
options?: RequestOptions,
): PagePromise<FolderListResponsesArrayPage, FolderListResponse> {
return this._client.getAPIList(path`/v1/agents/${agentID}/folders`, ArrayPage<FolderListResponse>, {
query,
...options,
});
}
/**
* Attach a folder to an agent.
*/
attach(
folderID: string,
params: FolderAttachParams,
options?: RequestOptions,
): APIPromise<AgentsAPI.AgentState | null> {
const { agent_id } = params;
return this._client.patch(path`/v1/agents/${agent_id}/folders/attach/${folderID}`, options);
}
/**
* Detach a folder from an agent.
*/
detach(
folderID: string,
params: FolderDetachParams,
options?: RequestOptions,
): APIPromise<AgentsAPI.AgentState | null> {
const { agent_id } = params;
return this._client.patch(path`/v1/agents/${agent_id}/folders/detach/${folderID}`, options);
}
}
export type FolderListResponsesArrayPage = ArrayPage<FolderListResponse>;
/**
* (Deprecated: Use Folder) Representation of a source, which is a collection of
* files and passages.
*/
export interface FolderListResponse {
/**
* The human-friendly ID of the Source
*/
id: string;
/**
* The embedding configuration used by the source.
*/
embedding_config: ModelsAPI.EmbeddingConfig;
/**
* The name of the source.
*/
name: string;
/**
* The timestamp when the source was created.
*/
created_at?: string | null;
/**
* The id of the user that made this Tool.
*/
created_by_id?: string | null;
/**
* The description of the source.
*/
description?: string | null;
/**
* Instructions for how to use the source.
*/
instructions?: string | null;
/**
* The id of the user that made this Tool.
*/
last_updated_by_id?: string | null;
/**
* Metadata associated with the source.
*/
metadata?: { [key: string]: unknown } | null;
/**
* The timestamp when the source was last updated.
*/
updated_at?: string | null;
/**
* The vector database provider used for this source's passages
*/
vector_db_provider?: ArchivesAPI.VectorDBProvider;
}
export interface FolderListParams extends ArrayPageParams {}
export interface FolderAttachParams {
/**
* The ID of the agent in the format 'agent-<uuid4>'
*/
agent_id: string;
}
export interface FolderDetachParams {
/**
* The ID of the agent in the format 'agent-<uuid4>'
*/
agent_id: string;
}
export declare namespace Folders {
export {
type FolderListResponse as FolderListResponse,
type FolderListResponsesArrayPage as FolderListResponsesArrayPage,
type FolderListParams as FolderListParams,
type FolderAttachParams as FolderAttachParams,
type FolderDetachParams as FolderDetachParams,
};
}