-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
58 lines (50 loc) · 1.03 KB
/
types.ts
File metadata and controls
58 lines (50 loc) · 1.03 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
// Core types for the prompt library
export interface ChatMessage {
role: "system" | "user" | "assistant" | "tool";
content: string | ContentBlock[];
name?: string;
tool_call_id?: string;
}
export enum ContentBlockType {
text = "text",
image_url = "image_url",
}
export interface CacheControl {
type: string;
}
export interface ImageUrl {
url: string;
}
export interface ContentBlock {
type: ContentBlockType;
cache_control?: CacheControl;
text?: string;
image_url?: ImageUrl;
}
export interface Tool {
type: string;
function: {
name: string;
description: string;
parameters: {
type: string;
properties: Record<
string,
{
type: string;
description: string;
}
>;
required: string[];
};
};
import_path: string;
}
export interface RenderCache {
get(context: Record<string, any>): string | null;
set(context: Record<string, any>, prompt: string): void;
clear(): void;
}
export interface PromptMetadata {
[key: string]: any;
}