Skip to content

Commit bdad242

Browse files
committed
updated safety header name
1 parent 3bd5480 commit bdad242

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/guardrails/_openai_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import Any
77

88
SAFETY_IDENTIFIER_HEADER = "OpenAI-Safety-Identifier"
9-
SAFETY_IDENTIFIER_VALUE = "oaig"
9+
SAFETY_IDENTIFIER_VALUE = "oai_guardrails"
1010

1111

1212
def ensure_safety_identifier_header(default_headers: Mapping[str, str] | None) -> dict[str, str]:

tests/unit/checks/test_urls.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def test_detect_urls_deduplicates_scheme_and_domain() -> None:
1717
"""Ensure detection removes trailing punctuation and avoids duplicate domains."""
18-
text = "Visit https://example.com/, http://example.com/path, " "example.com should not duplicate, and 192.168.1.10:8080."
18+
text = "Visit https://example.com/, http://example.com/path, example.com should not duplicate, and 192.168.1.10:8080."
1919
detected = _detect_urls(text)
2020

2121
assert "https://example.com/" in detected # noqa: S101
@@ -66,11 +66,7 @@ async def test_urls_guardrail_reports_allowed_and_blocked() -> None:
6666
block_userinfo=True,
6767
allow_subdomains=False,
6868
)
69-
text = (
70-
"Inline data URI data:text/plain;base64,QUJD. "
71-
"Use https://example.com/docs. "
72-
"Avoid http://attacker.com/login and https://sub.example.com."
73-
)
69+
text = "Inline data URI data:text/plain;base64,QUJD. Use https://example.com/docs. Avoid http://attacker.com/login and https://sub.example.com."
7470

7571
result = await urls(ctx=None, data=text, config=config)
7672

tests/unit/test_runtime.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""Tests for the runtime module."""
22

3+
import sys
4+
import types
5+
from collections.abc import Iterator
36
from dataclasses import dataclass
47
from typing import Any, Protocol
58

0 commit comments

Comments
 (0)