# InSite AI Pagebot - A Floating AI Chat Assistant for Any Website! (Github)

    InSite AI Pagebot is a simple AI chat assistant example using Chrome's Built-In AI APIs, which run on-device models.

    It's a simple drop-in on-device chat bot that can answer questions about a website, summarize page content, and translate responses.
        * Answers user questions about the page using the Prompt API. (Experimental in Chrome 138+)
        * Summarizes the page content using the Summarizer API (Available in Chrome 138+)
        * Translates responses using the Translator API (Available in Chrome 138+)
        * Implemented with generated and tailored plain HTML/JS/CSS, using on-device translation and language models.

    Version history:
        * The initial code was generated by mistral-medium-2505 on lmarena.ai using this initial prompt:
            Make a button that can be shown on the corner of any website. When clicked, it opens a chat mole with a helpful AI agent.
            The chat mole has a text field where users can submit questions about the site, which are answered by Chrome's Built-In LanguageModel (aka Prompt) API, which has been prepopulated with context about the page and overall site and any user context.
            There's also a button users can easily click in the chat mole to "summarize this page" which provides a short 1-2 sentence summary of the page derived from on-page text the overall site and user context.
            * The initial reponse included: `Here's a complete implementation for a floating chat button that opens an AI assistant powered by Chrome's built-in LanguageModel API. This solution includes the button, chat interface, and functionality to summarize pages, and change the assistant's response language.`
        * Minimal functionality was implemented with about 10 lines of code changes in about 10 minutes - try it here.
        * An alternative initial demo can be tested here
        * Followup refinements made by michaelwasserman's artisinal keyboard clacking and Gemini include:
            * Adding response translation using the Translation API
            * Adding predefined help prompt links
            * Refactoring for api usage improvements, clarity, and brevity
    
InSite AI
🌐