(origin)
| 1177 | // region ollama |
| 1178 | |
| 1179 | function ollama(origin) { |
| 1180 | return new Promise((resolve, reject) => { |
| 1181 | let option = optionsManager.getCustomOption(transModel.ollama) |
| 1182 | GM_xmlhttpRequest({ |
| 1183 | method: POST, |
| 1184 | url: customGPT.getGPTUrl(), |
| 1185 | headers: {'Content-Type': 'application/json'}, |
| 1186 | data: LLMFormat.getOllamaData(origin, option), |
| 1187 | onload: resp => { |
| 1188 | try { |
| 1189 | let result = JSON.parse(resp.responseText); |
| 1190 | resolve(result.choices[0].message.content); |
| 1191 | } catch (e) { |
| 1192 | reject(resp.responseText); |
| 1193 | } |
| 1194 | }, |
| 1195 | onerror: error => reject(error) |
| 1196 | }); |
| 1197 | }); |
| 1198 | } |
| 1199 | |
| 1200 | // endregion |
| 1201 |
nothing calls this directly
no outgoing calls
no test coverage detected