Package: farsight
FarsightIn situ interactive widgets for responsible AI 🌱🚀 Farsight Demo📺 Demo VideoWhat is Farsight?Farsight is a collection ofin situinteractive widgets that help large language model (LLM) prompt creators to envision potential harms associated with their AI applications.
With a novelin situdesign, contextual AI incident feed, and human-AI collaborative harm envisioning, Farsight empowers prompt creators with diverse backgrounds to be more mindful of responsible AI during early AI prototyping.Widgets1️⃣Alert SymbolAlert users with potential risks of their prompts and AI applications2️⃣Incident PanelRelevant cautionary tales for users' AI applications3️⃣Use Case PanelLLM-generated diverse use cases, stakeholders, and harms4️⃣Harm EnvisionerHuman-AI collaborative harm envisioning toolDistributions📦Live DemoTry Farsight with Gemini Pro and GPT-3.5📦Chrome ExtensionGoogle AI Studio support📦Python PackageComputational notebook support (Jupyter, Colab, VS Code notebook)Demo VideoClick to see the demo video!Get StartedLive DemoFor a live demo, visit:https://PAIR-code.github.io/farsight/.Computational NotebookIf you use computational notebooks (e.g., Jupyter Notebook, JupyterLab, Google Colab, VS Code Notebook), you can easily use Farsight via its Python Package. We recommend usingStickyLandto enable sticky cells.Visit thisColab Notebookfor a demo.# Install Farsight!pipinstallfarsightprompt="Translate a sentence from English to French."# Alert Symbolfarsight.symbol(prompt)# Awareness Sidebarfarsight.sidebar(prompt)# Harm Envisionerfarsight.envision(prompt)Google AI StudioIf you use Google AI Studio to prototype AI applications, you can manually install our Chrome Extension package from thelatest release.Downloadfarsight.crxOpenchrome://extensions/in ChromeDragfarsight.crxinto the pageVisitGoogle AI Studioand you will see Farsight :)Integrating Farsight into Prompting ToolsIf you are a developer of web-based prompting tools, you can easily integrate different Farsight widgets into your tool regardless of your development stacks (e.g., React, Svelte, or Vanilla JS).First, install Farsight's JavaScript package:npminstall--save-dev@xiaohk/farsightThen, you can use Farsight as Web Components.JavaScript:import'@xiaohk/farsight';import{FarsightContainer,FarsightContainerLite,FarsightContainerSignal}from'@xiaohk/farsight';HTML:<farsight-container-signalprompt="Translate a sentence from English to French"></farsight-container-signal>Developing FarsightClone or download this repository:gitclonegit@github.com:PAIR-code/farsight.gitInstall the dependencies:npminstallThen run Farsight:npmrundevNavigate tolocalhost:3000. You should see Farsight running in your browser :)How is Farsight Built?Farsight is a collection ofWeb Componentsthat developers can easily integrate into their web apps regardless of their development stack (e.g., Angular, React, Svelte). Farsight is written in TypeScript usingLIT Elementas a framework. Farsight usesD3.jsto implement the interactive tree visualization. The relevant AI incidents are from theAI Incident Database, and the harm category is from thesociotechnical harm taxonomy. The computational notebook support is enabled byNOVA.CreditsLed byJay Wang, Farsight is a result of a collaboration between researchers from Google Research, Georgia Tech, eBay, and Emory University. Farsight is created byJay Wang,Chinmay Kulkarni,Lauren Wilcox,Mike Terry, andMichael Madaio.LicenseThe software is available under theApache License 2.0.The random prompts inpublic/data/random-prompts.jsonare fromAwesome ChatGPT Promptswith aCC0 license.ContactIf you have any questions, feel free toopen an issueor contactJay Wang.