🔊 better error when old version of Ollama being used

This commit is contained in:
Nate Sesti 2024-02-06 10:41:37 -08:00
parent be751d73a8
commit cbd04fb16b

View file

@ -148,6 +148,9 @@ function setupLlm(llm: ILLM): ILLM {
if (text.includes("try pulling it first")) {
const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
} else if (text.includes("/api/chat")) {
text =
"The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
} else {
text =
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";