yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::OllamaAIService Class Reference

#include <ollama_ai_service.h>

Inheritance diagram for yaze::cli::OllamaAIService:
Collaboration diagram for yaze::cli::OllamaAIService:

Public Member Functions

 OllamaAIService (const OllamaConfig &config)
 
void SetRomContext (Rom *rom) override
 
absl::StatusOr< AgentResponseGenerateResponse (const std::string &prompt) override
 
absl::StatusOr< AgentResponseGenerateResponse (const std::vector< agent::ChatMessage > &history) override
 
absl::Status CheckAvailability ()
 
absl::StatusOr< std::vector< std::string > > ListAvailableModels ()
 
- Public Member Functions inherited from yaze::cli::AIService
virtual ~AIService ()=default
 

Private Member Functions

std::string BuildSystemPrompt ()
 
absl::StatusOr< std::string > ParseOllamaResponse (const std::string &json_response)
 

Private Attributes

OllamaConfig config_
 
PromptBuilder prompt_builder_
 

Detailed Description

Definition at line 25 of file ollama_ai_service.h.

Constructor & Destructor Documentation

◆ OllamaAIService()

Member Function Documentation

◆ SetRomContext()

void yaze::cli::OllamaAIService::SetRomContext ( Rom rom)
overridevirtual

Reimplemented from yaze::cli::AIService.

Definition at line 41 of file ollama_ai_service.cc.

References prompt_builder_, and yaze::cli::PromptBuilder::SetRom().

Here is the call graph for this function:

◆ GenerateResponse() [1/2]

absl::StatusOr< AgentResponse > yaze::cli::OllamaAIService::GenerateResponse ( const std::string &  prompt)
overridevirtual

Implements yaze::cli::AIService.

Definition at line 159 of file ollama_ai_service.cc.

References GenerateResponse(), and yaze::cli::agent::ChatMessage::kUser.

Referenced by GenerateResponse().

Here is the call graph for this function:

◆ GenerateResponse() [2/2]

◆ CheckAvailability()

absl::Status yaze::cli::OllamaAIService::CheckAvailability ( )

◆ ListAvailableModels()

absl::StatusOr< std::vector< std::string > > yaze::cli::OllamaAIService::ListAvailableModels ( )

Definition at line 104 of file ollama_ai_service.cc.

References yaze::cli::OllamaConfig::base_url, and config_.

◆ BuildSystemPrompt()

std::string yaze::cli::OllamaAIService::BuildSystemPrompt ( )
private

Definition at line 35 of file ollama_ai_service.cc.

References yaze::cli::PromptBuilder::BuildSystemInstruction(), and prompt_builder_.

Referenced by OllamaAIService().

Here is the call graph for this function:

◆ ParseOllamaResponse()

absl::StatusOr< std::string > yaze::cli::OllamaAIService::ParseOllamaResponse ( const std::string &  json_response)
private

Definition at line 138 of file ollama_ai_service.cc.

Member Data Documentation

◆ config_

OllamaConfig yaze::cli::OllamaAIService::config_
private

◆ prompt_builder_

PromptBuilder yaze::cli::OllamaAIService::prompt_builder_
private

The documentation for this class was generated from the following files: