Harnessing AI in Your Apps: Getting Started with Gemini API by Kamal shree Soundirapandian
Kamal shree Soundirapandian
Developer AdvocateReviews
Harnessing AI in Your Apps: Getting Started with Gemini API
Hello, everyone! Thank you for being part of this incredible women’s event. Today, we're diving deep into a vital topic: harnessing AI in your apps with the Gemini API. This is incredibly relevant as the mobile application landscape evolves and AI continues to shape user expectations.
The Evolution of Mobile Applications
Reflecting on the past decade, we have seen remarkable advancements in how Android, iOS, and cross-platform apps, like Flutter and React, are built. The transition towards AI has transformed the user experience, making it not only smarter but also more personalized and intuitive. Flutter, known for its expressive UI, serves as a powerful framework for integrating AI functionalities into apps.
Introduction to AI in Flutter
I am Kamal, a senior developer advocate at Microsoft and a Google Developer Expert. Today, I'm excited to share how we can integrate AI into Flutter applications to create intelligent and adaptive mobile experiences capable of understanding and responding to user needs. Let’s break down what we will cover in this session:
- Understanding AI in apps
- Integrating AI in Flutter
- Challenges and considerations
- Real-life case studies
The Demand for AI-Enhanced Experiences
As mobile technology progresses, users now expect apps to offer predictive and responsive features. With AI, developers can transform typical apps into platforms that understand user behavior, delivering content and functionalities tailored to individual needs.
Real-World Example: AI’s Impact
Consider a situation where I traveled abroad and encountered a language barrier when booking a taxi. My music app facilitated communication with a chatbot that resolved a payment issue efficiently. This real-time problem-solving highlighted the essential role AI plays in improving user experiences in various scenarios.
Why Use AI in Your Applications?
Integrating AI is not merely a trend; it offers compelling advantages:
- Enhanced User Experience: AI can provide personalized interactions, improving overall satisfaction.
- Competitive Advantage: Brands utilizing AI are often perceived as innovative and forward-thinking.
- Automation: AI can handle routine queries and tasks, freeing up resources for more complex issues.
- Improved Accessibility: AI technologies can make apps more user-friendly for individuals with disabilities.
- Data-Driven Insights: AI helps in analyzing user data to improve app functionalities continuously.
AI Use Cases in Mobile Development
In mobile development, AI applications are diverse, ranging from healthcare to finance:
- Medical Imaging: AI assists in analyzing medical imaging for quicker diagnoses.
- Financial Services: AI aids in stock performance analysis, helping users make informed investment decisions.
- Smart Transportation: Features such as auto-parking assistance and pedestrian detection enhance road safety.
How to Integrate AI into Your Flutter Apps
Integrating AI into your Flutter applications is straightforward:
- Identify Your Needs: Determine what AI capabilities your app requires.
- Choose the Right Technology: Ensure alignment between your tech stack and AI needs.
- Build a Collaborative Team: Engage with stakeholders and brainstorm potential solutions.
- Collect and Test Data: Utilize diverse datasets to train your AI effectively.
- Monitor and Optimize: Continuously improve your AI implementation based on user feedback and analytics.
Challenges of Integrating AI
While AI integration can bring several advantages, it also poses challenges:
- Model Selection: Choosing an appropriate AI model is crucial for effective implementation.
- Data Handling: Ensure that your app can manage user data efficiently and securely.
- Performance Optimization: Monitor your app's performance post-integration to ensure a seamless user experience.
- Ethical Considerations: Maintain transparency and security of user data while minimizing biases in AI algorithms.
Introducing Gemini API
Video Transcription
Hello, everyone. Thank you so much for being a a part of this women, event, and I'm really honored to be here.Thank you so much for joining in, and, thank you so much for all the amazing speakers. I'm the moderator. So without further ado, let's get on to today's session where I will be talking about harnessing AI in your apps, getting started with Gemini API. I think this topic is very relevant to the current world because of the AI trends that we are facing as a mobile application continues to evolve. I can think of a day where, a decade back how Android apps or React or Flutter, iOS apps were built, and now you can see the transition of how AI is taking over. The user expectation have shifted from smarter one to more personalized, intuitive experience. So Flutter I've picked up Flutter because it's known for its expressive UI. Right?
So we're gonna see the cross platform capabilities and is now paused with harness of power of AI. So it's very easy to implement AI in Flutter. And today, we're gonna see how the power of artificial intelligence to deliver truly intelligent app. That is what the requirement is these days. So I'm Kamal. I'm a senior developer advocate at Microsoft. I'm a Google developer expert and a women tech ambassador as well. So I just don't talk to audience, share my knowledge, and I'm done with it. No. I try to connect with them. So I'm sure everybody has a LinkedIn app. So if you have one, quickly open the search, scan this QR code, or you could type Kamal Sri, and you would find my profile. I would love to connect with you, post the session also to understand if you have any questions related to the session or in general AI, anything related to app.
And I work for Microsoft, so I work with internal and external of m three sixty five, where I work for the Copilot extensibility agents, building of agents. So love to connect with you folks. So, again, open LinkedIn, scan this QR code, and we'll be good to go. I will also share my social handles post in the chat as well. So today's agenda is pretty simple, straightforward. Just to give you awareness as to what AI in apps is all about, how AI in Flutter is, challenges and consideration, case studies. And it's very important as a developer to be a part of the resource and community because I think most of the developer be a part of it, learn, and then they're gone. You have to be a part of the community. That is where you play a very vital vital role as well as you learn a lot.
So I'll let you know how you could be a part of it as well. So we will explore here how to integrate AI into Flutter apps to build adapt a mobile experience that can understand, predict, respond. Because at the end of the day, we all are using AI for all these purpose only. Either understand my query, predict analysis, give me response, give a more systematic data response, come up with an adaptive card. This is what we need. Right? At the end of the day, it's all revolving around data, but how you present it, what you do with the data is what are the different techniques used here. So today, we we'll be talking about from chatbot powered by LMS like chat, GPT, and Gemini to speech recognition, image analysis, real time personalizations.
We will also show some practical examples like tools to bridge, the gap between beautiful UI and the cutting edge intelligence. So we will see an example, as to how ChatGPD and the Gemini is gonna help us build quickly chatbots or, AI bot for our requirement. Using AI in app is one of the hottest trend right now. So it makes your app smarter. Now someone might ask me, Kamal, why should I actually go ahead with AI? Just because the trend. No. I'll give you an example where it was a real time example that I kind of, went through. I was traveling to a different country where I didn't know the language. It had a different currency.
So I took the flight, landed in the country safe, and I had to reach the hotel. So all I had was just this app to book an, taxi. So I booked the taxi. I just said, this is my location. I'm standing at the, taxi stand, and there's a on each of the pillar, there is a number. So it tells, are you at this particular pillar gate number? Yes. The taxi got booked. I used my credit card. Simple. Everything went pretty smooth. And I was also being charged for my credit card. As soon as I got inside the cab and I drove all half the way, I didn't know the language. I could not interact with the driver. Nothing could happen. I was half the way, and I see my credit card was double charged. Do you think at that point of time I would be interacting with the driver asking him this has been refund?
Definitely, he would say go talk to the, company which actually booked. I've been charged only once and all that. So I just wanted to reach safely back to the hotel, went, checked it, got into the app, opened it. There was a chatbot there. So I clicked on the chatbot. Instead of calling the customer care, I clicked on the chatbot and I said, hi. And immediately it said, Kamal, how was your trip? Good. How can we help you? Is it related to, the driver behavior or the ride, or do you wanna book another cab, or, is it related to payment? I said payment related. Immediately, it gave me a response stating, it looks like initially we were charged so much. I mean, we asked for so much amount, and looks like you're being double charged. Would you like a refund back to your credit card or your back account?
I was like, credit card. And it said another fifteen to twenty minutes, it would be credited. I just waited. I didn't close the chat, and the amount was credited. Think about a situation if AI was not there, chatbot was not there. This efficient smart AI chatbots weren't there, situations would have been entirely different for me. I should have called up the customer care, got into IVR, waited in the queue, got into a real person, informed them or explained my query, then ask them, can I get a refund? He would or she would tell that it looks like although he's gonna give it from his pocket, he would try to decline it, then it gets into escalation process, and there's this roundabout, and then it would say, like, it would take five to seven working days for the amount to be refunded.
Now look at the chatbot, which was not at all a human, but it could understand my emotions. So that is the level of service or app or experience the customers or clients are expecting. In fact, even I'm expecting. So as a developer, as a person in an IT industry, as a techie, if you would love to adopt something, think about these kind of real time scenarios which would actually help your customers. So here's a quick breakdown of how AI is being used in mobile, web, desktop. Totally. Because Flutter, once you build it, you can deploy it in all the application. Right? So that's also another beauty of it. So I always back up with statistics. When someone says, Kamal, I wanna do a project, and this is my requirement. Why would I go for Flutter? Or why would I go for x y z? Why should I adopt AI? How is it working in the market?
Should I adopt it, or is it gonna go down? So I try to understand how things are gonna go before I kind of vouch in or take a stake on a particular tech stack because I will be responsible enough to build it. Say, for example, even if I'm not working on that particular project, it will be given to another team. Or if there is any new product or feature getting added, my product should be scalable enough to adapt to the new changes. So that's how you need to think about all this before dwelling or taking up a particular tech stack. So understand the current trends, market, what kind of industry it's gonna serve. Is it a medical, automobile, or IT industry, or IT support?
Think about it, and then think about the tech stack, and then start working on it. Now a couple of use cases of AI in mobile development, you can start it's starting from health care where they do this deep image analysis of your brain or X-ray. And, initially, those days, if someone was given an X-ray, we don't even know what was the, outcome of it. We had to wait for the doctor to come and explain it. But these days, you have the AI assistant completely doing an image analysis of your medical records and giving you a summary of it, finance, your stock, your stock analysis, how your stock would, function another one month or how it's been performing before your supply chains or your manufacturing products.
I search for a particular product, and then next minute, I get all relevant products that I've been searching for, a similar, from a different vendor, and also transportations. Definitely, you can see in the automobiles, you have auto parking assistance, AI related, pedestrian, parking, immediately detect objects and park your vehicle. So these kind of things have kind of rule in all the industry and just not from developers point of view. Yes. Developer, you have lot of tools that have been coming like Copilot, GitHub Copilot. So many tools like a Charge UPT that helps you to prepare PowerPoint presentations. So many tools have been available, but you will also work in different industries other than this. So you should be prepared to see how your AI will function in all these fields.
Now coming on to or moving on to AI in Flutter, I would say using AI in Flutter opens up a lot of exciting possibilities for building intelligent apps or even interactive and personalized app. So whether you're adding a natural language, understanding computer vision, generative AI feature, There are many ways to integrate AI into Flutter apps. I will let you know one by one how you could do it. But just to give you a gist, Flutter AI is welcomed in Flutter, and you can easily integrate it. Now you might ask me, Kamal, why should I actually even go for AI in Flutter? Does not Flutter just like that supports me? Or I can't work on it, but definitely, yes, you can. But there are certain plugins and features available that actually enhances your Flutter app.
So first thing is the enhanced user experience, competitive advantage, automation, improved accessibility, data driven insight. These are couple of reasons why I would choose AI in Flutter. Say, for example, common use cases if I have to think about chat GPT or virtual assistance, like integrating GPT model for smart conversations. Whenever you build a chatbot, you have to think about a model. Say, for example, which I've been doing, I had to develop. Say, for example, if your project manager come comes up with an example, saying a requirement, Kamal, I want you to create an banner, but this is the requirement, with the skyline view of New York, and keeping the theme of, June and July of New York, and keeping the neon themed color.
What do you think I would do? Either I would go to a designer, give him all my requirements, and then come up, or either I would have to use my own, Photoshop or, digital making tools or buy something online and get it done. But trust me, these days, you have Chargept. You have Copilot that can generate banners instantly for you based on your prompt and the model you choose. So if I have to go for a image generating chart GPT or response, I have to use a model called DALL E. That is the model that I have to use, which will kind of generate image for me. So I'm gonna say, generate a banner image of x cross y size dimension, and then I'm looking for a new New York skyline with the neon theme color with the vector illustration.
And, keeping June and July, season theme in the mic, can you generate the images? I would get amazing images displayed. Excuse me. So I would get amazing images generated. And then the best part is it'll also give you an option saying, okay. Do you need a few more addition or few more historical places to be added, or do you want some diversions showing about the financial district? All these suggestions would be given. So things are being getting more easier. Another context, text generation. Say, if I have to use, email drafting, summarizations, creative, writing in an app, I will use Gemini API, Azure OpenAI, OpenAI Charge GPT. Or even if it's, like, voice recognition and synthesis, I would use speech to text where it combines your AI to process to respond to the spoken input.
Or I would also think about image recognition and analysis. Definitely in Flutter, we have something called as Firebase ML, TensorFlow Lite, where it kind of detects an object and classifies the image, like the, run OCR. Another example is these days, we do have apps where, if I'm lost in a particular, country and I don't know where to go to my destination, all I have to do is open up the particular app, click the picture of the current, location where I am. It could be a signboard or it could be, a a shop name or something. The moment I click and I say process, it tells you a Google Map kind of a direction telling which way you have to go or take to go to the destination. So that is how advanced things are getting up. Or I could say some personalized product content suggesting using AI models.
So you can think of all about it and all is available in AI in Flutter. Next, come moving on to the AI functionalities in Flutter, definitely, natural language processing, image processing, voice recognition, that is all possible in Flutter. So whether converting speech, text analysis, translations, smart replies, which is also another important, aspect that I would say when you are building chatbots or AI assistant. If I give a prompt, it's not necessary that I get the correct answer. It might hallucinate also. So you have to make sure that my prompt response is validated. So you have to choose a right model. You have to give a right prompt. After several prompting, that is when you would get a right response. Your knowledge base should be trained in such a way.
That is your bot's LLM should be trained in such a way that you get the accurate, updated latest response in the first prompt itself. You cannot keep on checking. Say, for example, I'm looking for my balance account, and I cannot keep on asking, give me the correct balance. Give me the correct balance. Right? In the first prompt itself, the balance has to be the right one. Say, for example, if I'm creating a banner, then I can have suggestions. That's a different way of handling the, AI assistant. As I told you, you can use DALL E for image and, show AI generated images from prompt to your Flutter UI. You can do that as well. Okay. Now how come I got to know about AI. I got to know what are the why should I go for AI in Flutter?
I understood what are the models available. Now how do I start integrating it in your apps? So first thing, identify your needs. Which models do I should I choose for? What is my requirement? Is it image processing? Is it text processing? Is it more of analysis? Find out the right technology. Technology totally depends on your tech stack, totally depends on your expertise. Choose what you like, then build a team. I think individually, it is not gonna work. You need to have a dream. Have a brainstorming sessions. Talk about it day in and day out. People finish the brainstorming sessions in one or two days and dwell into product development, like, for months. I would say spend time at least, like, two to three weeks exactly brainstorming, bring up weird scenarios, bringing it to the extent what all is not possible possible everything, and then work on the product.
You will not take more than a month to work on it. Collect data. Try with different types of data. Try with junk data. Try with data you can never think about it. The more you test, that's when your LLM, your knowledge base is gonna build for the AI, and it would be aware, okay. Any type of scenarios, I will not hallucinate. I will give a right response. Choose the right model. Train the models, whether it's image, ChargeGPT, Azure OpenAI. Think about which models you wanna use, whether it's a TensorFlow. There are tons of models available. So you can all look as the Flutter plug in packages. You can find the models used there, then start integrating. This is where till your developers do it awesomely. After that, what? You'll have to test it.
People don't do that. Testing of the product, then monitor it. It's another vital aspects which people forget to do it. Monitor the app, then optimizations. You will have to check what is the outcome of this product, what all has been done, how can I optimize it for the best performance, you will have to look? So the last three blocks, most of the developers or even the product managers do not combine it as part of the integration process. So I would suggest do start adopting these methodologies as and when you build a product. Now, again, this is gonna talk about little more on the neural networks, machine learning, NPL computer vision. I think I've covered it, so I'll just skip the slide as of now. Okay.
We saw general integrating AI in Flutter apps, but now you will see, Kamal, I I'm not into Flutter. How do I get into integrate AI in my apps that also has the similar model where you set an objective AI framework. It's just that the plugins might be different, environment environment might be different, your testing phase might be different. So integrate AI model into, Flutter, then choose a dep dev, deployment model. So these are the things that might vary, but the skeleton remains the same for both of them. Now AI ML integration in Flutter, definitely, it has these four concepts. First is the framework integration, which framework are you using? Next comes to handling data. It's all about in and out of handling data here.
Model deployment, which model you use. If you are, into Microsoft, more into Copilot, we definitely use, GPT models, DALI models available for us. But on the other side, you will find different models, and, definitely, implementing it gives a different response. Another quick example why I keep talking about models, the data handling, integration is that, say, for example, I built a simple chat GPT. I built it on my own using Azure. Just saying, okay, how do I after after building the entire chatbot, I was like, how do I prepare omelet? And I immediately got the response. It was awesome. Nice. But then I said I gave a system message. I trained my model saying you are not a ordinary chatbot. You are an IT support bot. You have to answer queries related to IT. These are the product.
And the moment immediately after redeploying it, I asked, tell me how to prepare an omelet. It said, no. I'm not an ordinary bot. I answer queries related to IT, and these are the products. Please go ahead if you have any of the questions related to it. So that's how you have to you cannot have a very generalized, chatbot. You cannot have all the documents or, data exposed directly to anybody. You should have authentications available. SSO, you have to create. You have to get your documents labeled, whether sensitive, private, or public so that accessibility is maintained. So think about all this. It's just not about building a bot. There are a lot of other aspects also you have to considering after building one. So coming to the model one, just exact exciting ML model you do, and then you fine tune it, make the model understand what you have to do it.
Then, again, fine tuning of the ML model happens. So this is behind the scenes when you think about a model that you have to choose one. So everything is a complete area of, deep diving, whether it is prompt or whether it's model or whether it's deployment. So if you wanna get into building AI apps, you have to think about it. So as I told you, AI has got into automation, auto parking, getting all the device details, hazard detected, there's a vehicle on the road. It auto parks or it stops, pedestrian crossings stops the vehicle, auto braking, all that is all detecting of you or based on my AI okay. There is a simple scenario where you can think of it, where I was, like, playing a music in my AirPod.
And then as soon as I got into the, car, the same music starts playing from my dash cam, I mean, the dash board from the vehicle. And then immediately when I step out into a supermarket, the same time frame where it had stopped, it starts playing back on my ear pod. So your AI assistant here is kind of playing a very important role. You can think about the next generation on these aspects. So automations is ruling the world with the AI. So or whether it could be summarizing text. When you look at this example where it's a simple text, and then I have used an AI to do a summarized text, you can look at the number of words, the context, the way it kinds of paragraphs. We might have a context. We might have a data, but we don't have a proper way to narrate it. Charge GPT helps you.
Or the model or the AI chatbot that you build will help you in these kind of scenarios. So I have spoke about AI. I kind of informed you, like, how AI in Flutter is. Why should you adopt one? Now let's see what are the challenges. Just because I I am aware of this particular technologies, everything has its pros and cons. Right? You should be aware of what are the challenges, what are the things you have to be extra cautious when you're building one. Right? So first thing is ethical consideration, which is a very basic minimal thing that you have to consider. Transparent transparency and explainability. You have to be transparent with your data. But at the same time, make sure that you do not hallucinate, you do not give private informations exposed, data privacy, security comes into picture, human mentioned collaborations, images getting accessed, bias and fairness has to be considered, third party services.
Whenever you use third party plugins, be extra cautious. What's really happening with your data? What's happening with your chat history? Think about all these aspects before committing to something. So there are challenges, but consider it and see what level of challenges you can minimize. I keep getting this question everywhere. Kamal, AI is there. Is it, like, gonna take a job, or should everybody adopt it? I would say AI is for every developer just to add that flavor to whatever app you're developing to make it more aesthetic, to make it more appealing. And at the end of the day, it's all about customer, client satisfaction, and how happy they are using your product. Right? So build with state of our generative AI models, tools to make AI helpful for everyone. This is what the objective of AI, I would say. Excuse me.
So challenges in integrating AI in for Flutter. So initially, I said challenges of AI, but now it's more on challenges in integrating AI in Flutter is where is the pinpoint of where people actually lack lot of confidence and kind of make or error prone to more errors is model selection. They do not select the appropriate model. SDK compatibility. Think about SDK because it's not always one a chatbot you design. A chatbot might be interacting with another chatbot also. Complexity, consider it. Optimizing app performance. These are the four sections that I see a lot of people lack. They build a chatbot set up successfully. They build implement AI. They adopt AI. They do everything, But these are the areas where key areas people miss it out. Now coming to the, Gemini part, which which we are talking about. So first thing, Google AI Studio. I think everybody would have heard about it.
I would say it's a web based ID that lets developers do what all is experiment with Gemini, which is one of the most Google's advanced multi model. It's quick prototype prompts like chat flow, system instructions, exporting and integrate, results into app using Google Gemini APIs for example. There is a playground for Gemini where, like, OpenChat GPD Playground for Microsoft because I do that comparison. And you have the Copilot Studio prompt flow but designed for Gemini. Now you can integrate this with Dart and Flutter with Gemini dot SDK. You can build conversational, AI in Flutter. You can process user images by drawing documents in mobile app. You can use Google AI Studio to test prompts, actually, and export working code into your Dart project. So these all is available with the Google AI Studio. All you have to do is just type Google AI Studio, and you are good to go.
It's free to use. But when it comes to model, there are charge based. Now we have another one called the Flutter AI Toolkit. Now it's not isn't a single official product, but I can absolutely build your own AI powered toolkit in Flutter using combination of Dart packages, plug in, and Cloud services. If you haven't tried Flutter AI toolkit, I will show you in a minute how you could actually do that. This is the link. Just type flutter AI toolkit, and you would get this example already live, which is running on the web browser. So you can start asking the chatbot. So you're the chatbot was asked, like, what's this man's Halloween costume? And it says he's wearing a virtual reality headset. So you could actually try this. I will provide you the link in a second. It's a very, funny and you can see the entire app, how it's been developed with this chatbot.
So I'll freeze the screen for a minute. So this is the link that you will have to type, the l o, and this is the package that has been used. So use the package and you would be able to build a chatbot of your choice with your own customization. Everything is possible. So I'll just freeze the screen for a sec second or fifteen seconds, and you can take a screenshot. Alright. So moving on. So the Gemini API lets you to access the latest generative model from Google. So I have the studio to build, but how do I get or access the model? Models are the backbone behind creating the, chatbot for your use case. Right? So how do I get those?
So with the help of Gemini API, you'll be able to do it. So what are the types of Gemini that we have? So one is Ultra, Pro, Nano. So the evolution of early palm and broad efforts, like Gemini was designed to understand the reason across text, image, video, audio, and code, okay, and making it one of the most powerful and flexible AI system today. So first thing, let's start with the Nano. It's a very lightweight on device. So it's optimized for running on smartphones, I would say, like the Pixel. So you can get smart replies. Summarization is possible. Text classification is possible, but it works without cloud connectivity for privacy sensitive tasks. So this is a very lightweight on device. Now if you move on to the next one, Gemini Pro, I would say it is for more of a cloud based general purpose, like a mid sized model like, Gemini API and the Google AI Studio.
So I would say the chat box experience that you have on the geminigoogle.com or Gemini for workspace like the docs, Gmails, Sheets, you can you go for Gemini Pro. Now Ultra, which is more of the flagship, I would say the most powerful one, It's the largest and the most capable Gemini model, where it is like the high end enterprise setting advanced AI copies where I could use in enterprise AI's research, complex reasoning, multimodal expectations or applications, basically.
That is where I can do. So you have three levels of models in Gemini. Think about it of your use case and use one. So Gemini usages definitely transforms your productivity. Creativity is unleashed, solves the real world problem. So understand these particular things and then get into Gemini. Now how do I start? Okay. I understood about it. So first thing, as I mentioned, open Google AI Studio, search on web browser Google AI Studio, log in with your Google account. Simple. That's it. Once you're done with it, create an API key. Creating an API key is very simple, but do not share it with others. Keep it safe, and then you start with your Python and call the rest API using curl. You are good to go. You already developed a chatbot. Now what are the capabilities of Gemina API? What all I could do and why should I go for one?
You can use for audio files, files, normal files, function calling, code execution, tuning, embedding, authentication, counting tokens because there is, like I I need to save my chat history. I need to know how many responses I can display. It's not that you keep on entering a chatbot and you keep on getting it. So this is all comes into counting of token and a lot of other things. Function calling, JSON. So these are the capabilities of Gemini API that actually helps you to choose one. Now what are the official SDKs that are supported here? Python. Kamal, I just know Flutter. I'm not into Flutter, but how do I use Gemini? We do support Python. We do support Node. Js, Swift, Go, Android, Flutter. So if you are expertise in any of these or you're learning, definitely, you can try out Gemini API. As I told you, this is the screen again.
So Google AI Studio on the top right left corner, you see get API. Click on it, you get the API, or you get a default Windows, seen here where you can say either start with a new prompt or get an API key. And on the left corner, you can see the token count, the temperature. Temperature is not about the system. It's about the temperature, the clarity on the prompt that you get. There are settings, JSON mode, code execution, function calling, grounding. Grounding is another concept where whenever you type something, say, I'm looking for a banner of so and so size with New York skyscraper. Immediately, you get a response, but behind the scene, this is not what really happens. It gets grounded. It kinds of revises your prompt.
Find out what is appropriate, inappropriate, is it a valid, all that is called grounding. So it's like preprocessing, and once you get the response, it again does the postprocessing. So grounding is another process that happens behind the screen. So what do I use Gemini and a Google AI Studio here? Simple. Now get an API key. How do I get? You can follow the API document, Gemini API Google. You will find that. You can also get your API key by just clicking on the button, and you're good to go. This is a quick start guide. And then you create a project and generate the API key. So do not use this API key. It's a dummy one. So you can copy it and you can start working on your chatbot. Now once you get the API key, I've created a very simple project.
I'll tell you what this project is all about in the next slide. So I have used it and I would be pasting my Gemini API key or I would be creating a variable. Sorry. So here's the API key that I would be feeding in. And then I'm gonna tell, please provide me the most list of most influential people in the world. And I had used the model Gemini Pro and provision here, and voila. This is the response that I get. A simple text. So all I did was generated a API key, added the the API key into my context, and said, this is my prompt. Give the most 100 influential people. And these are the four folks I mean, these are the folks that I get, the first 10. Now I can fine tune this. How? I can set the okay.
How to be productive during a burnout stage? So I give a stop sequence. I give a token. I give a temperature, and then I can fine tune this. Now how do I do it? Another example. I'm gonna use a Gemini provision here. This is another model that I'm using in my Gemini, which is the provision. I feed in this image, and I know everybody knows this is the northern lights. Right? Simple. So all I do is I feed this image portrait dot JPEG. Simple. Right? And I'm gonna ask the question to my model. What is this? It immediately processes the images and it tells. It's a natural ride that displays in the night sky caused by collision between electrical charged particles from the sun and the atom in the earth atmosphere. So I was able to analyze my image and I was able to extract text. Now you can think about scenarios what all you could do with an image. Right?
Next, I can I'm gonna ask, okay. I give you an image. You told me what this image is all about. Right? Now can you provide the exact location and the coordinates? It gives me the details with this model. So I have fed the image here parameter, and I'm asking this question to my model. So you can see the response here. It tells, okay, this is the coordinate. This is the latitude and the longitude. Next, I'm gonna ask, what causes the northern lights, and where and when you can see the northern lights? It gives me a response. So based on a single image, I was able to calculate the location, what it was, ask more questions based on the response that I received.
So it tells you you can you can find it in the Scandinavian, Iceland, Norway, and it also says the how intensity of the aura also depends on the solar activity and when it occurs and why it occurs. So the this was one simple example that I can think of using a Gemini provision one. Advanced use cases is you can think about safety system in the transport, lower level API, multi turn conversations. Think about all this that would be more on the advanced use cases. As I told you, resources and community is a very important role. You have to be a part of it. So these are the resources that if you would love to I'll freeze the screen again. Take a screenshot. You can refer here. You can find all the example content that's been picked up from here, as a reference. You want a quick start with the Gemini API.
The first link really helps you. The third one is the cookbook from the Google Gemini API where you have examples and live demos available. So work on it, and, thank you so much. I think by the end of the session, you must have got an idea how to harness AI in any apps irrespective of whether you build Flutter or React or a normal app or a web based app. You have to have the flavor of AI into it because it's gonna be ruling the world going forward, and the client also expects the same. Thank you so much. Hello, everyone. Thank you so much for being a a part of this women, event, and I'm really honored to be here. Thank you so much for joining in, and, thank you so much for all the amazing speakers and the moderator.
So without further ado, let's get on to today's session where I will be talking about harnessing AI in your apps, getting started with Gemini API. I think this topic is very relevant to the current world because of the AI trends that we are facing as a mobile application continues to evolve. I can think of a day where, a decade back how Android apps or React or Flutter, iOS apps were built, and now you can see the transition of how AI is taking over. The user expectation have shifted from smarter one to more personalized intuitive experience. So Flutter I've picked up Flutter because it's known for its expressive UI. Right? So we're gonna see the cross platform capabilities and is now posed with harness of power of AI. So it's very easy to implement AI in Flutter. And today, we're gonna see how the power of artificial intelligence to deliver truly intelligent app. That is what the requirement is these days. So I'm Kamal.
I'm a senior developer advocate at Microsoft. I'm a Google developer expert and a women tech ambassador as well. So I just don't talk to audience, share my knowledge, and I'm done with it. No. I try to connect with them. So I'm sure everybody has a LinkedIn app. So if you have one, quickly open the search, scan this QR code, or you could type Kamal Shree, and you will find my profile. I would love to connect with you, post the session also to understand if you have any questions related to the session or in general AI, anything related to app. And I work for Microsoft, so I work with internal and external of m three sixty five where I work for the Copilot extensibility agents, building of agents. So love to connect with you folks. So, again, open LinkedIn, scan this QR code, and we'll be good to go.
I will also share my social handles post in the chat as well. So today's agenda is pretty simple, straightforward. Just to give you awareness as to what AI in apps is all about, how AI in Flutter is, challenges and consideration, case studies. And it's very important as a developer to be a part of the resource and community because I think most of the developer be a part of it, learn, and then they're gone. You have to be a part of the community. That is where you play a very vital vital role as well as you learn a lot. So I'll let you know how you could be a part of it as well. So we will explore here how to integrate AI into Flutter apps to build
No comments so far – be the first to share your thoughts!