๐Ÿ“ฆ mlynch / ionic-capacitor-chatgpt-starter

๐Ÿ“„ models.ts ยท 26 lines
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
26export interface ChatGPTCompletion {
  choices: ChatGPTChoice[];
  created: number;
  id: string;
  model: string;
  object: string;
  usage: ChatGPTCompletionUsage;
}

export interface ChatGPTChoice {
  finish_reason: string;
  index: 0;
  message: ChatGPTMessage;
}

export interface ChatGPTCompletionUsage {
  completion_tokens: number;
  prompt_tokens: number;
  total_tokens: number;
}

export interface ChatGPTMessage {
  content: string;
  role: 'assistant' | 'user' | 'system' | string;
}