MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / addUserData

Method addUserData

src/base/ai/conversation.cpp:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50bool Conversation::addUserData(const QString &data)
51{
52 if (!data.isEmpty()) {
53 const QJsonDocument &document = QJsonDocument::fromJson(data.toUtf8());
54 if (document.isArray()) {
55 conversation = document.array();
56 } else {
57 conversation.push_back(QJsonObject({ { "role", "user" }, {"content", data} }));
58 }
59 return true;
60 }
61 return false;
62}
63
64bool Conversation::popUserData()
65{

Callers 2

checkValidMethod · 0.80
requestAsyncMethod · 0.80

Calls 2

isEmptyMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected