LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
OllamaClient.cpp File Reference
#include "OllamaClient.hpp"
#include "Config.hpp"
#include "PluginLoggerC.h"
#include <fmt/format.h>
#include <sstream>
#include <iomanip>
#include <stdexcept>
#include <curl/curl.h>
Include dependency graph for OllamaClient.cpp:

Namespaces

namespace  ai
 
namespace  ai::anonymous_namespace{OllamaClient.cpp}
 

Macros

#define PLUGIN_LOG(level, ...)   do { std::string _pl_msg = fmt::format(__VA_ARGS__); PluginLogger_Log(level, _pl_msg.c_str()); } while(0)
 

Functions

size_t ai::anonymous_namespace{OllamaClient.cpp}::WriteCallback (void *contents, size_t size, size_t nmemb, std::string *userp)
 
std::string ai::anonymous_namespace{OllamaClient.cpp}::EscapeJson (const std::string &input)
 
 ai::if (contentEnd >=response.length())
 
 ai::while ((pos=result.find("\\n", pos)) !=std::string::npos)
 
 ai::while ((pos=result.find("\\\"", pos)) !=std::string::npos)
 
 ai::if (callback) callback(result)
 
 ai::PLUGIN_LOG (PLUGIN_LOG_DEBUG, "Received response from Ollama (length: {})", result.length())
 
 catch (const std::exception &e)
 

Variables

std::string ai::result = response.substr(contentStart, contentEnd - contentStart)
 
size_t ai::pos = 0
 

Macro Definition Documentation

◆ PLUGIN_LOG

#define PLUGIN_LOG (   level,
  ... 
)    do { std::string _pl_msg = fmt::format(__VA_ARGS__); PluginLogger_Log(level, _pl_msg.c_str()); } while(0)

Function Documentation

◆ catch()

catch ( const std::exception &  e)