MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / roleFromString

Function roleFromString

sources/Session/MessageSerializer.cpp:40–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40bool roleFromString(const QString &str, Message::Role *out)
41{
42 if (str == QLatin1String("system")) {
43 *out = Message::Role::System;
44 return true;
45 }
46 if (str == QLatin1String("user")) {
47 *out = Message::Role::User;
48 return true;
49 }
50 if (str == QLatin1String("assistant")) {
51 *out = Message::Role::Assistant;
52 return true;
53 }
54 return false;
55}
56
57QJsonObject blockToJson(const LLMQore::ContentBlock &block)
58{

Callers 1

fromJsonMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected