daggerai
Version:
A simple and powerful Typescript based agent framework to help businesses thrive in the AI Agent revolution.
27 lines • 839 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatOllama = void 0;
const prompts_1 = require("../core/prompts");
class ChatOllama {
params;
constructor(params) {
this.params = params;
}
async invoke(prompt) {
const response = await fetch('http://127.0.0.1:11434/api/generate', {
method: 'POST',
body: JSON.stringify({
model: this.params.model,
temperature: 0,
stop: [prompts_1.SQUAD_PROMPTS.observation],
prompt: prompt,
stream: false,
}),
});
const completion = await response.text();
const json = JSON.parse(completion);
return json.response;
}
}
exports.ChatOllama = ChatOllama;
//# sourceMappingURL=ollama.js.map