Skip to content

Commit 6561b44

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6b61c2a of spec repo
1 parent 576db50 commit 6561b44

4 files changed

Lines changed: 79 additions & 0 deletions

File tree

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,6 +3086,14 @@ components:
30863086
properties:
30873087
action:
30883088
$ref: "#/components/schemas/AIGuardAction"
3089+
extra_tags:
3090+
description: |-
3091+
The span tags that tracers should add to the `ai_guard` span. Each item contains a
3092+
backend-defined key and value, and clients should not assume a fixed set of keys.
3093+
Example keys include `ai_guard.evaluate_id` and `ai_guard.evaluation_context`.
3094+
items:
3095+
$ref: "#/components/schemas/AIGuardExtraTag"
3096+
type: array
30893097
global_prob:
30903098
description: The global threat probability, between `0` and `1`. Included only when computed.
30913099
example: 0.005218505859375
@@ -3212,6 +3220,21 @@ components:
32123220
type: string
32133221
x-enum-varnames:
32143222
- EVALUATIONS
3223+
AIGuardExtraTag:
3224+
description: A span tag for tracers to add to the `ai_guard` span.
3225+
properties:
3226+
key:
3227+
description: The span tag key.
3228+
example: ai_guard.evaluate_id
3229+
type: string
3230+
value:
3231+
description: The span tag value.
3232+
example: a76a703c-324f-42ed-af33-9b17d65e28af
3233+
type: string
3234+
required:
3235+
- key
3236+
- value
3237+
type: object
32153238
AIGuardGlobalConfidenceThreshold:
32163239
description: The global confidence threshold applied to every threat category.
32173240
example: 0.8
@@ -157058,6 +157081,9 @@ paths:
157058157081
data:
157059157082
attributes:
157060157083
action: ALLOW
157084+
extra_tags:
157085+
- key: ai_guard.evaluate_id
157086+
value: a76a703c-324f-42ed-af33-9b17d65e28af
157061157087
global_prob: 0.005218505859375
157062157088
is_blocking_enabled: false
157063157089
reason: No rule match.

‎src/datadog_api_client/v2/model/ai_guard_evaluate_attributes_response.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
if TYPE_CHECKING:
1818
from datadog_api_client.v2.model.ai_guard_action import AIGuardAction
19+
from datadog_api_client.v2.model.ai_guard_extra_tag import AIGuardExtraTag
1920
from datadog_api_client.v2.model.ai_guard_redaction_replacement import AIGuardRedactionReplacement
2021
from datadog_api_client.v2.model.ai_guard_scfw_findings import AIGuardScfwFindings
2122
from datadog_api_client.v2.model.ai_guard_sds_finding import AIGuardSdsFinding
@@ -25,12 +26,14 @@ class AIGuardEvaluateAttributesResponse(ModelNormal):
2526
@cached_property
2627
def openapi_types(_):
2728
from datadog_api_client.v2.model.ai_guard_action import AIGuardAction
29+
from datadog_api_client.v2.model.ai_guard_extra_tag import AIGuardExtraTag
2830
from datadog_api_client.v2.model.ai_guard_redaction_replacement import AIGuardRedactionReplacement
2931
from datadog_api_client.v2.model.ai_guard_scfw_findings import AIGuardScfwFindings
3032
from datadog_api_client.v2.model.ai_guard_sds_finding import AIGuardSdsFinding
3133

3234
return {
3335
"action": (AIGuardAction,),
36+
"extra_tags": ([AIGuardExtraTag],),
3437
"global_prob": (float,),
3538
"is_blocking_enabled": (bool,),
3639
"reason": (str,),
@@ -43,6 +46,7 @@ def openapi_types(_):
4346

4447
attribute_map = {
4548
"action": "action",
49+
"extra_tags": "extra_tags",
4650
"global_prob": "global_prob",
4751
"is_blocking_enabled": "is_blocking_enabled",
4852
"reason": "reason",
@@ -60,6 +64,7 @@ def __init__(
6064
reason: str,
6165
tag_probs: Union[Dict[str, float], none_type],
6266
tags: List[str],
67+
extra_tags: Union[List[AIGuardExtraTag], UnsetType] = unset,
6368
global_prob: Union[float, UnsetType] = unset,
6469
redaction_replacements: Union[List[AIGuardRedactionReplacement], UnsetType] = unset,
6570
scfw_findings: Union[AIGuardScfwFindings, UnsetType] = unset,
@@ -72,6 +77,11 @@ def __init__(
7277
:param action: The recommended action for the evaluated conversation.
7378
:type action: AIGuardAction
7479
80+
:param extra_tags: The span tags that tracers should add to the ``ai_guard`` span. Each item contains a
81+
backend-defined key and value, and clients should not assume a fixed set of keys.
82+
Example keys include ``ai_guard.evaluate_id`` and ``ai_guard.evaluation_context``.
83+
:type extra_tags: [AIGuardExtraTag], optional
84+
7585
:param global_prob: The global threat probability, between ``0`` and ``1``. Included only when computed.
7686
:type global_prob: float, optional
7787
@@ -110,6 +120,8 @@ def __init__(
110120
:param tags: The threat tags detected in the conversation.
111121
:type tags: [str]
112122
"""
123+
if extra_tags is not unset:
124+
kwargs["extra_tags"] = extra_tags
113125
if global_prob is not unset:
114126
kwargs["global_prob"] = global_prob
115127
if redaction_replacements is not unset:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelNormal,
9+
cached_property,
10+
)
11+
12+
13+
class AIGuardExtraTag(ModelNormal):
14+
@cached_property
15+
def openapi_types(_):
16+
return {
17+
"key": (str,),
18+
"value": (str,),
19+
}
20+
21+
attribute_map = {
22+
"key": "key",
23+
"value": "value",
24+
}
25+
26+
def __init__(self_, key: str, value: str, **kwargs):
27+
"""
28+
A span tag for tracers to add to the ``ai_guard`` span.
29+
30+
:param key: The span tag key.
31+
:type key: str
32+
33+
:param value: The span tag value.
34+
:type value: str
35+
"""
36+
super().__init__(kwargs)
37+
38+
self_.key = key
39+
self_.value = value

‎src/datadog_api_client/v2/models/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from datadog_api_client.v2.model.ai_guard_evaluate_request_data_attributes import AIGuardEvaluateRequestDataAttributes
1111
from datadog_api_client.v2.model.ai_guard_evaluate_response import AIGuardEvaluateResponse
1212
from datadog_api_client.v2.model.ai_guard_evaluation_type import AIGuardEvaluationType
13+
from datadog_api_client.v2.model.ai_guard_extra_tag import AIGuardExtraTag
1314
from datadog_api_client.v2.model.ai_guard_image_url import AIGuardImageURL
1415
from datadog_api_client.v2.model.ai_guard_message import AIGuardMessage
1516
from datadog_api_client.v2.model.ai_guard_message_content import AIGuardMessageContent
@@ -13880,6 +13881,7 @@
1388013881
"AIGuardEvaluateRequestDataAttributes",
1388113882
"AIGuardEvaluateResponse",
1388213883
"AIGuardEvaluationType",
13884+
"AIGuardExtraTag",
1388313885
"AIGuardImageURL",
1388413886
"AIGuardMessage",
1388513887
"AIGuardMessageContent",

0 commit comments

Comments
 (0)