Skip to content

Commit

Permalink
links for built_in ai
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-demos-stefan-chrome-built-in-ai.md,
  • Loading branch information
onsetsu committed Nov 18, 2024
1 parent 77ec75d commit 936889c
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion demos/stefan/chrome-built-in-ai.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Chrome Built-in AI API

https://googlechromeai.devpost.com/?linkId=11071015

Sign up for Built-in AI - Early Preview Program:
https://docs.google.com/forms/d/e/1FAIpQLSfZXeiwj9KO9jMctffHPym88ln12xNWCrVkMY_u06WfSTulQg/viewform

https://developer.chrome.com/docs/ai/built-in

- Available APIs: https://developer.chrome.com/docs/ai/built-in-apis#translator_api

<script>
import {} from './chrome-built-in-ai.js';
'built-in API loaded'
Expand All @@ -11,6 +20,11 @@

## Summarizer

- Summarization API
https://docs.google.com/document/d/1Bvd6cU9VIEb7kHTAOCtmmHNAYlIZdeNmV7Oy-2CtimA/edit?tab=t.0

- Origin Trial: https://developer.chrome.com/origintrials/#/view_trial/1923599990840623105

```javascript {.summarize .snippet}
const input = `Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
Expand All @@ -36,6 +50,8 @@ enum AISummarizerLength { "short", "medium", "long" };

## Language Detection

https://developer.chrome.com/docs/ai/language-detection#use-api

```javascript {.detectScript .snippet}
const detector = await window.ai.languageDetector.create();
const results = await detector.detect('hello world');
Expand Down Expand Up @@ -74,6 +90,15 @@ detector

## Translation

Explainer: https://github.com/WICG/translation-api/blob/main/README.md

https://chromestatus.com/feature/5172811302961152

Origin Trial: https://developer.chrome.com/origintrials/#/view_trial/662592095176884225

Lang Detector API
https://chromestatus.com/feature/6494349985841152?gate=6503542490923008

```javascript {.canDetectScript .snippet}
if ('translation' in self && 'canDetect' in self.translation) {
// The Language Detector API is available.
Expand All @@ -86,7 +111,10 @@ canDetect
autoRunSnippet(this, ".canDetectScript")
</script>

## LLM
## Prompt LLM

- [Prompt API](https://docs.google.com/document/d/1VG8HIyz361zGduWgNG7R_R8Xkv0OOJ8b5C9QKeCjU0c/edit?tab=t.0)
- [Explainer](https://github.com/explainers-by-googlers/prompt-api/?tab=readme-ov-file)

```javascript {.llm-simple .snippet}

Expand Down Expand Up @@ -120,6 +148,10 @@ clonedSession.prompt("Write a shorter one");
autoRunSnippet(this, ".llm")
</script>

## Writing Assistance

https://github.com/WICG/writing-assistance-apis

## Misc.

```javascript {.userAgentScript .snippet}
Expand Down

0 comments on commit 936889c

Please sign in to comment.