()
| 90 | } |
| 91 | |
| 92 | async getModels() { |
| 93 | await this.ensureValidToken(); |
| 94 | |
| 95 | const options = { |
| 96 | hostname: 'api.githubcopilot.com', |
| 97 | port: 443, |
| 98 | path: '/models', |
| 99 | method: 'GET', |
| 100 | headers: { |
| 101 | 'authorization': `Bearer ${this.copilotToken}`, |
| 102 | 'Copilot-Integration-Id': 'vscode-chat' |
| 103 | } |
| 104 | }; |
| 105 | |
| 106 | const response = await this.makeRequest(options); |
| 107 | return response; |
| 108 | } |
| 109 | |
| 110 | async chatCompletion(messages, options = {}) { |
| 111 | await this.ensureValidToken(); |
no test coverage detected