mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-02-10 18:05:06 +08:00
the ability to insert links into the hint text
This commit is contained in:
@ -165,7 +165,7 @@ AssistantHint.prototype._createPrompt = function(text) {
|
||||
|
||||
Guidelines for each field:
|
||||
- "origin": EXACT UNCHANGED original text fragment. Do not fix anything in this field.
|
||||
- "reason": Clear explanation of why this fragment matches the criteria.
|
||||
- "reason": Clear explanation of why this fragment matches the criteria; IF the user's request contains words like "source", "reference", "link", "cite", "website", "URL", "Wikipedia", "proof", "evidence", "verify" - then you MUST include actual working links in your explanations in html format.
|
||||
- "paragraph": Paragraph number where the fragment is found (0-based index)
|
||||
- "occurrence": Which occurrence of this sentence if it appears multiple times (1 for first, 2 for second, etc.)
|
||||
- "confidence": Value between 0 and 1 indicating certainty (1.0 = completely certain, 0.5 = uncertain)
|
||||
@ -198,9 +198,15 @@ AssistantHint.prototype._createPrompt = function(text) {
|
||||
AssistantHint.prototype.getInfoForPopup = function(paraId, rangeId)
|
||||
{
|
||||
let _s = this.getAnnotation(paraId, rangeId);
|
||||
let reason = _s["reason"];
|
||||
try {
|
||||
reason = reason.replace(/<a\s+(.*?)>/gi, '<a $1 target="_blank">');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
return {
|
||||
original : _s["original"],
|
||||
explanation : _s["reason"],
|
||||
explanation : reason,
|
||||
type : this.type
|
||||
};
|
||||
};
|
||||
|
||||
@ -173,7 +173,7 @@ AssistantReplaceHint.prototype._createPrompt = function(text) {
|
||||
- "suggestion": Your suggested replacement for the fragment.
|
||||
* Ensure it aligns with the user's criteria.
|
||||
* Maintain coherence with surrounding text.
|
||||
- "reason": Clear explanation of why this fragment matches the criteria.
|
||||
- "reason": Clear explanation of why this fragment matches the criteria; IF the user's request contains words like "source", "reference", "link", "cite", "website", "URL", "Wikipedia", "proof", "evidence", "verify" - then you MUST include actual working links in your explanations in html format.
|
||||
- "difference": The difference between origin and suggestion in html format: that is, you need to take the suggestion field and highlight the differences in it by wrapping them in the <strong> tag.
|
||||
- "paragraph": Paragraph number where the fragment is found (0-based index)
|
||||
- "occurrence": Which occurrence of this sentence if it appears multiple times (1 for first, 2 for second, etc.)
|
||||
@ -207,10 +207,16 @@ AssistantReplaceHint.prototype._createPrompt = function(text) {
|
||||
AssistantReplaceHint.prototype.getInfoForPopup = function(paraId, rangeId)
|
||||
{
|
||||
let _s = this.getAnnotation(paraId, rangeId);
|
||||
let reason = _s["reason"];
|
||||
try {
|
||||
reason = reason.replace(/<a\s+(.*?)>/gi, '<a $1 target="_blank">');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
return {
|
||||
original : _s["original"],
|
||||
suggested : _s["difference"],
|
||||
explanation : _s["reason"],
|
||||
explanation : reason,
|
||||
type : this.type
|
||||
};
|
||||
};
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
function CustomAnnotator(assistantData)
|
||||
{
|
||||
this.paragraphs = {};
|
||||
/** @type {Object.<string, {recalcId: string, text: string}>} */
|
||||
/** @type {Object.<string, {recalcId: number, text: string}>} */
|
||||
this.waitParagraphs = {};
|
||||
this.paraToCheck = new Set();
|
||||
this.checked = new Set(); // was checked on the previous request
|
||||
@ -46,7 +46,7 @@ function CustomAnnotator(assistantData)
|
||||
}
|
||||
/**
|
||||
* @param {string} paraId
|
||||
* @param {string} recalcId
|
||||
* @param {number} recalcId
|
||||
* @param {string} text
|
||||
* @param {string[]} ranges
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user