MCPcopy Create free account
hub / github.com/Bistutu/FluentRead / ollama

Function ollama

userscripts.js:1179–1198  ·  view source on GitHub ↗
(origin)

Source from the content-addressed store, hash-verified

1177// region ollama
1178
1179function 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected