Files
chrome-extensions-samples/functional-samples/ai.gemini-on-device/sidepanel/index.html
Sebastian Benz 69f946b35e Improve prompt API sample (#1344)
* Improve prompt API sample

* Render response as markdown
* Fix initial maxK and temperature values
* Add privacy statement (for webstore submission)
* Regenerate key and trial token

* fix formatting errors

* Update functional-samples/ai.gemini-on-device/sidepanel/index.js

Update maxTemperature

Co-authored-by: Thomas Steiner <tomac@google.com>

* Update functional-samples/ai.gemini-on-device/sidepanel/index.js

Better string comparison

Co-authored-by: Thomas Steiner <tomac@google.com>

---------

Co-authored-by: Thomas Steiner <tomac@google.com>
2024-11-08 15:35:27 +01:00

38 lines
1.1 KiB
HTML

<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="index.css" />
</head>
<body>
<textarea
id="input-prompt"
placeholder='Type something, e.g. "Write a haiku about Chrome Extensions"'
cols="30"
rows="5"
></textarea>
<div>
<input
type="range"
id="temperature"
name="temperature"
min="0"
max="2"
step="0.01"
/>
<label for="temperature"
>Temperature: <span id="label-temperature"></span
></label>
</div>
<div>
<input type="range" id="top-k" name="top-k" min="1" max="8" step="1" />
<label for="top-k">Top-k: <span id="label-top-k"></span></label>
</div>
<button id="button-prompt" class="primary" disabled>Run</button>
<button id="button-reset" class="secondary" disabled>Reset</button>
<div id="response" class="text" hidden></div>
<div id="loading" class="text" hidden><span class="blink">...</span></div>
<div id="error" class="text" hidden></div>
<script src="index.js" type="module"></script>
</body>
</html>