@tiledesk/tiledesk-server 2.10.75 → 2.10.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/routes/llm.js +13 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/routes/llm.js
CHANGED
@@ -37,7 +37,7 @@ router.post('/preview', async (req, res) => {
|
|
37
37
|
return res.status(404).send({ success: false, error: "Integration for " + body.llm + " not found."})
|
38
38
|
}
|
39
39
|
|
40
|
-
if (!integration?.value?.apikey) {
|
40
|
+
if (!integration?.value?.apikey && body.llm !== 'ollama') {
|
41
41
|
return res.status(422).send({ success: false, error: "The key provided for " + body.llm + " is not valid or undefined." })
|
42
42
|
}
|
43
43
|
|
@@ -56,6 +56,18 @@ router.post('/preview', async (req, res) => {
|
|
56
56
|
json.system_context = body.context;
|
57
57
|
}
|
58
58
|
|
59
|
+
if (body.llm === 'ollama') {
|
60
|
+
json.llm_key = "";
|
61
|
+
json.model = {
|
62
|
+
name: body.model,
|
63
|
+
url: integration.value.url,
|
64
|
+
token: integration.value.token
|
65
|
+
},
|
66
|
+
json.stream = false;
|
67
|
+
}
|
68
|
+
|
69
|
+
winston.debug("Preview LLM json: ", json);
|
70
|
+
|
59
71
|
aiService.askllm(json).then((response) => {
|
60
72
|
winston.verbose("Askllm response: ", response);
|
61
73
|
res.status(200).send(response.data)
|