yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
service_factory.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_SERVICE_AI_SERVICE_FACTORY_H_
2#define YAZE_CLI_SERVICE_AI_SERVICE_FACTORY_H_
3
4#include <memory>
5#include <string>
6#include <vector>
7
8#include "absl/status/statusor.h"
11
12namespace yaze {
13class Rom;
14
15namespace cli {
16
21
23 // "auto" (auto-detect configured provider), "gemini",
24 // "anthropic", "openai", "ollama", or "mock".
25 // Aliases: "claude" => anthropic, "chatgpt"/"lmstudio" => openai.
26 std::string provider = kProviderAuto;
27 // Provider-specific model name.
28 std::string model;
29 // For Gemini.
30 std::string gemini_api_key;
31 // For OpenAI (and LMStudio/compatible APIs).
32 std::string openai_api_key;
33 std::string openai_base_url = "https://api.openai.com";
34 // For Anthropic.
35 std::string anthropic_api_key;
36 // For Ollama.
37 std::string ollama_host = "http://localhost:11434";
38 // Hint for ROM-aware prompt selection when a loaded ROM object is not yet
39 // available.
40 std::string rom_path_hint;
41 // Optional loaded ROM for prompt-context and Oracle guide auto-detection.
42 Rom* rom_context = nullptr;
43 // Enable debug logging.
44 bool verbose = false;
45};
46
47// Build service configuration from flags + environment fallbacks.
49
50// Detect which prompt profile should be used for the current ROM context.
52
53// Discover provider configs suitable for model-listing APIs. Returned configs
54// always use canonical provider names and exclude unsupported aliases.
55std::vector<AIServiceConfig> DiscoverModelRegistryConfigs(
56 const AIServiceConfig& base_config);
57
58// Create AI service using command-line flags
59std::unique_ptr<AIService> CreateAIService();
60
61// Create AI service with explicit configuration
62std::unique_ptr<AIService> CreateAIService(const AIServiceConfig& config);
63absl::StatusOr<std::unique_ptr<AIService>> CreateAIServiceStrict(
64 const AIServiceConfig& config);
65
66} // namespace cli
67} // namespace yaze
68
69#endif // YAZE_CLI_SERVICE_AI_SERVICE_FACTORY_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
std::unique_ptr< AIService > CreateAIService()
AgentPromptProfile DetectPromptProfile(const AIServiceConfig &config)
absl::StatusOr< std::unique_ptr< AIService > > CreateAIServiceStrict(const AIServiceConfig &config)
constexpr char kProviderAuto[]
Definition provider_ids.h:6
AIServiceConfig BuildAIServiceConfigFromFlags()
std::vector< AIServiceConfig > DiscoverModelRegistryConfigs(const AIServiceConfig &base_config)