-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtools.ts
executable file
·124 lines (105 loc) · 3.56 KB
/
tools.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
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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import * as ToolsAPI from './tools';
export class Tools extends APIResource {
/**
* Data needed to create a new tool
*/
create(body: ToolCreateParams, options?: Core.RequestOptions): Core.APIPromise<Tool> {
return this._client.post('/sdk/v1/tools', { body, ...options });
}
/**
* Update the configuration of an existing tool by providing its ID and new data.
*/
update(id: string, body: ToolUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Tool> {
return this._client.put(`/sdk/v1/tools/${id}`, { body, ...options });
}
/**
* Retrieve all tools
*/
list(options?: Core.RequestOptions): Core.APIPromise<ToolListResponse> {
return this._client.get('/sdk/v1/tools', options);
}
/**
* Delete a tool by ID.
*/
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<ToolDeleteResponse> {
return this._client.delete(`/sdk/v1/tools/${id}`, options);
}
/**
* Fetch the details of a specific tool using its ID.
*/
get(id: string, options?: Core.RequestOptions): Core.APIPromise<Tool> {
return this._client.get(`/sdk/v1/tools/${id}`, options);
}
}
export interface Tool {
/**
* The initial messages to be included with your call to the LLM API.
*/
id: string;
/**
* A description of what the tool does, used by the model to choose when and how to
* call the tool.
*/
description: string;
/**
* The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores
* and dashes, with a maximum length of 64.
*/
name: string;
/**
* The parameters the functions accepts, described as a JSON Schema object. This
* schema is designed to match the TypeScript Record<string, unknown>, allowing for
* any properties with values of any type.
*/
parameters: Record<string, unknown>;
}
export type ToolListResponse = Array<Tool>;
export interface ToolDeleteResponse {
success?: boolean;
}
export interface ToolCreateParams {
/**
* A description of what the tool does, used by the model to choose when and how to
* call the tool.
*/
description: string;
/**
* The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores
* and dashes, with a maximum length of 64.
*/
name: string;
/**
* The parameters the functions accepts, described as a JSON Schema object. This
* schema is designed to match the TypeScript Record<string, unknown>, allowing for
* any properties with values of any type.
*/
parameters: Record<string, unknown>;
}
export interface ToolUpdateParams {
/**
* A description of what the tool does, used by the model to choose when and how to
* call the tool.
*/
description: string;
/**
* The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores
* and dashes, with a maximum length of 64.
*/
name: string;
/**
* The parameters the functions accepts, described as a JSON Schema object. This
* schema is designed to match the TypeScript Record<string, unknown>, allowing for
* any properties with values of any type.
*/
parameters: Record<string, unknown>;
}
export namespace Tools {
export import Tool = ToolsAPI.Tool;
export import ToolListResponse = ToolsAPI.ToolListResponse;
export import ToolDeleteResponse = ToolsAPI.ToolDeleteResponse;
export import ToolCreateParams = ToolsAPI.ToolCreateParams;
export import ToolUpdateParams = ToolsAPI.ToolUpdateParams;
}