-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
37 lines (34 loc) · 749 Bytes
/
types.ts
File metadata and controls
37 lines (34 loc) · 749 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
/**
* Represents the structure of a message in the chat completion request/response.
*/
export interface ChatMessage {
role: 'user' | 'assistant' | 'system';
content: string;
}
/**
* Represents a single choice in the AI's response.
*/
export interface Choice {
index: number;
message: ChatMessage;
finish_reason: string;
}
/**
* Represents the token usage statistics for the API call.
*/
export interface Usage {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
}
/**
* Represents the overall structure of the chat completion response from OpenRouter.
*/
export interface OpenRouterResponse {
id: string;
object: string;
created: number;
model: string;
choices: Choice[];
usage: Usage;
}