@@ -19,8 +19,10 @@ import (
1919type LLMObservabilityApi datadog.Service
2020
2121// CreateLLMObsAnnotationQueue Create an LLM Observability annotation queue.
22- // Create a new annotation queue. Only `name`, `project_id`, and `description` are accepted.
23- // Fields such as `created_by`, `owned_by`, `created_at`, `modified_by`, and `modified_at` are inferred by the backend.
22+ // Create an annotation queue. The `name` and `project_id` fields are required.
23+ // An optional `annotation_schema` can be provided to define the labels for the queue.
24+ // Fields such as `created_by`, `owned_by`, `created_at`, `modified_by`,
25+ // and `modified_at` are inferred by the backend.
2426func (a * LLMObservabilityApi ) CreateLLMObsAnnotationQueue (ctx _context.Context , body LLMObsAnnotationQueueRequest ) (LLMObsAnnotationQueueResponse , * _nethttp.Response , error ) {
2527 var (
2628 localVarHTTPMethod = _nethttp .MethodPost
@@ -1413,6 +1415,102 @@ func (a *LLMObservabilityApi) GetLLMObsAnnotatedInteractions(ctx _context.Contex
14131415 return localVarReturnValue , localVarHTTPResponse , nil
14141416}
14151417
1418+ // GetLLMObsAnnotationQueueLabelSchema Get annotation queue label schema.
1419+ // Retrieve the label schema for a given annotation queue.
1420+ func (a * LLMObservabilityApi ) GetLLMObsAnnotationQueueLabelSchema (ctx _context.Context , queueId string ) (LLMObsAnnotationQueueLabelSchemaResponse , * _nethttp.Response , error ) {
1421+ var (
1422+ localVarHTTPMethod = _nethttp .MethodGet
1423+ localVarPostBody interface {}
1424+ localVarReturnValue LLMObsAnnotationQueueLabelSchemaResponse
1425+ )
1426+
1427+ operationId := "v2.GetLLMObsAnnotationQueueLabelSchema"
1428+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
1429+ if ! isOperationEnabled {
1430+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
1431+ }
1432+ if isOperationEnabled && a .Client .Cfg .Debug {
1433+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
1434+ }
1435+
1436+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.LLMObservabilityApi.GetLLMObsAnnotationQueueLabelSchema" )
1437+ if err != nil {
1438+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
1439+ }
1440+
1441+ localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/label-schema"
1442+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{queue_id}" , _neturl .PathEscape (datadog .ParameterToString (queueId , "" )))
1443+
1444+ localVarHeaderParams := make (map [string ]string )
1445+ localVarQueryParams := _neturl.Values {}
1446+ localVarFormParams := _neturl.Values {}
1447+ localVarHeaderParams ["Accept" ] = "application/json"
1448+
1449+ if a .Client .Cfg .DelegatedTokenConfig != nil {
1450+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
1451+ if err != nil {
1452+ return localVarReturnValue , nil , err
1453+ }
1454+ } else {
1455+ datadog .SetAuthKeys (
1456+ ctx ,
1457+ & localVarHeaderParams ,
1458+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
1459+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
1460+ )
1461+ }
1462+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
1463+ if err != nil {
1464+ return localVarReturnValue , nil , err
1465+ }
1466+
1467+ localVarHTTPResponse , err := a .Client .CallAPI (req )
1468+ if err != nil || localVarHTTPResponse == nil {
1469+ return localVarReturnValue , localVarHTTPResponse , err
1470+ }
1471+
1472+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
1473+ if err != nil {
1474+ return localVarReturnValue , localVarHTTPResponse , err
1475+ }
1476+
1477+ if localVarHTTPResponse .StatusCode >= 300 {
1478+ newErr := datadog.GenericOpenAPIError {
1479+ ErrorBody : localVarBody ,
1480+ ErrorMessage : localVarHTTPResponse .Status ,
1481+ }
1482+ if localVarHTTPResponse .StatusCode == 401 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 500 {
1483+ var v JSONAPIErrorResponse
1484+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1485+ if err != nil {
1486+ return localVarReturnValue , localVarHTTPResponse , newErr
1487+ }
1488+ newErr .ErrorModel = v
1489+ return localVarReturnValue , localVarHTTPResponse , newErr
1490+ }
1491+ if localVarHTTPResponse .StatusCode == 429 {
1492+ var v APIErrorResponse
1493+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1494+ if err != nil {
1495+ return localVarReturnValue , localVarHTTPResponse , newErr
1496+ }
1497+ newErr .ErrorModel = v
1498+ }
1499+ return localVarReturnValue , localVarHTTPResponse , newErr
1500+ }
1501+
1502+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1503+ if err != nil {
1504+ newErr := datadog.GenericOpenAPIError {
1505+ ErrorBody : localVarBody ,
1506+ ErrorMessage : err .Error (),
1507+ }
1508+ return localVarReturnValue , localVarHTTPResponse , newErr
1509+ }
1510+
1511+ return localVarReturnValue , localVarHTTPResponse , nil
1512+ }
1513+
14161514// GetLLMObsCustomEvalConfig Get a custom evaluator configuration.
14171515// Retrieve a custom LLM Observability evaluator configuration by its name.
14181516func (a * LLMObservabilityApi ) GetLLMObsCustomEvalConfig (ctx _context.Context , evalName string ) (LLMObsCustomEvalConfigResponse , * _nethttp.Response , error ) {
@@ -2267,7 +2365,7 @@ func (a *LLMObservabilityApi) ListLLMObsProjects(ctx _context.Context, o ...List
22672365}
22682366
22692367// UpdateLLMObsAnnotationQueue Update an LLM Observability annotation queue.
2270- // Partially update an annotation queue. Only `name` and `description` can be updated.
2368+ // Partially update an annotation queue. The `name`, `description`, and `annotation_schema` fields can be updated.
22712369func (a * LLMObservabilityApi ) UpdateLLMObsAnnotationQueue (ctx _context.Context , queueId string , body LLMObsAnnotationQueueUpdateRequest ) (LLMObsAnnotationQueueResponse , * _nethttp.Response , error ) {
22722370 var (
22732371 localVarHTTPMethod = _nethttp .MethodPatch
@@ -2365,6 +2463,108 @@ func (a *LLMObservabilityApi) UpdateLLMObsAnnotationQueue(ctx _context.Context,
23652463 return localVarReturnValue , localVarHTTPResponse , nil
23662464}
23672465
2466+ // UpdateLLMObsAnnotationQueueLabelSchema Update annotation queue label schema.
2467+ // Create or replace the label schema for a given annotation queue.
2468+ // The label schema defines the labels annotators can apply to interactions in the queue.
2469+ // Label names must be unique within the queue and match the pattern `^[a-zA-Z0-9_-]+$`.
2470+ // Each label must have a valid type: score, categorical, boolean, or text.
2471+ func (a * LLMObservabilityApi ) UpdateLLMObsAnnotationQueueLabelSchema (ctx _context.Context , queueId string , body LLMObsAnnotationQueueLabelSchemaUpdateRequest ) (LLMObsAnnotationQueueLabelSchemaResponse , * _nethttp.Response , error ) {
2472+ var (
2473+ localVarHTTPMethod = _nethttp .MethodPut
2474+ localVarPostBody interface {}
2475+ localVarReturnValue LLMObsAnnotationQueueLabelSchemaResponse
2476+ )
2477+
2478+ operationId := "v2.UpdateLLMObsAnnotationQueueLabelSchema"
2479+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
2480+ if ! isOperationEnabled {
2481+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
2482+ }
2483+ if isOperationEnabled && a .Client .Cfg .Debug {
2484+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
2485+ }
2486+
2487+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.LLMObservabilityApi.UpdateLLMObsAnnotationQueueLabelSchema" )
2488+ if err != nil {
2489+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
2490+ }
2491+
2492+ localVarPath := localBasePath + "/api/v2/llm-obs/v1/annotation-queues/{queue_id}/label-schema"
2493+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{queue_id}" , _neturl .PathEscape (datadog .ParameterToString (queueId , "" )))
2494+
2495+ localVarHeaderParams := make (map [string ]string )
2496+ localVarQueryParams := _neturl.Values {}
2497+ localVarFormParams := _neturl.Values {}
2498+ localVarHeaderParams ["Content-Type" ] = "application/json"
2499+ localVarHeaderParams ["Accept" ] = "application/json"
2500+
2501+ // body params
2502+ localVarPostBody = & body
2503+ if a .Client .Cfg .DelegatedTokenConfig != nil {
2504+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
2505+ if err != nil {
2506+ return localVarReturnValue , nil , err
2507+ }
2508+ } else {
2509+ datadog .SetAuthKeys (
2510+ ctx ,
2511+ & localVarHeaderParams ,
2512+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
2513+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
2514+ )
2515+ }
2516+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
2517+ if err != nil {
2518+ return localVarReturnValue , nil , err
2519+ }
2520+
2521+ localVarHTTPResponse , err := a .Client .CallAPI (req )
2522+ if err != nil || localVarHTTPResponse == nil {
2523+ return localVarReturnValue , localVarHTTPResponse , err
2524+ }
2525+
2526+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
2527+ if err != nil {
2528+ return localVarReturnValue , localVarHTTPResponse , err
2529+ }
2530+
2531+ if localVarHTTPResponse .StatusCode >= 300 {
2532+ newErr := datadog.GenericOpenAPIError {
2533+ ErrorBody : localVarBody ,
2534+ ErrorMessage : localVarHTTPResponse .Status ,
2535+ }
2536+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 401 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 500 {
2537+ var v JSONAPIErrorResponse
2538+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
2539+ if err != nil {
2540+ return localVarReturnValue , localVarHTTPResponse , newErr
2541+ }
2542+ newErr .ErrorModel = v
2543+ return localVarReturnValue , localVarHTTPResponse , newErr
2544+ }
2545+ if localVarHTTPResponse .StatusCode == 429 {
2546+ var v APIErrorResponse
2547+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
2548+ if err != nil {
2549+ return localVarReturnValue , localVarHTTPResponse , newErr
2550+ }
2551+ newErr .ErrorModel = v
2552+ }
2553+ return localVarReturnValue , localVarHTTPResponse , newErr
2554+ }
2555+
2556+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
2557+ if err != nil {
2558+ newErr := datadog.GenericOpenAPIError {
2559+ ErrorBody : localVarBody ,
2560+ ErrorMessage : err .Error (),
2561+ }
2562+ return localVarReturnValue , localVarHTTPResponse , newErr
2563+ }
2564+
2565+ return localVarReturnValue , localVarHTTPResponse , nil
2566+ }
2567+
23682568// UpdateLLMObsCustomEvalConfig Create or update a custom evaluator configuration.
23692569// Create or update a custom LLM Observability evaluator configuration by its name.
23702570func (a * LLMObservabilityApi ) UpdateLLMObsCustomEvalConfig (ctx _context.Context , evalName string , body LLMObsCustomEvalConfigUpdateRequest ) (* _nethttp.Response , error ) {
0 commit comments