Skip to content

Commit 53cfeab

Browse files
merge
2 parents 9879c76 + 96a7ac8 commit 53cfeab

214 files changed

Lines changed: 5776 additions & 5745 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/test-integrations-ai.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13","3.14","3.14t"]
20+
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13","3.14","3.14t","3.15","3.15t"]
2121
os: [ubuntu-22.04]
2222
env:
2323
# 3.7 runs in the python:X.Y container; tell uv to use that system Python.
@@ -57,6 +57,10 @@ jobs:
5757
run: |
5858
set -x # print commands that are executed
5959
./scripts/runtox.sh "py${{ matrix.python-version }}-litellm"
60+
- name: Test mistral
61+
run: |
62+
set -x # print commands that are executed
63+
./scripts/runtox.sh "py${{ matrix.python-version }}-mistral"
6064
- name: Test openai-base
6165
run: |
6266
set -x # print commands that are executed

‎CHANGELOG.md‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,80 @@
11
# Changelog
22

3+
## 2.70.0
4+
5+
### New Features ✨
6+
7+
- **New integration:** Mistral AI (#4733) by @alexander-alderman-webb
8+
9+
Add the Mistral integration to your `sentry_sdk.init` call:
10+
11+
```python
12+
import sentry_sdk
13+
from sentry_sdk.integrations.mistral import MistralIntegration
14+
15+
sentry_sdk.init(
16+
dsn="...",
17+
traces_sample_rate=1.0,
18+
integrations=[
19+
MistralIntegration(),
20+
]
21+
)
22+
```
23+
24+
- **New option:** A fine-grained way to configure what data should be sent from the SDK.
25+
26+
Offers much more flexibility than `send_default_pii`, allowing you to specify what
27+
data should be collected. If `data_collection` is defined, it takes precedence over
28+
`send_default_pii`.
29+
30+
See https://docs.sentry.io/platforms/python/configuration/options/#data_collection
31+
for the available configuration options.
32+
33+
```python
34+
import sentry_sdk
35+
36+
sentry_sdk.init(
37+
data_collection={
38+
"user_info": False,
39+
"gen_ai": {"inputs": False, "outputs": False},
40+
"graphql": {"document": False, "variables": False},
41+
"database_query_data": False,
42+
"queues": False,
43+
"http_bodies": [],
44+
"cookies": {
45+
"mode": "denylist",
46+
"terms": ["forwarded", "-ip", "remote-", "via", "-user"],
47+
},
48+
"http_headers": {
49+
"request": {
50+
"mode": "denylist",
51+
"terms": ["forwarded", "-ip", "remote-", "via", "-user"],
52+
},
53+
},
54+
"url_query_params": {
55+
"mode": "denylist",
56+
"terms": ["forwarded", "-ip", "remote-", "via", "-user"],
57+
},
58+
}
59+
)
60+
```
61+
62+
#### Mistral
63+
64+
- Record `gen_ai.output.messages` by @alexander-alderman-webb in [#7549](https://github.com/getsentry/sentry-python/pull/7549)
65+
- Record `gen_ai.input.messages` by @alexander-alderman-webb in [#7548](https://github.com/getsentry/sentry-python/pull/7548)
66+
- Record `gen_ai.system_instructions` by @alexander-alderman-webb in [#7547](https://github.com/getsentry/sentry-python/pull/7547)
67+
- Record request parameters by @alexander-alderman-webb in [#7531](https://github.com/getsentry/sentry-python/pull/7531)
68+
- Record token usage by @alexander-alderman-webb in [#7529](https://github.com/getsentry/sentry-python/pull/7529)
69+
- Add integration with `Chat.complete` and `Chat.complete_async` patches by @alexander-alderman-webb in [#7528](https://github.com/getsentry/sentry-python/pull/7528)
70+
71+
### Internal Changes 🔧
72+
73+
- (data-collection) Promote `data_collection` from `_experiments` o top-level by @ericapisani in [#7560](https://github.com/getsentry/sentry-python/pull/7560)
74+
- Close client on teardown by @alexander-alderman-webb in [#7562](https://github.com/getsentry/sentry-python/pull/7562)
75+
- 🤖 Update test matrix with new releases (09/21) by @github-actions in [#7546](https://github.com/getsentry/sentry-python/pull/7546)
76+
- Remove `getsentry/testing-ai-sdk-integrations` by @alexander-alderman-webb in [#7526](https://github.com/getsentry/sentry-python/pull/7526)
77+
378
## 2.69.2
479

580
### Bug Fixes 🐛

‎docs/conf.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
3232
author = "Sentry Team and Contributors"
3333

34-
release = "2.69.2"
34+
release = "2.70.0"
3535
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3636

3737

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ typing = [
8080
"tiktoken>=0.14.0",
8181
"aiohttp>=3.14.3",
8282
"openai-agents>=0.22.0",
83+
"mistralai>=2.10.1",
8384
]
8485
test = [
8586
"dataclasses ; python_full_version < '3.7'",

‎scripts/populate_tox/config.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@
303303
"*": ["pytest-asyncio", "httpx"],
304304
},
305305
},
306+
"mistral": {
307+
"package": "mistralai",
308+
"deps": {
309+
"*": ["pytest-asyncio", "httpx"],
310+
},
311+
},
306312
"fastmcp": {
307313
"package": "fastmcp",
308314
"deps": {

‎scripts/populate_tox/package_dependencies.jsonl‎

Lines changed: 88 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/populate_tox/releases.jsonl‎

Lines changed: 17 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/populate_tox/tox.jinja‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ setenv =
200200
# which targets the workspace `.venv` instead of the tox env and hangs.
201201
ray: RAY_ENABLE_UV_RUN_RUNTIME_ENV=0
202202

203+
litellm: LITELLM_LOCAL_MODEL_COST_MAP=true
204+
203205
# Avoid polluting test suite with imports
204206
common: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
205207
gevent: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"

‎scripts/split_tox_gh_actions/split_tox_gh_actions.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"google_genai",
9393
"huggingface_hub",
9494
"litellm",
95+
"mistral",
9596
"openai-base",
9697
"openai-notiktoken",
9798
],

‎sentry_sdk/_types.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ class ToolCallPart(TypedDict):
458458
name: NotRequired[str]
459459
arguments: NotRequired[Any]
460460

461+
class InputMessage(TypedDict):
462+
role: Literal["user", "assistant", "tool"]
463+
parts: list[Union[TextPart, ReasoningPart, ToolCallPart]]
464+
465+
class OutputMessage(TypedDict):
466+
role: Literal["assistant"]
467+
parts: list[Union[TextPart, ReasoningPart]]
468+
461469
class ToolDefinition(TypedDict):
462470
type: str
463471
name: NotRequired[str]

0 commit comments

Comments
 (0)