Comprehensive Code Review Of Web AI Application With Prompt API
Comprehensive code review of Web AI app using Prompt API. Well-structured architecture with service-oriented design, robust error handling & separation of concerns. Suggestions: add logging, caching & unit tests.
In this blog post, I describe how to build a trip planner application locally using Chrome’s Built-In Prompt API and Angular. The Angular application calls the Prompt API to create a language model and submits queries to Gemini Nano to to provide details such as applying for a travel visa, the clothes to pack, and attractions to visit each day. The benefit of using Chrome’s built-in AI is zero cost since the application uses the local models in Chrome Canary. This is the happy path when users use Chrome Dev or Chrome Canary. If users use non-Chrome or old Chrome browsers, a fallback implementa...