Implement checking for connection validity and API version in TracyLlm.

This commit is contained in:
Bartosz Taudul
2025-05-11 16:58:47 +02:00
parent 584ad9ffde
commit 85a82fbb70
2 changed files with 19 additions and 1 deletions

View File

@@ -1,13 +1,26 @@
#include <ollama.hpp>
#include "TracyConfig.hpp"
#include "TracyLlm.hpp"
extern tracy::Config s_config;
namespace tracy
{
TracyLlm::TracyLlm()
: m_ollama( std::make_unique<Ollama>( s_config.llmAddress ) )
, m_valid( m_ollama->is_running() )
{
m_ollama = std::make_unique<Ollama>();
}
TracyLlm::~TracyLlm()
{
}
std::string TracyLlm::GetVersion() const
{
return m_ollama->get_version();
}
}

View File

@@ -12,9 +12,14 @@ class TracyLlm
{
public:
TracyLlm();
~TracyLlm();
[[nodiscard]] bool IsValid() const { return m_valid; }
[[nodiscard]] std::string GetVersion() const;
private:
std::unique_ptr<Ollama> m_ollama;
bool m_valid;
};
}