mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-17 22:35:36 +00:00
Implement checking for connection validity and API version in TracyLlm.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user