SenY commited on
Commit
0290203
1 Parent(s): 16861d2

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +15 -2
index.html CHANGED
@@ -82,6 +82,13 @@
82
  <h5 class="mb-0" id="settingsTitle">設定</h5>
83
  </div>
84
  <div class="card-body">
 
 
 
 
 
 
 
85
  <div class="form-group mb-3">
86
  <label for="apiKey" class="form-label" id="apiKeyLabel">
87
  <a href="https://aistudio.google.com/app/apikey?hl=ja" target="_blank">APIキー</a>
@@ -336,6 +343,10 @@
336
  "language": "en",
337
  "text": ${textFormat} # ${document.getElementById('characterCount').value}文字程度,
338
  },
 
 
 
 
339
  {
340
  "language": "ja",
341
  "text": ${textFormat}
@@ -344,7 +355,7 @@
344
  }
345
  \`\`\`
346
  `;
347
- const url = "https://generativelanguage.googleapis.com/v1/models/gemini-1.5-flash:generateContent?key=" + document.getElementById('apiKey').value;
348
  const payload = {
349
  contents: [
350
  {
@@ -400,7 +411,9 @@
400
  document.getElementById('promptEn').value = promptEn.replace(/\. ?/g, '.\n\n');
401
  document.getElementById('promptEn').value = document.getElementById('promptEn').value.replace(/^ */g, '');
402
  document.getElementById('promptMyLanguage').value = promptMyLanguage.replace(/\。 ?/g, '。\n\n');
403
-
 
 
404
 
405
  // ローディングアイコンを非表示
406
  document.getElementById('loading').classList.add('d-none');
 
82
  <h5 class="mb-0" id="settingsTitle">設定</h5>
83
  </div>
84
  <div class="card-body">
85
+ <div class="form-group mb-3">
86
+ <label for="danbooruTags" class="form-label" id="danbooruTagsLabel">
87
+ danbooru tags
88
+ </label>
89
+ <input type="text" class="form-control" id="danbooruTags" placeholder="danbooru tags"
90
+ readonly>
91
+ </div>
92
  <div class="form-group mb-3">
93
  <label for="apiKey" class="form-label" id="apiKeyLabel">
94
  <a href="https://aistudio.google.com/app/apikey?hl=ja" target="_blank">APIキー</a>
 
343
  "language": "en",
344
  "text": ${textFormat} # ${document.getElementById('characterCount').value}文字程度,
345
  },
346
+ {
347
+ "language": "danbooru",
348
+ "tags": [str],
349
+ },
350
  {
351
  "language": "ja",
352
  "text": ${textFormat}
 
355
  }
356
  \`\`\`
357
  `;
358
+ const url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-exp-0827:generateContent?key=" + document.getElementById('apiKey').value;
359
  const payload = {
360
  contents: [
361
  {
 
411
  document.getElementById('promptEn').value = promptEn.replace(/\. ?/g, '.\n\n');
412
  document.getElementById('promptEn').value = document.getElementById('promptEn').value.replace(/^ */g, '');
413
  document.getElementById('promptMyLanguage').value = promptMyLanguage.replace(/\。 ?/g, '。\n\n');
414
+
415
+ let danbooruTags = parsedData.results.find(x => x.language === 'danbooru').tags.map(x => x.replace("_", " "));
416
+ document.getElementById('danbooruTags').value = danbooruTags.join(", ");
417
 
418
  // ローディングアイコンを非表示
419
  document.getElementById('loading').classList.add('d-none');