Skip to content

Commit

Permalink
docs: add embedding model docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeasonstudio committed Jul 5, 2024
1 parent d9c3ce3 commit 231f422
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ You can use the following optional settings to customize:
- **temperature** `number` (default: `0.8`)
- **topK** `number` (default: `3`)

## Embedding models
## ⭐️ Embedding models

```ts
import { chromeai } from 'chrome-ai';
import { embedMany, cosineSimilarity } from 'ai';

const { embeddings } = await embedMany({
model: chromeai.embedding(),
model: chromeai('embedding'),
values: ['sunny day at the beach', 'rainy afternoon in the city'],
});
// [[1.9545, 0.0318...], [1.8015, 0.1504...]]
Expand Down

0 comments on commit 231f422

Please sign in to comment.