Skip to content

Commit d9f3105

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c429f9e of spec repo
1 parent 5c6f8ac commit d9f3105

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
@@ -17574,6 +17574,41 @@ datadog\_api\_client.v2.model.llm\_obs\_annotation\_schema module
1757417574
:members:
1757517575
:show-inheritance:
1757617576

17577+
datadog\_api\_client.v2.model.llm\_obs\_content\_block module
17578+
-------------------------------------------------------------
17579+
17580+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block
17581+
:members:
17582+
:show-inheritance:
17583+
17584+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_header\_level module
17585+
----------------------------------------------------------------------------
17586+
17587+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_header_level
17588+
:members:
17589+
:show-inheritance:
17590+
17591+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_llm\_obs\_trace\_interaction\_type module
17592+
-------------------------------------------------------------------------------------------------
17593+
17594+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_llm_obs_trace_interaction_type
17595+
:members:
17596+
:show-inheritance:
17597+
17598+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_time\_frame module
17599+
--------------------------------------------------------------------------
17600+
17601+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_time_frame
17602+
:members:
17603+
:show-inheritance:
17604+
17605+
datadog\_api\_client.v2.model.llm\_obs\_content\_block\_type module
17606+
-------------------------------------------------------------------
17607+
17608+
.. automodule:: datadog_api_client.v2.model.llm_obs_content_block_type
17609+
:members:
17610+
:show-inheritance:
17611+
1757717612
datadog\_api\_client.v2.model.llm\_obs\_cursor\_meta module
1757817613
-----------------------------------------------------------
1757917614

@@ -18008,6 +18043,34 @@ datadog\_api\_client.v2.model.llm\_obs\_delete\_projects\_request module
1800818043
:members:
1800918044
:show-inheritance:
1801018045

18046+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_annotated\_interaction\_item module
18047+
-------------------------------------------------------------------------------------------
18048+
18049+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_annotated_interaction_item
18050+
:members:
18051+
:show-inheritance:
18052+
18053+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_interaction\_item module
18054+
--------------------------------------------------------------------------------
18055+
18056+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_interaction_item
18057+
:members:
18058+
:show-inheritance:
18059+
18060+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_interaction\_response\_item module
18061+
------------------------------------------------------------------------------------------
18062+
18063+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_interaction_response_item
18064+
:members:
18065+
:show-inheritance:
18066+
18067+
datadog\_api\_client.v2.model.llm\_obs\_display\_block\_interaction\_type module
18068+
--------------------------------------------------------------------------------
18069+
18070+
.. automodule:: datadog_api_client.v2.model.llm_obs_display_block_interaction_type
18071+
:members:
18072+
:show-inheritance:
18073+
1801118074
datadog\_api\_client.v2.model.llm\_obs\_event\_type module
1801218075
----------------------------------------------------------
1801318076

@@ -18155,13 +18218,6 @@ datadog\_api\_client.v2.model.llm\_obs\_experiments\_response module
1815518218
:members:
1815618219
:show-inheritance:
1815718220

18158-
datadog\_api\_client.v2.model.llm\_obs\_interaction\_type module
18159-
----------------------------------------------------------------
18160-
18161-
.. automodule:: datadog_api_client.v2.model.llm_obs_interaction_type
18162-
:members:
18163-
:show-inheritance:
18164-
1816518221
datadog\_api\_client.v2.model.llm\_obs\_label\_schema module
1816618222
------------------------------------------------------------
1816718223

@@ -18274,6 +18330,34 @@ datadog\_api\_client.v2.model.llm\_obs\_record\_type module
1827418330
:members:
1827518331
:show-inheritance:
1827618332

18333+
datadog\_api\_client.v2.model.llm\_obs\_trace\_annotated\_interaction\_item module
18334+
----------------------------------------------------------------------------------
18335+
18336+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_annotated_interaction_item
18337+
:members:
18338+
:show-inheritance:
18339+
18340+
datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_item module
18341+
-----------------------------------------------------------------------
18342+
18343+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_interaction_item
18344+
:members:
18345+
:show-inheritance:
18346+
18347+
datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_response\_item module
18348+
---------------------------------------------------------------------------------
18349+
18350+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_interaction_response_item
18351+
:members:
18352+
:show-inheritance:
18353+
18354+
datadog\_api\_client.v2.model.llm\_obs\_trace\_interaction\_type module
18355+
-----------------------------------------------------------------------
18356+
18357+
.. automodule:: datadog_api_client.v2.model.llm_obs_trace_interaction_type
18358+
:members:
18359+
:show-inheritance:
18360+
1827718361
datadog\_api\_client.v2.model.log module
1827818362
----------------------------------------
1827918363

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)