Skip to content

Commit 449f9b8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5519b59 of spec repo
1 parent 1225fcc commit 449f9b8

26 files changed

Lines changed: 1476 additions & 194 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 350 additions & 68 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.model.rst

Lines changed: 91 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17231,6 +17231,41 @@ datadog\_api\_client.v2.model.llm\_obs\_annotation\_schema module
1723117231
:members:
1723217232
:show-inheritance:
1723317233

17234+
datadog\_api\_client.v2.model.llm\_obs\_content\_block module
17235+
-------------------------------------------------------------
17236+
17237+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block
17238+
:members:
17239+
:show-inheritance:
17240+
17241+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_header\_level module
17242+
----------------------------------------------------------------------------
17243+
17244+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_header_level
17245+
:members:
17246+
:show-inheritance:
17247+
17248+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_llm\_obs\_trace\_interaction\_type module
17249+
-------------------------------------------------------------------------------------------------
17250+
17251+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_llm_obs_trace_interaction_type
17252+
:members:
17253+
:show-inheritance:
17254+
17255+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_time\_frame module
17256+
--------------------------------------------------------------------------
17257+
17258+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_time_frame
17259+
:members:
17260+
:show-inheritance:
17261+
17262+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_type module
17263+
-------------------------------------------------------------------
17264+
17265+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_type
17266+
:members:
17267+
:show-inheritance:
17268+
1723417269
datadog\_api\_client.v2.model.llm\_obs\_cursor\_meta module
1723517270
-----------------------------------------------------------
1723617271

@@ -17665,6 +17700,34 @@ datadog\_api\_client.v2.model.llm\_obs\_delete\_projects\_request module
1766517700
:members:
1766617701
:show-inheritance:
1766717702

17703+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_annotated\_interaction\_item module
17704+
-------------------------------------------------------------------------------------------
17705+
17706+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item
17707+
:members:
17708+
:show-inheritance:
17709+
17710+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_interaction\_item module
17711+
--------------------------------------------------------------------------------
17712+
17713+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_interaction_item
17714+
:members:
17715+
:show-inheritance:
17716+
17717+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_interaction\_response\_item module
17718+
------------------------------------------------------------------------------------------
17719+
17720+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_interaction_response_item
17721+
:members:
17722+
:show-inheritance:
17723+
17724+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_interaction\_type module
17725+
--------------------------------------------------------------------------------
17726+
17727+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_interaction_type
17728+
:members:
17729+
:show-inheritance:
17730+
1766817731
datadog\_api\_client.v2.model.llm\_obs\_event\_type module
1766917732
----------------------------------------------------------
1767017733

@@ -17812,13 +17875,6 @@ datadog\_api\_client.v2.model.llm\_obs\_experiments\_response module
1781217875
:members:
1781317876
:show-inheritance:
1781417877

17815-
datadog\_api\_client.v2.model.llm\_obs\_interaction\_type module
17816-
----------------------------------------------------------------
17817-
17818-
.. automodule:: datadog_api_client.v2.model.llm_obs_interaction_type
17819-
:members:
17820-
:show-inheritance:
17821-
1782217878
datadog\_api\_client.v2.model.llm\_obs\_label\_schema module
1782317879
------------------------------------------------------------
1782417880

@@ -17931,6 +17987,34 @@ datadog\_api\_client.v2.model.llm\_obs\_record\_type module
1793117987
:members:
1793217988
:show-inheritance:
1793317989

17990+
datadog\_api\_client.v2.model.llm\_obs\_trace\_annotated\_interaction\_item module
17991+
----------------------------------------------------------------------------------
17992+
17993+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_annotated_interaction_item
17994+
:members:
17995+
:show-inheritance:
17996+
17997+
datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_item module
17998+
-----------------------------------------------------------------------
17999+
18000+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_interaction_item
18001+
:members:
18002+
:show-inheritance:
18003+
18004+
datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_response\_item module
18005+
---------------------------------------------------------------------------------
18006+
18007+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_interaction_response_item
18008+
:members:
18009+
:show-inheritance:
18010+
18011+
datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_type module
18012+
-----------------------------------------------------------------------
18013+
18014+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_interaction_type
18015+
:members:
18016+
:show-inheritance:
18017+
1793418018
datadog\_api\_client.v2.model.log module
1793518019
----------------------------------------
1793618020

examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi
7-
from datadog_api_client.v2.model.llm_obs_annotation_queue_interaction_item import LLMObsAnnotationQueueInteractionItem
87
from datadog_api_client.v2.model.llm_obs_annotation_queue_interactions_data_attributes_request import (
98
LLMObsAnnotationQueueInteractionsDataAttributesRequest,
109
)
@@ -15,15 +14,16 @@
1514
LLMObsAnnotationQueueInteractionsRequest,
1615
)
1716
from datadog_api_client.v2.model.llm_obs_annotation_queue_interactions_type import LLMObsAnnotationQueueInteractionsType
18-
from datadog_api_client.v2.model.llm_obs_interaction_type import LLMObsInteractionType
17+
from datadog_api_client.v2.model.llm_obs_trace_interaction_item import LLMObsTraceInteractionItem
18+
from datadog_api_client.v2.model.llm_obs_trace_interaction_type import LLMObsTraceInteractionType
1919

2020
body = LLMObsAnnotationQueueInteractionsRequest(
2121
data=LLMObsAnnotationQueueInteractionsDataRequest(
2222
attributes=LLMObsAnnotationQueueInteractionsDataAttributesRequest(
2323
interactions=[
24-
LLMObsAnnotationQueueInteractionItem(
24+
LLMObsTraceInteractionItem(
2525
content_id="trace-abc-123",
26-
type=LLMObsInteractionType.TRACE,
26+
type=LLMObsTraceInteractionType.TRACE,
2727
),
2828
],
2929
),
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""
2+
Add a display_block interaction returns "Created" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.llm_observability_api import LLMObservabilityApi
7+
from datadog_api_client.v2.model.llm_obs_annotation_queue_interactions_data_attributes_request import (
8+
LLMObsAnnotationQueueInteractionsDataAttributesRequest,
9+
)
10+
from datadog_api_client.v2.model.llm_obs_annotation_queue_interactions_data_request import (
11+
LLMObsAnnotationQueueInteractionsDataRequest,
12+
)
13+
from datadog_api_client.v2.model.llm_obs_annotation_queue_interactions_request import (
14+
LLMObsAnnotationQueueInteractionsRequest,
15+
)
16+
from datadog_api_client.v2.model.llm_obs_annotation_queue_interactions_type import LLMObsAnnotationQueueInteractionsType
17+
from datadog_api_client.v2.model.llm_obs_content_block import LLMObsContentBlock
18+
from datadog_api_client.v2.model.llm_obs_content_block_type import LLMObsContentBlockType
19+
from datadog_api_client.v2.model.llm_obs_display_block_interaction_item import LLMObsDisplayBlockInteractionItem
20+
from datadog_api_client.v2.model.llm_obs_display_block_interaction_type import LLMObsDisplayBlockInteractionType
21+
22+
body = LLMObsAnnotationQueueInteractionsRequest(
23+
data=LLMObsAnnotationQueueInteractionsDataRequest(
24+
attributes=LLMObsAnnotationQueueInteractionsDataAttributesRequest(
25+
interactions=[
26+
LLMObsDisplayBlockInteractionItem(
27+
type=LLMObsDisplayBlockInteractionType.DISPLAY_BLOCK,
28+
display_block=[
29+
LLMObsContentBlock(
30+
type=LLMObsContentBlockType.MARKDOWN,
31+
content="## Triage Instructions",
32+
),
33+
],
34+
),
35+
],
36+
),
37+
type=LLMObsAnnotationQueueInteractionsType.INTERACTIONS,
38+
),
39+
)
40+
41+
configuration = Configuration()
42+
configuration.unstable_operations["create_llm_obs_annotation_queue_interactions"] = True
43+
with ApiClient(configuration) as api_client:
44+
api_instance = LLMObservabilityApi(api_client)
45+
response = api_instance.create_llm_obs_annotation_queue_interactions(queue_id="queue_id", body=body)
46+
47+
print(response)

src/datadog_api_client/v2/api/llm_observability_api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,8 +890,16 @@ def create_llm_obs_annotation_queue_interactions(
890890
) -> LLMObsAnnotationQueueInteractionsResponse:
891891
"""Add annotation queue interactions.
892892
893-
Add one or more interactions (traces or sessions) to an annotation queue.
894-
At least one interaction must be provided.
893+
Add one or more interactions to an annotation queue. At least one
894+
interaction must be provided. Each interaction has a ``type`` :
895+
896+
* ``trace`` , ``experiment_trace`` , ``session`` : ``content_id`` references the
897+
upstream entity; the server fetches the actual content.
898+
* ``display_block`` : omit ``content_id`` and provide the rendered content
899+
in ``display_block``. The server generates ``content_id`` as a
900+
deterministic hash of the block list.
901+
902+
Items of different types can be mixed in a single request.
895903
896904
:param queue_id: The ID of the LLM Observability annotation queue.
897905
:type queue_id: str

src/datadog_api_client/v2/model/llm_obs_annotated_interaction_item.py

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,55 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, TYPE_CHECKING
76

87
from datadog_api_client.model_utils import (
9-
ModelNormal,
8+
ModelComposed,
109
cached_property,
1110
)
1211

1312

14-
if TYPE_CHECKING:
15-
from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem
16-
from datadog_api_client.v2.model.llm_obs_interaction_type import LLMObsInteractionType
17-
18-
19-
class LLMObsAnnotatedInteractionItem(ModelNormal):
20-
@cached_property
21-
def openapi_types(_):
22-
from datadog_api_client.v2.model.llm_obs_annotation_item import LLMObsAnnotationItem
23-
from datadog_api_client.v2.model.llm_obs_interaction_type import LLMObsInteractionType
24-
25-
return {
26-
"annotations": ([LLMObsAnnotationItem],),
27-
"content_id": (str,),
28-
"id": (str,),
29-
"type": (LLMObsInteractionType,),
30-
}
31-
32-
attribute_map = {
33-
"annotations": "annotations",
34-
"content_id": "content_id",
35-
"id": "id",
36-
"type": "type",
37-
}
38-
39-
def __init__(
40-
self_, annotations: List[LLMObsAnnotationItem], content_id: str, id: str, type: LLMObsInteractionType, **kwargs
41-
):
13+
class LLMObsAnnotatedInteractionItem(ModelComposed):
14+
def __init__(self, **kwargs):
4215
"""
4316
An interaction with its associated annotations.
4417
4518
:param annotations: List of annotations for this interaction.
4619
:type annotations: [LLMObsAnnotationItem]
4720
48-
:param content_id: Identifier of the content (trace ID or session ID) for this interaction.
21+
:param content_id: Upstream entity identifier supplied by the caller.
4922
:type content_id: str
5023
5124
:param id: Unique identifier of the interaction.
5225
:type id: str
5326
54-
:param type: Type of interaction in an annotation queue.
55-
:type type: LLMObsInteractionType
27+
:param type: Type of an upstream-entity interaction.
28+
:type type: LLMObsTraceInteractionType
29+
30+
:param display_block: List of content blocks that make up a `display_block` interaction.
31+
Must contain at least one block.
32+
:type display_block: [LLMObsContentBlock]
5633
"""
5734
super().__init__(kwargs)
5835

59-
self_.annotations = annotations
60-
self_.content_id = content_id
61-
self_.id = id
62-
self_.type = type
36+
@cached_property
37+
def _composed_schemas(_):
38+
# we need this here to make our import statements work
39+
# we must store _composed_schemas in here so the code is only run
40+
# when we invoke this method. If we kept this at the class
41+
# level we would get an error because the class level
42+
# code would be run when this module is imported, and these composed
43+
# classes don't exist yet because their module has not finished
44+
# loading
45+
from datadog_api_client.v2.model.llm_obs_trace_annotated_interaction_item import (
46+
LLMObsTraceAnnotatedInteractionItem,
47+
)
48+
from datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item import (
49+
LLMObsDisplayBlockAnnotatedInteractionItem,
50+
)
51+
52+
return {
53+
"oneOf": [
54+
LLMObsTraceAnnotatedInteractionItem,
55+
LLMObsDisplayBlockAnnotatedInteractionItem,
56+
],
57+
}

src/datadog_api_client/v2/model/llm_obs_annotated_interactions_data_attributes_response.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -13,6 +13,10 @@
1313

1414
if TYPE_CHECKING:
1515
from datadog_api_client.v2.model.llm_obs_annotated_interaction_item import LLMObsAnnotatedInteractionItem
16+
from datadog_api_client.v2.model.llm_obs_trace_annotated_interaction_item import LLMObsTraceAnnotatedInteractionItem
17+
from datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item import (
18+
LLMObsDisplayBlockAnnotatedInteractionItem,
19+
)
1620

1721

1822
class LLMObsAnnotatedInteractionsDataAttributesResponse(ModelNormal):
@@ -28,7 +32,17 @@ def openapi_types(_):
2832
"annotated_interactions": "annotated_interactions",
2933
}
3034

31-
def __init__(self_, annotated_interactions: List[LLMObsAnnotatedInteractionItem], **kwargs):
35+
def __init__(
36+
self_,
37+
annotated_interactions: List[
38+
Union[
39+
LLMObsAnnotatedInteractionItem,
40+
LLMObsTraceAnnotatedInteractionItem,
41+
LLMObsDisplayBlockAnnotatedInteractionItem,
42+
]
43+
],
44+
**kwargs,
45+
):
3246
"""
3347
Attributes containing the list of annotated interactions.
3448

0 commit comments

Comments
 (0)