Add explicit User-Agent to Ollama API calls
Node's default fetch sends a bare User-Agent that Google's CDN fronting ollama.com rejects with 403. curl worked because it sends curl/. Fixes organize (and search LLM ranking). Signed-off-by: William Mantly <wmantly@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ async function chatJSON(system, user){
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': `Bearer ${conf.ollama.apiKey}`,
|
'Authorization': `Bearer ${conf.ollama.apiKey}`,
|
||||||
|
'User-Agent': 'tpbproxy/1.0 (organize; +https://github.com/wmantly/tpbproxy)',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: conf.ollama.model,
|
model: conf.ollama.model,
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ async function rankReleases(candidates, meta){
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': `Bearer ${conf.ollama.apiKey}`,
|
'Authorization': `Bearer ${conf.ollama.apiKey}`,
|
||||||
|
'User-Agent': 'tpbproxy/1.0 (search; +https://github.com/wmantly/tpbproxy)',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user