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