-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
The whole library (maybe the json library) leaks. Might be related to the use of the libcurl library. Specifically, the leaks are occurring in the curl_slist_append function.
Tested as follows on linux:
try {
openai::start();
auto chat = openai::chat().create({
{"model", "gpt-4o-mini"},
{"messages",
{
{
{"role", "system"},
{"content", SYSTEM_PROMPT},
},
{
{"role", "user"},
{"content", query},
{"max_tokens", MAX_TOKENS},
},
}},
});
response = chat["choices"][0]["message"]["content"];
} catch (const exception &e) {
cerr << "Error: " << e.what() << '\n';
response = "I'm sorry, I'm having trouble processing your request.";
}
cout << response << endl;But I've tried it with the example instead and it leaks as well.
Noticed through compiling with -g --fsanitize=true
Metadata
Metadata
Assignees
Labels
No labels