-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathagent.d.ts
More file actions
42 lines (38 loc) · 950 Bytes
/
Copy pathagent.d.ts
File metadata and controls
42 lines (38 loc) · 950 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
export type AgentChatMessage = {
role: string;
content: string;
name?: string;
tool_call_id?: string;
};
export type AgentChatOptions = {
apiKey?: string;
apiBaseUrl?: string;
model?: string;
temperature?: number;
maxTokens?: number;
timeout?: number;
stream?: boolean;
topP?: number;
frequencyPenalty?: number;
presencePenalty?: number;
stop?: string | string[];
expectedOutput?: string;
onChunk?: (chunk: string) => void;
onEarlyTerminate?: (event: { reason?: string; partial?: string }) => void;
};
export type AgentConfig = {
apiKey?: string;
apiBaseUrl?: string;
defaultModel?: string;
temperature?: number;
maxTokens?: number;
timeout?: number;
stream?: boolean;
envPath?: string;
maxRetries?: number;
};
export class Agent {
constructor(config?: AgentConfig);
chat(messages: AgentChatMessage[], options?: AgentChatOptions | string): Promise<string | null>;
}
export default Agent;