{"id":18714820,"url":"https://github.com/pair-code/farsight","last_synced_at":"2025-04-12T13:04:55.402Z","repository":{"id":223948454,"uuid":"691256025","full_name":"PAIR-code/farsight","owner":"PAIR-code","description":"In situ interactive widgets for responsible AI 🌱","archived":false,"fork":false,"pushed_at":"2024-03-11T18:45:06.000Z","size":22026,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-06T12:49:00.770Z","etag":null,"topics":["ai","ai-safety","chatgpt","chrome-extension","gemini","gemini-pro","gpt-4","jupyter-notebook","llm","notebook","responsible-ai"],"latest_commit_sha":null,"homepage":"https://pair-code.github.io/farsight/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PAIR-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-13T20:06:42.000Z","updated_at":"2024-10-02T11:59:00.000Z","dependencies_parsed_at":"2024-03-04T18:27:19.527Z","dependency_job_id":null,"html_url":"https://github.com/PAIR-code/farsight","commit_stats":null,"previous_names":["pair-code/farsight"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIR-code%2Ffarsight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIR-code%2Ffarsight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIR-code%2Ffarsight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIR-code%2Ffarsight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PAIR-code","download_url":"https://codeload.github.com/PAIR-code/farsight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223518557,"owners_count":17158689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-safety","chatgpt","chrome-extension","gemini","gemini-pro","gpt-4","jupyter-notebook","llm","notebook","responsible-ai"],"created_at":"2024-11-07T13:06:27.588Z","updated_at":"2024-11-07T13:06:28.270Z","avatar_url":"https://github.com/PAIR-code.png","language":"TypeScript","readme":"\u003ch1\u003eFarsight \u003ca href=\"https://PAIR-code.github.io/farsight/\"\u003e\u003cimg align=\"right\" alt=\"Farsight logo.\" src=\"public/android-chrome-192x192.png\" width=\"36\" height=\"36\"\u003e\u003c/a\u003e\u003c/h1\u003e\n\n[![Github Actions Status](https://github.com/PAIR-code/farsight/workflows/build/badge.svg)](https://github.com/PAIR-code/farsight/actions/workflows/build.yml)\n[![license](https://img.shields.io/badge/License-Apache_2-blue)](https://github.com/PAIR-code/farsight/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/v/@xiaohk/farsight?color=orange)](https://www.npmjs.com/package/@xiaohk/farsight)\n[![pypi](https://img.shields.io/pypi/v/farsight?color=yellow)](https://pypi.org/project/farsight/)\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1aTIW3tRX1BRcNMCg8bRKktpZxRXtMF3-?usp=sharing)\n[![arxiv badge](https://img.shields.io/badge/arXiv-2402.15350-red)](https://arxiv.org/abs/2402.15350)\n[![10.1145/3613904.3642335](https://img.shields.io/badge/DOI-10.1145/3613904.3642335-blue)](https://doi.org/10.1145/3613904.3642335)\n\nIn situ interactive widgets for responsible AI 🌱\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"3\"\u003e\u003ca href=\"https://PAIR-code.github.io/farsight\"\u003e\u003cimg width=\"100%\" src='https://github.com/poloclub/wordflow/assets/15007159/c2f01503-9eb7-477c-be20-0b92a2efd1f0'\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e\u003ca href=\"https://PAIR-code.github.io/farsight\"\u003e🚀 Farsight Demo\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://youtu.be/BlSFbGkOlHk\"\u003e📺 Demo Video\u003c/a\u003e\u003c/td\u003e\n    \u003c!-- \u003ctd\u003e\u003ca href=\"https://youtu.be/l1mr9z1TuAk\"\u003e👨🏻‍🏫 Conference Talk\u003c/a\u003e\u003c/td\u003e --\u003e\n    \u003ctd\u003e\u003ca href=\"https://arxiv.org/abs/2402.15350\"\u003e📖 Research Paper\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## What is Farsight?\n\nFarsight is a collection of _in situ_ interactive widgets that help large language model (LLM) prompt creators to envision potential harms associated with their AI applications.\nWith a novel _in situ_ design, 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.\n\n\u003ctable\u003e\n  \u003ctd colspan=\"3\"\u003eWidgets\u003c/td\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e1️⃣\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eAlert Symbol\u003c/strong\u003e\u003c/td\u003e\n    \u003ctd\u003eAlert users with potential risks of their prompts and AI applications\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e2️⃣\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eIncident Panel\u003c/strong\u003e\u003c/td\u003e\n    \u003ctd\u003eRelevant cautionary tales for users' AI applications\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e3️⃣\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eUse Case Panel\u003c/strong\u003e\u003c/td\u003e\n    \u003ctd\u003eLLM-generated diverse use cases, stakeholders, and harms\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e4️⃣\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eHarm Envisioner\u003c/strong\u003e\u003c/td\u003e\n    \u003ctd\u003eHuman-AI collaborative harm envisioning tool\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctd colspan=\"3\"\u003eDistributions\u003c/td\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd\u003e📦\u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://pair-code.github.io/farsight/\" \u003eLive Demo\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003eTry Farsight with Gemini Pro and GPT-3.5\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd\u003e📦\u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://github.com/PAIR-code/farsight/releases\" \u003eChrome Extension\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003eGoogle AI Studio support\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e📦\u003c/td\u003e\n    \u003ctd\u003e\u003ca href=\"https://pair-code.github.io/farsight/\" \u003ePython Package\u003c/a\u003e\u003c/td\u003e\n    \u003ctd\u003eComputational notebook support (Jupyter, Colab, VS Code notebook)\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n## Features\n\n\u003cimg width=\"100%\" src='https://github.com/xiaohk/gifs/blob/main/farsight-800.gif?raw=true'\u003e\n\n### Demo Video\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to see the demo video!\u003c/summary\u003e\n  \u003cvideo src=\"https://github.com/PAIR-code/farsight/assets/15007159/eb4b5e3e-50a2-47f5-b146-072290a4da87\"\u003e\u003c/video\u003e\n\u003c/details\u003e\n\n## Get Started\n\n### Live Demo\n\nFor a live demo, visit: \u003chttps://PAIR-code.github.io/farsight/\u003e.\n\n### Computational Notebook\n\nIf 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 using [StickyLand](https://github.com/xiaohk/stickyland) to enable sticky cells.\n\nVisit this [Colab Notebook](https://colab.research.google.com/drive/1aTIW3tRX1BRcNMCg8bRKktpZxRXtMF3-?usp=sharing) for a demo.\n\n```python\n# Install Farsight\n!pip install farsight\n\nprompt = \"Translate a sentence from English to French.\"\n\n# Alert Symbol\nfarsight.symbol(prompt)\n\n# Awareness Sidebar\nfarsight.sidebar(prompt)\n\n# Harm Envisioner\nfarsight.envision(prompt)\n```\n\n### Google AI Studio\n\nIf you use Google AI Studio to prototype AI applications, you can manually install our Chrome Extension package from the [latest release](https://github.com/PAIR-code/farsight/releases).\n\n1. Download `farsight.crx`\n2. Open `chrome://extensions/` in Chrome\n3. Drag `farsight.crx` into the page\n4. Visit [Google AI Studio](https://aistudio.google.com/app/prompts/new_chat) and you will see Farsight :)\n\n## Integrating Farsight into Prompting Tools\n\nIf 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).\n\nFirst, install Farsight's JavaScript package:\n\n```bash\nnpm install --save-dev @xiaohk/farsight\n```\n\nThen, you can use Farsight as Web Components.\n\nJavaScript:\n\n```typescript\nimport '@xiaohk/farsight';\nimport {\n  FarsightContainer,\n  FarsightContainerLite,\n  FarsightContainerSignal\n} from '@xiaohk/farsight';\n```\n\nHTML:\n\n```html\n\u003cfarsight-container-signal\n  prompt=\"Translate a sentence from English to French\"\n\u003e\u003c/farsight-container-signal\u003e\n```\n\n## Developing Farsight\n\nClone or download this repository:\n\n```bash\ngit clone git@github.com:PAIR-code/farsight.git\n```\n\nInstall the dependencies:\n\n```bash\nnpm install\n```\n\nThen run Farsight:\n\n```bash\nnpm run dev\n```\n\nNavigate to [localhost:3000](https://localhost:3000). You should see Farsight running in your browser :)\n\n## How is Farsight Built?\n\nFarsight is a collection of [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) that developers can easily integrate into their web apps regardless of their development stack (e.g., Angular, React, Svelte). Farsight is written in TypeScript using [LIT Element](https://lit.dev/) as a framework. Farsight uses [D3.js](https://github.com/d3/d3) to implement the interactive tree visualization. The relevant AI incidents are from the [AI Incident Database](https://incidentdatabase.ai/), and the harm category is from the [sociotechnical harm taxonomy](https://arxiv.org/abs/2210.05791). The computational notebook support is enabled by [NOVA](https://github.com/poloclub/nova).\n\n## Credits\n\nLed by \u003ca href='https://zijie.wang/' target='_blank'\u003eJay Wang\u003c/a\u003e, Farsight is a result of a collaboration between researchers from Google Research, Georgia Tech, eBay, and Emory University. Farsight is created by \u003ca href='https://zijie.wang/' target='_blank'\u003eJay Wang\u003c/a\u003e, \u003ca href='https://www.cs.emory.edu/people/faculty/individual.php?NUM=709' target='_blank'\u003eChinmay Kulkarni\u003c/a\u003e, \u003ca href='https://research.google/people/106542/' target='_blank'\u003eLauren Wilcox\u003c/a\u003e, \u003ca href='https://research.google/people/107786' target='_blank'\u003eMike Terry\u003c/a\u003e, and \u003ca href='http://michaelmadaio.com/' target='_blank'\u003eMichael Madaio\u003c/a\u003e.\n\n## Citation\n\nTo learn more about Farsight, please read our [research paper](https://arxiv.org/abs/2402.15350) (published at [CHI 2024](https://chi2024.acm.org)).\n\n```bibtex\n@inproceedings{wangFarsightFosteringResponsible2024,\n  title = {Farsight: {{Fostering Responsible AI Awareness During AI Application Prototyping}}},\n  booktitle = {{{CHI Conference}} on {{Human Factors}} in {{Computing Systems}}},\n  author = {Wang, Zijie J. and Kulkarni, Chinmay and Wilcox, Lauren and Terry, Michael and Madaio, Michael},\n  year = {2024}\n}\n```\n\n## License\n\n- The software is available under the [Apache License 2.0](https://github.com/PAIR-code/farsight/blob/master/LICENSE).\n- The random prompts in [`public/data/random-prompts.json`](public/data/random-prompts.json`) are from [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) with a [CC0 license](https://creativecommons.org/share-your-work/public-domain/cc0/).\n\n## Contact\n\nIf you have any questions, feel free to [open an issue](https://github.com/PAIR-code/farsight/issues/new) or contact [Jay Wang](https://zijie.wang).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpair-code%2Ffarsight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpair-code%2Ffarsight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpair-code%2Ffarsight/lists"}