-
Notifications
You must be signed in to change notification settings - Fork 326
Description
import ollama from 'ollama';
console.log("Using Ollama version:", ollama);
// const ollama = await import("ollama");
export const c_chat = async (req, res) => {
try {
if(!req.body){
return res.status(305).send({
status : "Data Masih Kosong"
});
}
const response = await ollama.chat({
model : req.body.model,
messages : req.body.pesan
});
res.status(200).send({
response : response.message
});
}
catch (e) {
return res.status(305).send({
status: e.message
});
}
}
### my code, but error in the bellow
Debugger attached.
Waiting for the debugger to disconnect...
file:///E:/express/node/node_modules/ollama/dist/browser.mjs:57
if (response.headers.get("content-type")?.includes("application/json")) {
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
[nodemon] app crashed - waiting for file changes before starting...
my using node 18.17.1