Skip to content

Commit

Permalink
add embeddings doc
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelwt committed Feb 12, 2025
1 parent 9ec947d commit 9268eca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

## Features

- **OpenAI-compatible API 🔁** across all LLM providers
- **Lightweight & Fast ⚡**: no overhead
- **Embeddings 🧮** for semantic search and text analysis
- **OpenAI-compatible API 🔁**
- **Lightweight & Fast ⚡**
- **Embeddings support 🧮**
- **Unified tool calling 🛠️**
- **Tokenizer and cost calculation (soon) 🔢** for accurate token counting and cost estimation
- **Smart routing (soon)** to the best model for your request

Expand Down Expand Up @@ -74,6 +75,17 @@ for await (const chunk of stream) {
}
```

## Embeddings

```ts
const embeddings = await abso.embed({
model: "text-embedding-3-small",
input: ["A cat was playing with a ball on the floor"],
})

console.log(embeddings.data[0].embedding)
```

## Tokenizers (soon)

```ts
Expand Down Expand Up @@ -101,21 +113,19 @@ const result = await abso.chat.create({
```

## Ollama

```ts
import { abso } from "abso-ai";
import { abso } from "abso-ai"

const result = await abso.chat.create({
messages: [{ role: "user", content: "Hi, what's up?" }],
model: "llama3.2",
provider: "ollama",
});
})

console.log(result.choices[0].message.content);
console.log(result.choices[0].message.content)
```




## Contributing

See our [Contributing Guide](CONTRIBUTING.md).
Expand Down
7 changes: 7 additions & 0 deletions examples/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ const stream = await abso.chat.stream({
for await (const chunk of stream) {
console.log(chunk)
}

const embeddings = await abso.embed({
model: "text-embedding-3-small",
input: ["A cat was playing with a ball on the floor"],
})

console.log(embeddings.data[0].embedding)

0 comments on commit 9268eca

Please sign in to comment.