mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-24 09:40:53 +00:00
Allow optional parameters with a default value.
This commit is contained in:
@@ -121,8 +121,15 @@ static uint32_t GetParamU32( const nlohmann::json& json, const char* name )
|
||||
return json[name].get<uint32_t>();
|
||||
}
|
||||
|
||||
static uint32_t GetParamOptU32( const nlohmann::json& json, const char* name, uint32_t def )
|
||||
{
|
||||
if( !json.contains( name ) ) return def;
|
||||
return json[name].get<uint32_t>();
|
||||
}
|
||||
|
||||
#define Param(name) GetParam( json, name )
|
||||
#define ParamU32(name) GetParamU32( json, name )
|
||||
#define ParamOptU32(name, def) GetParamOptU32( json, name, def )
|
||||
|
||||
TracyLlmTools::ToolReply TracyLlmTools::HandleToolCalls( const std::string& tool, const nlohmann::json& json, TracyLlmApi& api, int contextSize, bool hasEmbeddingsModel )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user