Skip to content

Commit e23034a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI for LLM Observability dataset draft state and versions (#4132)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent b3ad3a9 commit e23034a

19 files changed

Lines changed: 2324 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 439 additions & 0 deletions
Large diffs are not rendered by default.

api/datadog/configuration.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,18 +693,22 @@ func NewConfiguration() *Configuration {
693693
"v2.GetLLMObsAnnotatedInteractionsByTraceIDs": false,
694694
"v2.GetLLMObsAnnotationQueueLabelSchema": false,
695695
"v2.GetLLMObsCustomEvalConfig": false,
696+
"v2.GetLLMObsDatasetDraftState": false,
696697
"v2.ListLLMObsAnnotationQueues": false,
697698
"v2.ListLLMObsDatasetRecords": false,
698699
"v2.ListLLMObsDatasets": false,
700+
"v2.ListLLMObsDatasetVersions": false,
699701
"v2.ListLLMObsExperimentEvents": false,
700702
"v2.ListLLMObsExperiments": false,
701703
"v2.ListLLMObsIntegrationAccounts": false,
702704
"v2.ListLLMObsIntegrationModels": false,
703705
"v2.ListLLMObsProjects": false,
704706
"v2.ListLLMObsSpans": false,
707+
"v2.LockLLMObsDatasetDraftState": false,
705708
"v2.SearchLLMObsExperimentation": false,
706709
"v2.SearchLLMObsSpans": false,
707710
"v2.SimpleSearchLLMObsExperimentation": false,
711+
"v2.UnlockLLMObsDatasetDraftState": false,
708712
"v2.UpdateLLMObsAnnotationQueue": false,
709713
"v2.UpdateLLMObsAnnotationQueueLabelSchema": false,
710714
"v2.UpdateLLMObsCustomEvalConfig": false,

api/datadogV2/api_llm_observability.go

Lines changed: 378 additions & 0 deletions
Large diffs are not rendered by default.

api/datadogV2/doc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,18 +542,22 @@
542542
// - [LLMObservabilityApi.GetLLMObsAnnotatedInteractionsByTraceIDs]
543543
// - [LLMObservabilityApi.GetLLMObsAnnotationQueueLabelSchema]
544544
// - [LLMObservabilityApi.GetLLMObsCustomEvalConfig]
545+
// - [LLMObservabilityApi.GetLLMObsDatasetDraftState]
545546
// - [LLMObservabilityApi.ListLLMObsAnnotationQueues]
546547
// - [LLMObservabilityApi.ListLLMObsDatasetRecords]
548+
// - [LLMObservabilityApi.ListLLMObsDatasetVersions]
547549
// - [LLMObservabilityApi.ListLLMObsDatasets]
548550
// - [LLMObservabilityApi.ListLLMObsExperimentEvents]
549551
// - [LLMObservabilityApi.ListLLMObsExperiments]
550552
// - [LLMObservabilityApi.ListLLMObsIntegrationAccounts]
551553
// - [LLMObservabilityApi.ListLLMObsIntegrationModels]
552554
// - [LLMObservabilityApi.ListLLMObsProjects]
553555
// - [LLMObservabilityApi.ListLLMObsSpans]
556+
// - [LLMObservabilityApi.LockLLMObsDatasetDraftState]
554557
// - [LLMObservabilityApi.SearchLLMObsExperimentation]
555558
// - [LLMObservabilityApi.SearchLLMObsSpans]
556559
// - [LLMObservabilityApi.SimpleSearchLLMObsExperimentation]
560+
// - [LLMObservabilityApi.UnlockLLMObsDatasetDraftState]
557561
// - [LLMObservabilityApi.UpdateLLMObsAnnotationQueue]
558562
// - [LLMObservabilityApi.UpdateLLMObsAnnotationQueueLabelSchema]
559563
// - [LLMObservabilityApi.UpdateLLMObsCustomEvalConfig]
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// LLMObsDatasetDraftStateData Data object for an LLM Observability dataset draft state.
14+
type LLMObsDatasetDraftStateData struct {
15+
// Attributes of an LLM Observability dataset draft state.
16+
Attributes LLMObsDatasetDraftStateDataAttributes `json:"attributes"`
17+
// Unique identifier of the dataset draft state. Matches the dataset ID.
18+
Id string `json:"id"`
19+
// Resource type of an LLM Observability dataset draft state.
20+
Type LLMObsDatasetDraftStateType `json:"type"`
21+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
22+
UnparsedObject map[string]interface{} `json:"-"`
23+
AdditionalProperties map[string]interface{} `json:"-"`
24+
}
25+
26+
// NewLLMObsDatasetDraftStateData instantiates a new LLMObsDatasetDraftStateData object.
27+
// This constructor will assign default values to properties that have it defined,
28+
// and makes sure properties required by API are set, but the set of arguments
29+
// will change when the set of required properties is changed.
30+
func NewLLMObsDatasetDraftStateData(attributes LLMObsDatasetDraftStateDataAttributes, id string, typeVar LLMObsDatasetDraftStateType) *LLMObsDatasetDraftStateData {
31+
this := LLMObsDatasetDraftStateData{}
32+
this.Attributes = attributes
33+
this.Id = id
34+
this.Type = typeVar
35+
return &this
36+
}
37+
38+
// NewLLMObsDatasetDraftStateDataWithDefaults instantiates a new LLMObsDatasetDraftStateData object.
39+
// This constructor will only assign default values to properties that have it defined,
40+
// but it doesn't guarantee that properties required by API are set.
41+
func NewLLMObsDatasetDraftStateDataWithDefaults() *LLMObsDatasetDraftStateData {
42+
this := LLMObsDatasetDraftStateData{}
43+
return &this
44+
}
45+
46+
// GetAttributes returns the Attributes field value.
47+
func (o *LLMObsDatasetDraftStateData) GetAttributes() LLMObsDatasetDraftStateDataAttributes {
48+
if o == nil {
49+
var ret LLMObsDatasetDraftStateDataAttributes
50+
return ret
51+
}
52+
return o.Attributes
53+
}
54+
55+
// GetAttributesOk returns a tuple with the Attributes field value
56+
// and a boolean to check if the value has been set.
57+
func (o *LLMObsDatasetDraftStateData) GetAttributesOk() (*LLMObsDatasetDraftStateDataAttributes, bool) {
58+
if o == nil {
59+
return nil, false
60+
}
61+
return &o.Attributes, true
62+
}
63+
64+
// SetAttributes sets field value.
65+
func (o *LLMObsDatasetDraftStateData) SetAttributes(v LLMObsDatasetDraftStateDataAttributes) {
66+
o.Attributes = v
67+
}
68+
69+
// GetId returns the Id field value.
70+
func (o *LLMObsDatasetDraftStateData) GetId() string {
71+
if o == nil {
72+
var ret string
73+
return ret
74+
}
75+
return o.Id
76+
}
77+
78+
// GetIdOk returns a tuple with the Id field value
79+
// and a boolean to check if the value has been set.
80+
func (o *LLMObsDatasetDraftStateData) GetIdOk() (*string, bool) {
81+
if o == nil {
82+
return nil, false
83+
}
84+
return &o.Id, true
85+
}
86+
87+
// SetId sets field value.
88+
func (o *LLMObsDatasetDraftStateData) SetId(v string) {
89+
o.Id = v
90+
}
91+
92+
// GetType returns the Type field value.
93+
func (o *LLMObsDatasetDraftStateData) GetType() LLMObsDatasetDraftStateType {
94+
if o == nil {
95+
var ret LLMObsDatasetDraftStateType
96+
return ret
97+
}
98+
return o.Type
99+
}
100+
101+
// GetTypeOk returns a tuple with the Type field value
102+
// and a boolean to check if the value has been set.
103+
func (o *LLMObsDatasetDraftStateData) GetTypeOk() (*LLMObsDatasetDraftStateType, bool) {
104+
if o == nil {
105+
return nil, false
106+
}
107+
return &o.Type, true
108+
}
109+
110+
// SetType sets field value.
111+
func (o *LLMObsDatasetDraftStateData) SetType(v LLMObsDatasetDraftStateType) {
112+
o.Type = v
113+
}
114+
115+
// MarshalJSON serializes the struct using spec logic.
116+
func (o LLMObsDatasetDraftStateData) MarshalJSON() ([]byte, error) {
117+
toSerialize := map[string]interface{}{}
118+
if o.UnparsedObject != nil {
119+
return datadog.Marshal(o.UnparsedObject)
120+
}
121+
toSerialize["attributes"] = o.Attributes
122+
toSerialize["id"] = o.Id
123+
toSerialize["type"] = o.Type
124+
125+
for key, value := range o.AdditionalProperties {
126+
toSerialize[key] = value
127+
}
128+
return datadog.Marshal(toSerialize)
129+
}
130+
131+
// UnmarshalJSON deserializes the given payload.
132+
func (o *LLMObsDatasetDraftStateData) UnmarshalJSON(bytes []byte) (err error) {
133+
all := struct {
134+
Attributes *LLMObsDatasetDraftStateDataAttributes `json:"attributes"`
135+
Id *string `json:"id"`
136+
Type *LLMObsDatasetDraftStateType `json:"type"`
137+
}{}
138+
if err = datadog.Unmarshal(bytes, &all); err != nil {
139+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
140+
}
141+
if all.Attributes == nil {
142+
return fmt.Errorf("required field attributes missing")
143+
}
144+
if all.Id == nil {
145+
return fmt.Errorf("required field id missing")
146+
}
147+
if all.Type == nil {
148+
return fmt.Errorf("required field type missing")
149+
}
150+
additionalProperties := make(map[string]interface{})
151+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
152+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
153+
} else {
154+
return err
155+
}
156+
157+
hasInvalidField := false
158+
if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
159+
hasInvalidField = true
160+
}
161+
o.Attributes = *all.Attributes
162+
o.Id = *all.Id
163+
if !all.Type.IsValid() {
164+
hasInvalidField = true
165+
} else {
166+
o.Type = *all.Type
167+
}
168+
169+
if len(additionalProperties) > 0 {
170+
o.AdditionalProperties = additionalProperties
171+
}
172+
173+
if hasInvalidField {
174+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
175+
}
176+
177+
return nil
178+
}
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
"time"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
)
13+
14+
// LLMObsDatasetDraftStateDataAttributes Attributes of an LLM Observability dataset draft state.
15+
type LLMObsDatasetDraftStateDataAttributes struct {
16+
// Timestamp when the dataset draft session started.
17+
DraftingSince time.Time `json:"drafting_since"`
18+
// User information associated with a dataset draft state.
19+
User LLMObsDatasetDraftStateUser `json:"user"`
20+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
21+
UnparsedObject map[string]interface{} `json:"-"`
22+
AdditionalProperties map[string]interface{} `json:"-"`
23+
}
24+
25+
// NewLLMObsDatasetDraftStateDataAttributes instantiates a new LLMObsDatasetDraftStateDataAttributes object.
26+
// This constructor will assign default values to properties that have it defined,
27+
// and makes sure properties required by API are set, but the set of arguments
28+
// will change when the set of required properties is changed.
29+
func NewLLMObsDatasetDraftStateDataAttributes(draftingSince time.Time, user LLMObsDatasetDraftStateUser) *LLMObsDatasetDraftStateDataAttributes {
30+
this := LLMObsDatasetDraftStateDataAttributes{}
31+
this.DraftingSince = draftingSince
32+
this.User = user
33+
return &this
34+
}
35+
36+
// NewLLMObsDatasetDraftStateDataAttributesWithDefaults instantiates a new LLMObsDatasetDraftStateDataAttributes object.
37+
// This constructor will only assign default values to properties that have it defined,
38+
// but it doesn't guarantee that properties required by API are set.
39+
func NewLLMObsDatasetDraftStateDataAttributesWithDefaults() *LLMObsDatasetDraftStateDataAttributes {
40+
this := LLMObsDatasetDraftStateDataAttributes{}
41+
return &this
42+
}
43+
44+
// GetDraftingSince returns the DraftingSince field value.
45+
func (o *LLMObsDatasetDraftStateDataAttributes) GetDraftingSince() time.Time {
46+
if o == nil {
47+
var ret time.Time
48+
return ret
49+
}
50+
return o.DraftingSince
51+
}
52+
53+
// GetDraftingSinceOk returns a tuple with the DraftingSince field value
54+
// and a boolean to check if the value has been set.
55+
func (o *LLMObsDatasetDraftStateDataAttributes) GetDraftingSinceOk() (*time.Time, bool) {
56+
if o == nil {
57+
return nil, false
58+
}
59+
return &o.DraftingSince, true
60+
}
61+
62+
// SetDraftingSince sets field value.
63+
func (o *LLMObsDatasetDraftStateDataAttributes) SetDraftingSince(v time.Time) {
64+
o.DraftingSince = v
65+
}
66+
67+
// GetUser returns the User field value.
68+
func (o *LLMObsDatasetDraftStateDataAttributes) GetUser() LLMObsDatasetDraftStateUser {
69+
if o == nil {
70+
var ret LLMObsDatasetDraftStateUser
71+
return ret
72+
}
73+
return o.User
74+
}
75+
76+
// GetUserOk returns a tuple with the User field value
77+
// and a boolean to check if the value has been set.
78+
func (o *LLMObsDatasetDraftStateDataAttributes) GetUserOk() (*LLMObsDatasetDraftStateUser, bool) {
79+
if o == nil {
80+
return nil, false
81+
}
82+
return &o.User, true
83+
}
84+
85+
// SetUser sets field value.
86+
func (o *LLMObsDatasetDraftStateDataAttributes) SetUser(v LLMObsDatasetDraftStateUser) {
87+
o.User = v
88+
}
89+
90+
// MarshalJSON serializes the struct using spec logic.
91+
func (o LLMObsDatasetDraftStateDataAttributes) MarshalJSON() ([]byte, error) {
92+
toSerialize := map[string]interface{}{}
93+
if o.UnparsedObject != nil {
94+
return datadog.Marshal(o.UnparsedObject)
95+
}
96+
if o.DraftingSince.Nanosecond() == 0 {
97+
toSerialize["drafting_since"] = o.DraftingSince.Format("2006-01-02T15:04:05Z07:00")
98+
} else {
99+
toSerialize["drafting_since"] = o.DraftingSince.Format("2006-01-02T15:04:05.000Z07:00")
100+
}
101+
toSerialize["user"] = o.User
102+
103+
for key, value := range o.AdditionalProperties {
104+
toSerialize[key] = value
105+
}
106+
return datadog.Marshal(toSerialize)
107+
}
108+
109+
// UnmarshalJSON deserializes the given payload.
110+
func (o *LLMObsDatasetDraftStateDataAttributes) UnmarshalJSON(bytes []byte) (err error) {
111+
all := struct {
112+
DraftingSince *time.Time `json:"drafting_since"`
113+
User *LLMObsDatasetDraftStateUser `json:"user"`
114+
}{}
115+
if err = datadog.Unmarshal(bytes, &all); err != nil {
116+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
117+
}
118+
if all.DraftingSince == nil {
119+
return fmt.Errorf("required field drafting_since missing")
120+
}
121+
if all.User == nil {
122+
return fmt.Errorf("required field user missing")
123+
}
124+
additionalProperties := make(map[string]interface{})
125+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
126+
datadog.DeleteKeys(additionalProperties, &[]string{"drafting_since", "user"})
127+
} else {
128+
return err
129+
}
130+
131+
hasInvalidField := false
132+
o.DraftingSince = *all.DraftingSince
133+
if all.User.UnparsedObject != nil && o.UnparsedObject == nil {
134+
hasInvalidField = true
135+
}
136+
o.User = *all.User
137+
138+
if len(additionalProperties) > 0 {
139+
o.AdditionalProperties = additionalProperties
140+
}
141+
142+
if hasInvalidField {
143+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
144+
}
145+
146+
return nil
147+
}

0 commit comments

Comments
 (0)