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

Method conversationLastUserData

src/base/ai/conversation.cpp:18–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18QString Conversation::conversationLastUserData(const QString &conversation)
19{
20 const QJsonArray &array = QJsonDocument::fromJson(conversation.toUtf8()).array();
21 if (!array.isEmpty() && array.last()["role"] == "user") {
22 return array.last()["content"].toString();
23 }
24
25 return conversation;
26}
27
28bool Conversation::setSystemData(const QString &data)
29{

Callers

nothing calls this directly

Calls 3

arrayMethod · 0.45
isEmptyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected