-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
58 lines (49 loc) · 1.14 KB
/
types.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
import type { ChatCompletionMessage, ChatCompletionMessageToolCall } from 'openai/resources/chat/completions'
export type ToolCall = ChatCompletionMessageToolCall
export type Tool = {
name: string
type: 'function'
function: {
name: string
description: string
parameters: {
type: 'object'
properties: Record<string, unknown>
required?: string[]
}
}
implementation: ToolFn<any, any>
}
export type ToolFn<Args, Result> = (input: {
toolArgs: Args
userMessage: string
}) => Promise<Result>
export type AIMessage = {
role: 'user' | 'assistant' | 'system' | 'tool'
content: string | null
tool_calls?: ChatCompletionMessageToolCall[]
tool_call_id?: string
}
export type Dict = Record<string, any>
export type Run = {
input: any
output: any
expected: any
scores: {
name: string
score: number
}[]
createdAt?: string
}
export type Set = {
runs: Run[]
score: number
createdAt: string
}
export type Experiment = {
name: string
sets: Set[]
}
export type Results = {
experiments: Experiment[]
}