2
0
mirror of https://github.com/wolfpld/tracy synced 2026-01-19 04:52:09 +00:00

Return proper error response from TracyLlmApi::SendMessage().

This commit is contained in:
Bartosz Taudul
2026-01-14 02:49:38 +01:00
parent 227c7133c3
commit 828d32521d

View File

@@ -260,7 +260,6 @@ nlohmann::json TracyLlmApi::SendMessage( const nlohmann::json& chat, int modelId
auto data = req.dump( -1, ' ', false, nlohmann::json::error_handler_t::replace );
std::string buf;
auto res = PostRequest( m_url + "/v1/chat/completions", data, buf, true );
if( res != 200 ) return {};
try
{
@@ -268,7 +267,7 @@ nlohmann::json TracyLlmApi::SendMessage( const nlohmann::json& chat, int modelId
}
catch( const std::exception& )
{
return {};
return { { "response", buf } };
}
}