| 150 | } |
| 151 | |
| 152 | void Copilot::explain() |
| 153 | { |
| 154 | QString prompt = "code: ```%1```\n\n" |
| 155 | "You are an intelligent programming assistant. You will answer any questions users have about programming, code, and computers, providing well-formatted, executable, accurate, and secure code, and providing detailed explanations when necessary. Task: Please explain the meaning of the input code, including the implementation principle, purpose, and precautions, etc. "; |
| 156 | if (locale == Zh) |
| 157 | prompt.append("\nPlease answer by Chineses"); |
| 158 | ChatManager::instance()->requestAsync(prompt.arg(selectedText())); |
| 159 | switchToChatPage(); |
| 160 | } |
| 161 | |
| 162 | void Copilot::review() |
| 163 | { |
nothing calls this directly
no test coverage detected