Skip to content

Commit

Permalink
Fix ai.assistant Session Creation Issue in ai.gemini-on-device (#1330)
Browse files Browse the repository at this point in the history
* Updated: Session creation

* Updated: Session creation

* Updated: Session Creation
  • Loading branch information
Gitesh08 authored Oct 23, 2024
1 parent 7fbd761 commit e5598ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functional-samples/ai.gemini-on-device/sidepanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let session;
async function runPrompt(prompt, params) {
try {
if (!session) {
session = await window.ai.assistant.create(params);
session = await window.ai.languageModel.create(params);
}
return session.prompt(prompt);
} catch (e) {
Expand All @@ -39,7 +39,7 @@ async function initDefaults() {
showResponse('Error: window.ai not supported in this browser');
return;
}
const defaults = await window.ai.assistant.capabilities();
const defaults = await window.ai.languageModel.capabilities();
console.log('Model default:', defaults);
sliderTemperature.value = defaults.temperature;
sliderTopK.value = defaults.topK;
Expand Down

0 comments on commit e5598ed

Please sign in to comment.