Added personality to describe reply
This commit is contained in:
parent
3ea09af486
commit
2fbb34e4c7
2 changed files with 13 additions and 2 deletions
|
|
@ -151,7 +151,8 @@
|
|||
var teaser = data.teaser || '';
|
||||
var rawFirst = (Array.isArray(data.raw_json) && data.raw_json.length) ? data.raw_json[0] : data.raw_json;
|
||||
var quoteDa = data.quote_da || (rawFirst && rawFirst.quote_da) || '';
|
||||
showModal(job, articleId, desc, teaser, quoteDa, data.raw_json || null);
|
||||
var personality = data.personality || (rawFirst && rawFirst.personality) || '';
|
||||
showModal(job, articleId, desc, teaser, quoteDa, personality, data.raw_json || null);
|
||||
} else {
|
||||
var msg = (data && data.message) ? data.message : 'No response';
|
||||
if (data && data.log) {
|
||||
|
|
@ -173,7 +174,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function showModal(job, articleId, description, teaser, quoteDa, rawJson){
|
||||
function showModal(job, articleId, description, teaser, quoteDa, personality, rawJson){
|
||||
var existing = document.getElementById('mvlog-gemini-modal');
|
||||
if (existing) existing.remove();
|
||||
var overlay = document.createElement('div');
|
||||
|
|
@ -183,6 +184,12 @@
|
|||
box.style.cssText = 'background:white;color:#111;padding:20px;max-width:900px;max-height:80vh;overflow:auto;border-radius:6px;font-family:inherit;';
|
||||
var h = document.createElement('h3');
|
||||
h.textContent = 'Generated description';
|
||||
var personalityBox = null;
|
||||
if (personality) {
|
||||
personalityBox = document.createElement('div');
|
||||
personalityBox.style.cssText = 'font-size:0.9rem;color:#555;margin-top:6px;';
|
||||
personalityBox.textContent = 'Personality: ' + personality;
|
||||
}
|
||||
var teaserBox = null;
|
||||
if (teaser) {
|
||||
teaserBox = document.createElement('div');
|
||||
|
|
@ -210,6 +217,7 @@
|
|||
btnBar.appendChild(useBtn);
|
||||
btnBar.appendChild(cancelBtn);
|
||||
box.appendChild(h);
|
||||
if (personalityBox) box.appendChild(personalityBox);
|
||||
if (teaserBox) box.appendChild(teaserBox);
|
||||
box.appendChild(pre);
|
||||
if (quoteBox) box.appendChild(quoteBox);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue