-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.d.ts
More file actions
43 lines (39 loc) · 784 Bytes
/
types.d.ts
File metadata and controls
43 lines (39 loc) · 784 Bytes
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
export interface ToolCall {
id: string
type: 'function'
function: {
name: string
arguments?: string
}
}
export type Role = 'system' | 'user' | 'assistant' | 'tool'
export interface Message {
role: Role
content: string
tool_calls?: ToolCall[]
tool_call_id?: string
error?: string
}
export interface ToolHandler {
emoji: string
tool: Tool
handleToolCall(args: Record<string, unknown>): Promise<string>
}
interface ToolProperty {
type: string
description: string
}
export interface Tool {
type: 'function'
function: {
name: string
description: string
parameters?: {
type: 'object'
properties: Record<string, ToolProperty>
required?: string[]
additionalProperties?: boolean
},
strict?: boolean
}
}