@@ -3161,13 +3161,216 @@ func (a *LLMObservabilityApi) ListLLMObsExperimentEvents(ctx _context.Context, e
31613161 return localVarReturnValue , localVarHTTPResponse , nil
31623162}
31633163
3164+ // ListLLMObsExperimentEventsV1 List LLM Observability experiment spans (v1).
3165+ // Retrieve spans with their evaluation metrics for a given experiment. Returns spans only, with no summary metrics and no pagination. Deprecated in favor of `ListLLMObsExperimentEventsV3`.
3166+ //
3167+ // Deprecated: This API is deprecated.
3168+ func (a * LLMObservabilityApi ) ListLLMObsExperimentEventsV1 (ctx _context.Context , experimentId string ) (LLMObsExperimentSpansResponse , * _nethttp.Response , error ) {
3169+ var (
3170+ localVarHTTPMethod = _nethttp .MethodGet
3171+ localVarPostBody interface {}
3172+ localVarReturnValue LLMObsExperimentSpansResponse
3173+ )
3174+
3175+ operationId := "v2.ListLLMObsExperimentEventsV1"
3176+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
3177+ if ! isOperationEnabled {
3178+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
3179+ }
3180+ if isOperationEnabled && a .Client .Cfg .Debug {
3181+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
3182+ }
3183+
3184+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.LLMObservabilityApi.ListLLMObsExperimentEventsV1" )
3185+ if err != nil {
3186+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
3187+ }
3188+
3189+ localVarPath := localBasePath + "/api/v2/llm-obs/v1/experiments/{experiment_id}/events"
3190+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{experiment_id}" , _neturl .PathEscape (datadog .ParameterToString (experimentId , "" )))
3191+
3192+ localVarHeaderParams := make (map [string ]string )
3193+ localVarQueryParams := _neturl.Values {}
3194+ localVarFormParams := _neturl.Values {}
3195+ localVarHeaderParams ["Accept" ] = "application/json"
3196+
3197+ if a .Client .Cfg .DelegatedTokenConfig != nil {
3198+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
3199+ if err != nil {
3200+ return localVarReturnValue , nil , err
3201+ }
3202+ } else {
3203+ datadog .SetAuthKeys (
3204+ ctx ,
3205+ & localVarHeaderParams ,
3206+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
3207+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
3208+ )
3209+ }
3210+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
3211+ if err != nil {
3212+ return localVarReturnValue , nil , err
3213+ }
3214+
3215+ localVarHTTPResponse , err := a .Client .CallAPI (req )
3216+ if err != nil || localVarHTTPResponse == nil {
3217+ return localVarReturnValue , localVarHTTPResponse , err
3218+ }
3219+
3220+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
3221+ if err != nil {
3222+ return localVarReturnValue , localVarHTTPResponse , err
3223+ }
3224+
3225+ if localVarHTTPResponse .StatusCode >= 300 {
3226+ newErr := datadog.GenericOpenAPIError {
3227+ ErrorBody : localVarBody ,
3228+ ErrorMessage : localVarHTTPResponse .Status ,
3229+ }
3230+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 401 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 500 {
3231+ var v JSONAPIErrorResponse
3232+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
3233+ if err != nil {
3234+ return localVarReturnValue , localVarHTTPResponse , newErr
3235+ }
3236+ newErr .ErrorModel = v
3237+ return localVarReturnValue , localVarHTTPResponse , newErr
3238+ }
3239+ if localVarHTTPResponse .StatusCode == 429 {
3240+ var v APIErrorResponse
3241+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
3242+ if err != nil {
3243+ return localVarReturnValue , localVarHTTPResponse , newErr
3244+ }
3245+ newErr .ErrorModel = v
3246+ }
3247+ return localVarReturnValue , localVarHTTPResponse , newErr
3248+ }
3249+
3250+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
3251+ if err != nil {
3252+ newErr := datadog.GenericOpenAPIError {
3253+ ErrorBody : localVarBody ,
3254+ ErrorMessage : err .Error (),
3255+ }
3256+ return localVarReturnValue , localVarHTTPResponse , newErr
3257+ }
3258+
3259+ return localVarReturnValue , localVarHTTPResponse , nil
3260+ }
3261+
3262+ // ListLLMObsExperimentEventsV2 List LLM Observability experiment events (v2).
3263+ // Retrieve spans and experiment-level summary metrics for a given experiment. Returns the full events payload without pagination. Deprecated: use `ListLLMObsExperimentEventsV3` instead.
3264+ //
3265+ // Deprecated: This API is deprecated.
3266+ func (a * LLMObservabilityApi ) ListLLMObsExperimentEventsV2 (ctx _context.Context , experimentId string ) (LLMObsExperimentEventsV2Response , * _nethttp.Response , error ) {
3267+ var (
3268+ localVarHTTPMethod = _nethttp .MethodGet
3269+ localVarPostBody interface {}
3270+ localVarReturnValue LLMObsExperimentEventsV2Response
3271+ )
3272+
3273+ operationId := "v2.ListLLMObsExperimentEventsV2"
3274+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
3275+ if ! isOperationEnabled {
3276+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
3277+ }
3278+ if isOperationEnabled && a .Client .Cfg .Debug {
3279+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
3280+ }
3281+
3282+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.LLMObservabilityApi.ListLLMObsExperimentEventsV2" )
3283+ if err != nil {
3284+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
3285+ }
3286+
3287+ localVarPath := localBasePath + "/api/v2/llm-obs/v2/experiments/{experiment_id}/events"
3288+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{experiment_id}" , _neturl .PathEscape (datadog .ParameterToString (experimentId , "" )))
3289+
3290+ localVarHeaderParams := make (map [string ]string )
3291+ localVarQueryParams := _neturl.Values {}
3292+ localVarFormParams := _neturl.Values {}
3293+ localVarHeaderParams ["Accept" ] = "application/json"
3294+
3295+ if a .Client .Cfg .DelegatedTokenConfig != nil {
3296+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
3297+ if err != nil {
3298+ return localVarReturnValue , nil , err
3299+ }
3300+ } else {
3301+ datadog .SetAuthKeys (
3302+ ctx ,
3303+ & localVarHeaderParams ,
3304+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
3305+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
3306+ )
3307+ }
3308+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
3309+ if err != nil {
3310+ return localVarReturnValue , nil , err
3311+ }
3312+
3313+ localVarHTTPResponse , err := a .Client .CallAPI (req )
3314+ if err != nil || localVarHTTPResponse == nil {
3315+ return localVarReturnValue , localVarHTTPResponse , err
3316+ }
3317+
3318+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
3319+ if err != nil {
3320+ return localVarReturnValue , localVarHTTPResponse , err
3321+ }
3322+
3323+ if localVarHTTPResponse .StatusCode >= 300 {
3324+ newErr := datadog.GenericOpenAPIError {
3325+ ErrorBody : localVarBody ,
3326+ ErrorMessage : localVarHTTPResponse .Status ,
3327+ }
3328+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 401 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 500 {
3329+ var v JSONAPIErrorResponse
3330+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
3331+ if err != nil {
3332+ return localVarReturnValue , localVarHTTPResponse , newErr
3333+ }
3334+ newErr .ErrorModel = v
3335+ return localVarReturnValue , localVarHTTPResponse , newErr
3336+ }
3337+ if localVarHTTPResponse .StatusCode == 429 {
3338+ var v APIErrorResponse
3339+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
3340+ if err != nil {
3341+ return localVarReturnValue , localVarHTTPResponse , newErr
3342+ }
3343+ newErr .ErrorModel = v
3344+ }
3345+ return localVarReturnValue , localVarHTTPResponse , newErr
3346+ }
3347+
3348+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
3349+ if err != nil {
3350+ newErr := datadog.GenericOpenAPIError {
3351+ ErrorBody : localVarBody ,
3352+ ErrorMessage : err .Error (),
3353+ }
3354+ return localVarReturnValue , localVarHTTPResponse , newErr
3355+ }
3356+
3357+ return localVarReturnValue , localVarHTTPResponse , nil
3358+ }
3359+
31643360// ListLLMObsExperimentsOptionalParameters holds optional parameters for ListLLMObsExperiments.
31653361type ListLLMObsExperimentsOptionalParameters struct {
3166- FilterProjectId * string
3167- FilterDatasetId * string
3168- FilterId * string
3169- PageCursor * string
3170- PageLimit * int64
3362+ FilterProjectId * string
3363+ FilterDatasetId * string
3364+ FilterId * string
3365+ FilterName * string
3366+ FilterExperiment * string
3367+ FilterMetadata * string
3368+ FilterParentExperimentId * string
3369+ FilterIsDeleted * bool
3370+ IncludeUserData * bool
3371+ IncludeDatasetNames * bool
3372+ PageCursor * string
3373+ PageLimit * int64
31713374}
31723375
31733376// NewListLLMObsExperimentsOptionalParameters creates an empty struct for parameters.
@@ -3194,6 +3397,48 @@ func (r *ListLLMObsExperimentsOptionalParameters) WithFilterId(filterId string)
31943397 return r
31953398}
31963399
3400+ // WithFilterName sets the corresponding parameter name and returns the struct.
3401+ func (r * ListLLMObsExperimentsOptionalParameters ) WithFilterName (filterName string ) * ListLLMObsExperimentsOptionalParameters {
3402+ r .FilterName = & filterName
3403+ return r
3404+ }
3405+
3406+ // WithFilterExperiment sets the corresponding parameter name and returns the struct.
3407+ func (r * ListLLMObsExperimentsOptionalParameters ) WithFilterExperiment (filterExperiment string ) * ListLLMObsExperimentsOptionalParameters {
3408+ r .FilterExperiment = & filterExperiment
3409+ return r
3410+ }
3411+
3412+ // WithFilterMetadata sets the corresponding parameter name and returns the struct.
3413+ func (r * ListLLMObsExperimentsOptionalParameters ) WithFilterMetadata (filterMetadata string ) * ListLLMObsExperimentsOptionalParameters {
3414+ r .FilterMetadata = & filterMetadata
3415+ return r
3416+ }
3417+
3418+ // WithFilterParentExperimentId sets the corresponding parameter name and returns the struct.
3419+ func (r * ListLLMObsExperimentsOptionalParameters ) WithFilterParentExperimentId (filterParentExperimentId string ) * ListLLMObsExperimentsOptionalParameters {
3420+ r .FilterParentExperimentId = & filterParentExperimentId
3421+ return r
3422+ }
3423+
3424+ // WithFilterIsDeleted sets the corresponding parameter name and returns the struct.
3425+ func (r * ListLLMObsExperimentsOptionalParameters ) WithFilterIsDeleted (filterIsDeleted bool ) * ListLLMObsExperimentsOptionalParameters {
3426+ r .FilterIsDeleted = & filterIsDeleted
3427+ return r
3428+ }
3429+
3430+ // WithIncludeUserData sets the corresponding parameter name and returns the struct.
3431+ func (r * ListLLMObsExperimentsOptionalParameters ) WithIncludeUserData (includeUserData bool ) * ListLLMObsExperimentsOptionalParameters {
3432+ r .IncludeUserData = & includeUserData
3433+ return r
3434+ }
3435+
3436+ // WithIncludeDatasetNames sets the corresponding parameter name and returns the struct.
3437+ func (r * ListLLMObsExperimentsOptionalParameters ) WithIncludeDatasetNames (includeDatasetNames bool ) * ListLLMObsExperimentsOptionalParameters {
3438+ r .IncludeDatasetNames = & includeDatasetNames
3439+ return r
3440+ }
3441+
31973442// WithPageCursor sets the corresponding parameter name and returns the struct.
31983443func (r * ListLLMObsExperimentsOptionalParameters ) WithPageCursor (pageCursor string ) * ListLLMObsExperimentsOptionalParameters {
31993444 r .PageCursor = & pageCursor
@@ -3251,6 +3496,27 @@ func (a *LLMObservabilityApi) ListLLMObsExperiments(ctx _context.Context, o ...L
32513496 if optionalParams .FilterId != nil {
32523497 localVarQueryParams .Add ("filter[id]" , datadog .ParameterToString (* optionalParams .FilterId , "" ))
32533498 }
3499+ if optionalParams .FilterName != nil {
3500+ localVarQueryParams .Add ("filter[name]" , datadog .ParameterToString (* optionalParams .FilterName , "" ))
3501+ }
3502+ if optionalParams .FilterExperiment != nil {
3503+ localVarQueryParams .Add ("filter[experiment]" , datadog .ParameterToString (* optionalParams .FilterExperiment , "" ))
3504+ }
3505+ if optionalParams .FilterMetadata != nil {
3506+ localVarQueryParams .Add ("filter[metadata]" , datadog .ParameterToString (* optionalParams .FilterMetadata , "" ))
3507+ }
3508+ if optionalParams .FilterParentExperimentId != nil {
3509+ localVarQueryParams .Add ("filter[parent_experiment_id]" , datadog .ParameterToString (* optionalParams .FilterParentExperimentId , "" ))
3510+ }
3511+ if optionalParams .FilterIsDeleted != nil {
3512+ localVarQueryParams .Add ("filter[is_deleted]" , datadog .ParameterToString (* optionalParams .FilterIsDeleted , "" ))
3513+ }
3514+ if optionalParams .IncludeUserData != nil {
3515+ localVarQueryParams .Add ("include[user_data]" , datadog .ParameterToString (* optionalParams .IncludeUserData , "" ))
3516+ }
3517+ if optionalParams .IncludeDatasetNames != nil {
3518+ localVarQueryParams .Add ("include[dataset_names]" , datadog .ParameterToString (* optionalParams .IncludeDatasetNames , "" ))
3519+ }
32543520 if optionalParams .PageCursor != nil {
32553521 localVarQueryParams .Add ("page[cursor]" , datadog .ParameterToString (* optionalParams .PageCursor , "" ))
32563522 }
0 commit comments