Skip to content

Commit

Permalink
add support for images and audio
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbenz committed Sep 3, 2024
1 parent cbfd882 commit 81b4d30
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 78 deletions.
Binary file modified functional-samples/ai.gemini-in-the-cloud/images/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified functional-samples/ai.gemini-in-the-cloud/images/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified functional-samples/ai.gemini-in-the-cloud/images/icon32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified functional-samples/ai.gemini-in-the-cloud/images/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion functional-samples/ai.gemini-in-the-cloud/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"background": {
"service_worker": "background.js"
},
"permissions": ["sidePanel"],
"permissions": ["sidePanel", "tabs"],
"host_permissions": ["<all_urls>"],
"side_panel": {
"default_path": "sidepanel/index.html"
},
Expand Down
144 changes: 72 additions & 72 deletions functional-samples/ai.gemini-in-the-cloud/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions functional-samples/ai.gemini-in-the-cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"private": true,
"devDependencies": {
"@google/generative-ai": "0.15.0",
"rollup": "4.19.0"
"@google/generative-ai": "0.17.1",
"rollup": "4.21.2"
}
}
9 changes: 9 additions & 0 deletions functional-samples/ai.gemini-in-the-cloud/sidepanel/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ button.primary {
color: white;
}

button.img {
background: #333;
color: white;
padding: 0 4px;
width: 32px;
height: 32px;
min-width: 32px;
}

button.secondary {
background: #ccc;
color: black;
Expand Down
38 changes: 37 additions & 1 deletion functional-samples/ai.gemini-in-the-cloud/sidepanel/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h1>Google Gemini</h1>
cols="30"
rows="5"
></textarea>
<ul id="files-list"></ul>
<div>
<input
type="range"
Expand All @@ -25,7 +26,42 @@ <h1>Google Gemini</h1>
>Temperature: <span id="label-temperature">1</span></label
>
</div>
<button id="button-prompt" class="primary" disabled>Run</button>
<div>
<input
type="file"
id="image-file"
accept="image/*"
style="display: none"
/>
<button id="button-add-image" class="primary img">
<img
src="/images/screenshot-monitor-24.svg"
width="24"
height="24"
alt="take screenshot"
/>
</button>
<input
type="file"
id="audio-file"
accept="audio/wav, audio/mp3"
style="display: none"
/>
<button id="button-record-audio" class="primary img">
<img
src="/images/record-audio-24.svg"
width="24"
height="24"
alt="take screenshot"
/>
</button>
</div>
<div>
<button id="button-prompt" class="primary" disabled type="submit">
Run
</button>
<button id="button-reset" class="primary" type="reset">Reset</button>
</div>
<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>
Expand Down
Loading

0 comments on commit 81b4d30

Please sign in to comment.