Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mistral): implement instrumentation #1139

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ version_files = [
"packages/opentelemetry-instrumentation-langchain/opentelemetry/instrumentation/langchain/version.py",
"packages/opentelemetry-instrumentation-milvus/pyproject.toml:^version",
"packages/opentelemetry-instrumentation-milvus/opentelemetry/instrumentation/milvus/version.py",
"packages/opentelemetry-instrumentation-ollama/pyproject.toml:^version",
"packages/opentelemetry-instrumentation-mistralai/pyproject.toml:^version",
"packages/opentelemetry-instrumentation-mistralai/opentelemetry/instrumentation/mistralai/version.py",
"packages/opentelemetry-instrumentation-ollama/pyproject.toml:^version",
"packages/opentelemetry-instrumentation-ollama/opentelemetry/instrumentation/ollama/version.py",
"packages/opentelemetry-instrumentation-openai/pyproject.toml:^version",
"packages/opentelemetry-instrumentation-openai/opentelemetry/instrumentation/openai/version.py",
Expand Down
11 changes: 11 additions & 0 deletions packages/opentelemetry-instrumentation-mistralai/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
exclude =
.git,
__pycache__,
build,
dist,
.tox,
venv,
.venv,
.pytest_cache
max-line-length = 120
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.5
33 changes: 33 additions & 0 deletions packages/opentelemetry-instrumentation-mistralai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# OpenTelemetry Mistral AI Instrumentation

<a href="https://pypi.org/project/opentelemetry-instrumentation-mistralai/">
<img src="https://badge.fury.io/py/opentelemetry-instrumentation-mistralai.svg">
</a>

This library allows tracing calls to any of mistralai's endpoints sent with the official [Mistral AI library](https://github.com/mistralai-ai/mistralai-python).

## Installation

```bash
pip install opentelemetry-instrumentation-mistralai
```

## Example usage

```python
from opentelemetry.instrumentation.mistralai import MistralAiInstrumentor

MistralAiInstrumentor().instrument()
```

## Privacy

**By default, this instrumentation logs prompts, completions, and embeddings to span attributes**. This gives you a clear visibility into how your LLM application is working, and can make it easy to debug and evaluate the quality of the outputs.

However, you may want to disable this logging for privacy reasons, as they may contain highly sensitive data from your users. You may also simply want to reduce the size of your traces.

To disable logging, set the `TRACELOOP_TRACE_CONTENT` environment variable to `false`.

```bash
TRACELOOP_TRACE_CONTENT=false
```
Loading