-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtoolgroups.ts
91 lines (71 loc) · 2.27 KB
/
toolgroups.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
export class Toolgroups extends APIResource {
/**
* List tool groups with optional provider
*/
list(options?: Core.RequestOptions): Core.APIPromise<ToolgroupListResponse> {
return (
this._client.get('/v1/toolgroups', options) as Core.APIPromise<{ data: ToolgroupListResponse }>
)._thenUnwrap((obj) => obj.data);
}
get(toolgroupId: string, options?: Core.RequestOptions): Core.APIPromise<ToolGroup> {
return this._client.get(`/v1/toolgroups/${toolgroupId}`, options);
}
/**
* Register a tool group
*/
register(body: ToolgroupRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.post('/v1/toolgroups', {
body,
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
/**
* Unregister a tool group
*/
unregister(toolgroupId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.delete(`/v1/toolgroups/${toolgroupId}`, {
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
}
export interface ListToolGroupsResponse {
data: ToolgroupListResponse;
}
export interface ToolGroup {
identifier: string;
provider_id: string;
provider_resource_id: string;
type: 'tool_group';
args?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
mcp_endpoint?: ToolGroup.McpEndpoint;
}
export namespace ToolGroup {
export interface McpEndpoint {
uri: string;
}
}
export type ToolgroupListResponse = Array<ToolGroup>;
export interface ToolgroupRegisterParams {
provider_id: string;
toolgroup_id: string;
args?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
mcp_endpoint?: ToolgroupRegisterParams.McpEndpoint;
}
export namespace ToolgroupRegisterParams {
export interface McpEndpoint {
uri: string;
}
}
export declare namespace Toolgroups {
export {
type ListToolGroupsResponse as ListToolGroupsResponse,
type ToolGroup as ToolGroup,
type ToolgroupListResponse as ToolgroupListResponse,
type ToolgroupRegisterParams as ToolgroupRegisterParams,
};
}