mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-17 22:35:36 +00:00
Handle HTTP errors.
This commit is contained in:
@@ -219,7 +219,12 @@ bool TracyLlmApi::ChatCompletion( const nlohmann::json& req, const std::function
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
else
|
||||
{
|
||||
auto str = std::move( data.str );
|
||||
data.str.clear();
|
||||
throw std::runtime_error( "HTTP error " + std::to_string( http_code ) + ": " + str );
|
||||
}
|
||||
}
|
||||
|
||||
bool TracyLlmApi::Embeddings( const nlohmann::json& req, nlohmann::json& response, bool separateConnection )
|
||||
|
||||
Reference in New Issue
Block a user