Guitar
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
AiApiBridge Class Reference

#include <AiApiBridge.h>

Collaboration diagram for AiApiBridge:
Collaboration graph
[legend]

Classes

struct  Private
 
struct  Query2Request
 

Public Member Functions

 AiApiBridge ()
 
 ~AiApiBridge ()
 
AiResult Error (std::string const &status, std::string const &message) const
 
GenerativeAI::Model model () const
 現在設定されているAIモデルを返す。 More...
 
void set_ai_model (GenerativeAI::Model model)
 使用するAIモデルを設定する。 More...
 
void set_system_role (std::string const &role)
 
AiResult request (GenerativeAI::EndPoint::Type eptype, std::string const &prompt, const Query2Request &req)
 指定されたエンドポイントタイプに対してプロンプトを送信し、AIの応答を取得する。 More...
 
AiResult request (const std::string &prompt)
 
std::optional< AiResult::ModelsqueryModels ()
 

Private Member Functions

AbstractInetClienthttp ()
 
std::string generate_prompt_json (const GenerativeAI::Model &model, const std::string &prompt, std::string const &system_role={})
 プロンプトをプロバイダー固有のAPIリクエストJSON形式に変換する。 More...
 
AiResult open ()
 
AiResult x_request (Query2Request const &req)
 
void close ()
 

Private Attributes

Privatem
 

Friends

class AiSession
 

Constructor & Destructor Documentation

◆ AiApiBridge()

AiApiBridge::AiApiBridge ( )

◆ ~AiApiBridge()

AiApiBridge::~AiApiBridge ( )

Member Function Documentation

◆ close()

void AiApiBridge::close ( )
private

◆ Error()

AiResult AiApiBridge::Error ( std::string const &  status,
std::string const &  message 
) const
inline
Here is the call graph for this function:

◆ generate_prompt_json()

std::string AiApiBridge::generate_prompt_json ( const GenerativeAI::Model model,
const std::string &  prompt,
std::string const &  system_role = {} 
)
private

プロンプトをプロバイダー固有のAPIリクエストJSON形式に変換する。

Parameters
model使用するAIモデル情報
prompt送信するプロンプト文字列
Returns
APIリクエスト用JSON文字列
Here is the call graph for this function:

◆ http()

AbstractInetClient * AiApiBridge::http ( )
private

◆ model()

GenerativeAI::Model AiApiBridge::model ( ) const

現在設定されているAIモデルを返す。

Returns
AIモデル情報

◆ open()

AiResult AiApiBridge::open ( )
private
Here is the call graph for this function:

◆ queryModels()

std::optional< AiResult::Models > AiApiBridge::queryModels ( )
Here is the call graph for this function:

◆ request() [1/2]

AiResult AiApiBridge::request ( const std::string &  prompt)
Here is the call graph for this function:

◆ request() [2/2]

AiResult AiApiBridge::request ( GenerativeAI::EndPoint::Type  eptype,
std::string const &  prompt,
const Query2Request req 
)

指定されたエンドポイントタイプに対してプロンプトを送信し、AIの応答を取得する。

Parameters
eptypeエンドポイントの種類(例: Chat, Modelsなど)
prompt送信するプロンプト文字列
req追加のリクエスト情報(将来的な拡張用)
Returns
AIからの応答を含むAiResultオブジェクト
Here is the call graph for this function:

◆ set_ai_model()

void AiApiBridge::set_ai_model ( GenerativeAI::Model  model)

使用するAIモデルを設定する。

Parameters
modelAIモデル情報
Here is the call graph for this function:

◆ set_system_role()

void AiApiBridge::set_system_role ( std::string const &  role)

◆ x_request()

AiResult AiApiBridge::x_request ( Query2Request const &  req)
private
Here is the call graph for this function:

Friends And Related Function Documentation

◆ AiSession

friend class AiSession
friend

Member Data Documentation

◆ m

Private* AiApiBridge::m
private

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