Skip to content

Commit 004dd82

Browse files
committed
Show "Included content" and "Excluded content" on the progress page
1 parent 5573699 commit 004dd82

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

extension.json

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@
142142
"messages": [
143143
"askai-chatwith-button",
144144
"askai-chatwith-instructions",
145+
"askai-excluded-pages",
146+
"askai-included-pages",
145147
"askai-progress-findpar",
146148
"askai-progress-findpar-empty",
147149
"askai-progress-findpar-all-empty",

i18n/en.json

+2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
"askai-debug-prompt": "User has asked the following question:",
1515
"askai-default-instructions": "You are a research assistant. The user will provide you with a list of quotes from various historical documents. Your task is to use only the information provided in your reply to the user. Do not use any external information in your reply. Do not hallucinate facts that are not provided in the text below. The format of the source documents will be (Source #) [Page title] followed by the document text. In your replies any time you reference a fact list the source number in parenthesis at the end of the sentence. The user has provided the following source material:",
1616
"askai-desc": "Provides [[Special:AI]], which allows user to make AI queries about content of articles in this wiki.",
17+
"askai-excluded-pages": "Excluded content:",
1718
"askai-field-pages": "List of wiki pages (and paragraphs in them) to be analyzed by the AI:",
1819
"askai-field-prompt": "Question to ask:",
1920
"askai-field-response": "Response from the AI:",
21+
"askai-included-pages": "Included content:",
2022
"askai-openai-not-configured": "Error: OpenAI not configured: apiKey, apiUrl or model are not set.",
2123
"askai-progress-findpar": "Scanning the page $1 for relevant paragraph numbers...",
2224
"askai-progress-findpar-all-empty": "Paragraph numbers not found in any of the titles.",

i18n/qqq.json

+2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
"askai-debug-prompt": "Label shown by DebugService before the question received by the AI.",
1515
"askai-default-instructions": "Text of instructions that will be provided to AI service (before the prompt) if the user hasn't overriden them.",
1616
"askai-desc": "{{desc|name=AskAI|url=https://www.mediawiki.org/wiki/Extension:AskAI}}",
17+
"askai-excluded-pages": "Progress message before listing pages that were discarded by Chat With AI.",
1718
"askai-field-pages": "Label of field for the list of pages/paragraphs.",
1819
"askai-field-prompt": "Label of field for a question to the AI.:",
1920
"askai-field-response": "Label of readonly field that will show the response from the AI.",
21+
"askai-included-pages": "Progress message before listing pages that were chosen to be analyzed by Chat With AI.",
2022
"askai-openai-not-configured": "Error message if OpenAI API key, etc. are not configured.",
2123
"askai-progress-findpar": "Progress message before scanning page $1 for paragraphs.",
2224
"askai-progress-findpar-all-empty": "Not Found message after scanning all pages for paragraphs.",

modules/ext.askai.chatwith.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,19 @@ $( function () {
8484
return;
8585
}
8686

87-
$todo.append( mw.msg( 'askai-progress-narrow-ok', pageNames.length ) );
87+
$todo.append( mw.msg( 'askai-progress-narrow-ok', pageNames.length ), '<br>' );
88+
89+
if ( pageNames.length < allPageNames.length ) {
90+
// At least 1 page was excluded.
91+
// Show the list of excluded pages to user.
92+
displayProgress( $( '<b>' ).append( mw.msg( 'askai-excluded-pages' ) ) );
93+
displayProgress( allPageNames.filter( ( name ) =>
94+
pageNames.indexOf( name ) === -1
95+
).join( '<br>' ) );
96+
}
97+
98+
displayProgress( $( '<b>' ).append( mw.msg( 'askai-included-pages' ) ) );
99+
displayProgress( pageNames.join( '<br>' ) );
88100

89101
// Download each of the articles and find the paragraphs that have the snippet.
90102
return Promise.all(

0 commit comments

Comments
 (0)