db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
43 lines
1.1 KiB
Markdown
43 lines
1.1 KiB
Markdown
# Get Started with Microsoft Agent Framework Mistral AI
|
|
|
|
Please install this package:
|
|
|
|
```bash
|
|
pip install agent-framework-mistral --pre
|
|
```
|
|
|
|
and see the [README](https://github.com/microsoft/agent-framework/tree/main/python/README.md) for more information.
|
|
|
|
## Embedding Client
|
|
|
|
The `MistralEmbeddingClient` provides embedding generation using Mistral AI models.
|
|
|
|
### Quick Start
|
|
|
|
```python
|
|
from agent_framework_mistral import MistralEmbeddingClient
|
|
|
|
# Using environment variables (MISTRAL_API_KEY, MISTRAL_EMBEDDING_MODEL)
|
|
client = MistralEmbeddingClient()
|
|
|
|
# Or passing parameters directly
|
|
client = MistralEmbeddingClient(
|
|
model="mistral-embed",
|
|
api_key="your-api-key",
|
|
)
|
|
|
|
# Generate embeddings
|
|
result = await client.get_embeddings(["Hello, world!", "How are you?"])
|
|
for embedding in result:
|
|
print(f"Dimensions: {embedding.dimensions}")
|
|
print(f"Vector: {embedding.vector[:5]}...")
|
|
```
|
|
|
|
### Configuration
|
|
|
|
| Environment Variable | Description |
|
|
|---|---|
|
|
| `MISTRAL_API_KEY` | Your Mistral AI API key |
|
|
| `MISTRAL_EMBEDDING_MODEL` | Embedding model name (e.g., `mistral-embed`) |
|
|
| `MISTRAL_SERVER_URL` | Optional server URL override |
|