| 364 | } |
| 365 | |
| 366 | PluginLLMCore::ContextData LLMClientInterface::prepareContext( |
| 367 | const QJsonObject &request, const Context::DocumentInfo &documentInfo) |
| 368 | { |
| 369 | QJsonObject params = request["params"].toObject(); |
| 370 | QJsonObject doc = params["doc"].toObject(); |
| 371 | QJsonObject position = doc["position"].toObject(); |
| 372 | int cursorPosition = position["character"].toInt(); |
| 373 | int lineNumber = position["line"].toInt(); |
| 374 | |
| 375 | Context::DocumentContextReader |
| 376 | reader(documentInfo.document, documentInfo.mimeType, documentInfo.filePath); |
| 377 | return reader.prepareContext(lineNumber, cursorPosition, m_completeSettings); |
| 378 | } |
| 379 | |
| 380 | QString LLMClientInterface::resolveEndpoint( |
| 381 | PluginLLMCore::PromptTemplate *promptTemplate, bool isLanguageSpecify) const |