MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / objectSchemaWithProperty

Function objectSchemaWithProperty

app/src/AI/Conversation.cpp:2036–2049  ·  view source on GitHub ↗

* @brief Returns the schema { type:object, properties:{ :propSchema}, required:[ ] }. */

Source from the content-addressed store, hash-verified

2034 * @brief Returns the schema { type:object, properties:{<key>:propSchema}, required:[<key>] }.
2035 */
2036static QJsonObject objectSchemaWithProperty(const QString& key,
2037 const QJsonObject& propSchema,
2038 bool required)
2039{
2040 QJsonObject schema;
2041 schema[QStringLiteral("type")] = QStringLiteral("object");
2042 QJsonObject props;
2043 props[key] = propSchema;
2044 schema[QStringLiteral("properties")] = props;
2045 if (required)
2046 schema[QStringLiteral("required")] = QJsonArray{key};
2047
2048 return schema;
2049}
2050
2051/**
2052 * @brief Returns a string-typed property schema with description (and optional enum).

Callers 2

appendCommandMetaToolsFunction · 0.85
appendReferenceMetaToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected