Integrando IA em
Web Apps
Gemini AI + Angular = ❤️
@willmendesneto
Salvador, Bahia, Brasil
Google Developer Expert
<webapps>
are evolving
From IF/Else To AI
Before the web was…
<mobile />
<desktop />
<tablet />
A.I.� A-What?
<Apps Are Using AI For>
Generate Images
Write content
Financial Solution
Slide Decks� Plagiarism Detection
Be a Music DJ with A.I. 🎉
</Apps Are Using AI For>
But first things first
Let's get back to basics
<New? Not at all!>
1950
Lack of resources
XIX Century
</New? Not at all!>
USer
Website
Who's Answering?
Chat App
Computer
Jane
Chat App
Will A.I. dominate the world?
Not really *
Second things second:
Time to train the machine
It's your responsibility now
Treat like a baby
<Are You Ready? />
So let me tell you a story…
Tião the Monkey x Cacareco the Rhino
What is a real A.I.
Learning from real, for real
This is really cool
This is really cool
NOT A.I.
<SpeechAPI>
Javascript Native API
Great support in Browsers - ~80%
Locale Support
</SpeechAPI>
What do you mean by
window.ai ?
The power of window.ai
// checks to see if text sessions are supported by the browser
await window.ai.canCreateTextSession();
// returns an object of default options for `createTextSession`
const options = await window.ai.defaultTextSessionOptions();
// creates session with gemini nano model. Note: options arg optional
const session = await window.ai.createTextSession(options);
// command for executing prompt
await session.prompt("What does NASA stand for?");
// destroys the session
await session.destroy();
<👀 👀 👀?>
Show me what you got
</👀 👀 👀?>
🙏 I.A, resume isso aqui para mim 🙏
Gemini AI Request
const generativeAI = new GoogleGenerativeAI('<GEMINI-AI-TOKEN-HERE>');
const model = generativeAI.getGenerativeModel({
model: 'gemini-pro'
});
const result = await model.generateContent(`
Create a short summary of the page
${window.location.href} with no more than 100 words`
);
const response = await result.response;
console.log(response.text());
<Why?>
Work Automation
Excellent usage for such scenario
Way more Fun with A.I.
</Why?>
Summary With A.I.
1
<Why?>
Learning based on your needs
Case-by-case answers� LLM's in practice
</Why?>
A.I. Ask Anything
2
The future is bright,
The future is
.I.
✨ Stay tuned and always bet on JS! ✨
Thank you!
Gracias!
Obrigado! 👋
@willmendesneto
Salvador, Bahia, Brasil
Google Developer Expert