Guitar
Classes | Enumerations | Functions
GenerativeAI Namespace Reference

Classes

struct  _MakeRequest
 
class  AbstractVisitor
 
struct  ProviderInfo
 
struct  Credential
 
class  ModelURI
 
struct  Model
 
struct  EndPoint
 
struct  Request
 

Enumerations

enum class  ProviderID {
  Unknown , OpenAI , OpenAI_responses , OpenAI_chat_completions ,
  Anthropic , Google , XAI , PFN ,
  Moonshot , Sakura , DeepSeek , OpenRouter ,
  Ollama , LMStudio , LLAMACPP
}
 

Functions

const std::vector< ProviderInfo > & complete_provider_table ()
 AIプロバイダの完全なマスターテーブルを返す。 More...
 
ProviderID api_compatibility (ProviderID pid)
 
std::vector< Model > const & ai_model_presets ()
 ユーザー向けに提示するAIモデルのプリセットリストを返す。 More...
 
std::vector< ProviderID > const & ai_provider_id_list_for_present_to_users ()
 ユーザー向けに提示するAIプロバイダIDのリストを返す。 More...
 
ProviderInfo const * provider_info (ProviderID id)
 AIプロバイダIDに対応するプロバイダ情報を返す。 More...
 
Request make_request (ProviderID provider, const Model &model, Credential const &cred)
 指定されたAIプロバイダ・モデル・認証情報からAPIリクエスト情報を生成する。 More...
 
std::string makeEnvName (const ModelURI &model_uri)
 モデルURLから環境変数名を生成する。 More...
 
static bool operator== (ModelURI const &a, ModelURI const &b)
 

Enumeration Type Documentation

◆ ProviderID

Enumerator
Unknown 
OpenAI 
OpenAI_responses 
OpenAI_chat_completions 
Anthropic 
Google 
XAI 
PFN 
Moonshot 
Sakura 
DeepSeek 
OpenRouter 
Ollama 
LMStudio 
LLAMACPP 

Function Documentation

◆ ai_model_presets()

std::vector< Model > const & GenerativeAI::ai_model_presets ( )

ユーザー向けに提示するAIモデルのプリセットリストを返す。

Returns
プリセットモデルのベクタへの参照。

◆ ai_provider_id_list_for_present_to_users()

std::vector< GenerativeAI::ProviderID > const & GenerativeAI::ai_provider_id_list_for_present_to_users ( )

ユーザー向けに提示するAIプロバイダIDのリストを返す。

Note
Unknown は含むが、placeholder エントリは含まない。
Returns
AIプロバイダIDのベクタへの参照。

◆ api_compatibility()

ProviderID GenerativeAI::api_compatibility ( ProviderID  pid)

◆ complete_provider_table()

std::vector< ProviderInfo > const & GenerativeAI::complete_provider_table ( )

AIプロバイダの完全なマスターテーブルを返す。

Returns
全プロバイダの情報を保持するベクタへの参照。
Note
placeholder エントリは API_KEY を管理する都合上設けられた代理アイテムであり、 実際のAPIエンドポイントには対応しない。
Here is the call graph for this function:

◆ make_request()

Request GenerativeAI::make_request ( ProviderID  provider,
const Model model,
Credential const &  cred 
)

指定されたAIプロバイダ・モデル・認証情報からAPIリクエスト情報を生成する。

Parameters
providerAIプロバイダID。
model使用するAIモデル。
credAPIキー等の認証情報。
Returns
生成されたRequestオブジェクト。
Here is the call graph for this function:

◆ makeEnvName()

std::string GenerativeAI::makeEnvName ( const ModelURI model_uri)

モデルURLから環境変数名を生成する。

生成ルールは以下の通り:

  • 英数字は大文字に変換する。
  • その他の文字はアンダースコアに置換する。
  • 連続する非英数字は単一のアンダースコアにまとめる。

例:

  • "sakura:gpt-oss-120b" -> "SAKURA_GPT_OSS_120B"
Parameters
model_uriモデルURI
Returns
環境変数名

◆ operator==()

static bool GenerativeAI::operator== ( ModelURI const &  a,
ModelURI const &  b 
)
inlinestatic

◆ provider_info()

const ProviderInfo * GenerativeAI::provider_info ( ProviderID  id)

AIプロバイダIDに対応するプロバイダ情報を返す。

Parameters
id検索対象のAIプロバイダID。
Returns
対応する ProviderInfo へのポインタ。見つからない場合は Unknown エントリを返す。
Here is the call graph for this function: