add Ollama

This commit is contained in:
2025-04-10 23:14:42 -05:00
parent 6cabca4deb
commit ead1e0c90e
5 changed files with 67 additions and 2 deletions

View File

View File

@@ -1,7 +1,5 @@
#include "Archimedes.h"
#include "utils/Window/Window.h"
class MainGUI : public Archimedes::Module {
public:

View File

@@ -0,0 +1,49 @@
#include "Ollama.h"
#include "modules/ImguiModule/src/ImguiModule.h"
#include <curl/curl.h>
#include <nlohmann/json.hpp>
Ollama::Ollama(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
name = "Ollama";
ImguiModule* im = new ImguiModule(a, nullptr);
deps[im->getName()] = im;
}
Ollama::~Ollama() {
}
void Ollama::onLoad() {
ImguiModule* im = (ImguiModule*) moduleInstances["ImguiModule"];
if(!im) {
std::cout << "No ImguiModule for Ollama!\n";
std::abort();
}
ImGui::SetCurrentContext(im->getContext());
}
void Ollama::run() {
static std::string s, url, response = "";
ImGui::Begin("Ollama Module");
ImGui::InputText("url: ", &url);
ImGui::InputTextMultiline("prompt: ", &s);
if(ImGui::Button("send")) {
}
ImGui::Text("%s", response.c_str());
ImGui::End();
}

View File

@@ -0,0 +1,18 @@
#include "Archimedes.h"
class Ollama : public Archimedes::Module {
public:
Ollama(Archimedes::App*, void*);
~Ollama();
void onLoad();
void run();
};
#ifdef OLLAMA_DYNAMIC
#define MODULE_TYPE Ollama
#include "endModule.h"
#endif