Skip to content

Commit 5b2bf13

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
doc ml obs Expose LLM Observability annotation endpoints (#1696)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f64424f commit 5b2bf13

32 files changed

Lines changed: 3459 additions & 10 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 530 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Delete annotations returns "OK — annotations deleted. Errors for annotations
2+
// that could not be deleted are listed in `errors`." response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
5+
use datadog_api_client::datadogV2::model::LLMObsAnnotationsType;
6+
use datadog_api_client::datadogV2::model::LLMObsDeleteAnnotationsDataAttributesRequest;
7+
use datadog_api_client::datadogV2::model::LLMObsDeleteAnnotationsDataRequest;
8+
use datadog_api_client::datadogV2::model::LLMObsDeleteAnnotationsRequest;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body = LLMObsDeleteAnnotationsRequest::new(LLMObsDeleteAnnotationsDataRequest::new(
13+
LLMObsDeleteAnnotationsDataAttributesRequest::new(vec![
14+
"00000000-0000-0000-0000-000000000000".to_string(),
15+
"00000000-0000-0000-0000-000000000001".to_string(),
16+
]),
17+
LLMObsAnnotationsType::ANNOTATIONS,
18+
));
19+
let mut configuration = datadog::Configuration::new();
20+
configuration.set_unstable_operation_enabled("v2.DeleteLLMObsAnnotations", true);
21+
let api = LLMObservabilityAPI::with_config(configuration);
22+
let resp = api
23+
.delete_llm_obs_annotations("queue_id".to_string(), body)
24+
.await;
25+
if let Ok(value) = resp {
26+
println!("{:#?}", value);
27+
} else {
28+
println!("{:#?}", resp.unwrap_err());
29+
}
30+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Create or update annotations returns "OK — annotations created or updated.
2+
// Per-item errors are listed in `errors`." response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
5+
use datadog_api_client::datadogV2::model::LLMObsAnnotationLabelValue;
6+
use datadog_api_client::datadogV2::model::LLMObsAnnotationLabelValueValue;
7+
use datadog_api_client::datadogV2::model::LLMObsAnnotationsDataAttributesRequest;
8+
use datadog_api_client::datadogV2::model::LLMObsAnnotationsDataRequest;
9+
use datadog_api_client::datadogV2::model::LLMObsAnnotationsRequest;
10+
use datadog_api_client::datadogV2::model::LLMObsAnnotationsType;
11+
use datadog_api_client::datadogV2::model::LLMObsUpsertAnnotationItem;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
let body = LLMObsAnnotationsRequest::new(LLMObsAnnotationsDataRequest::new(
16+
LLMObsAnnotationsDataAttributesRequest::new(vec![LLMObsUpsertAnnotationItem::new(
17+
"00000000-0000-0000-0000-000000000001".to_string(),
18+
vec![
19+
LLMObsAnnotationLabelValue::new(
20+
"abc-123".to_string(),
21+
LLMObsAnnotationLabelValueValue::AnyValueString("good".to_string()),
22+
),
23+
LLMObsAnnotationLabelValue::new(
24+
"ef56gh78".to_string(),
25+
LLMObsAnnotationLabelValueValue::AnyValueString("positive".to_string()),
26+
),
27+
],
28+
)]),
29+
LLMObsAnnotationsType::ANNOTATIONS,
30+
));
31+
let mut configuration = datadog::Configuration::new();
32+
configuration.set_unstable_operation_enabled("v2.UpsertLLMObsAnnotations", true);
33+
let api = LLMObservabilityAPI::with_config(configuration);
34+
let resp = api
35+
.upsert_llm_obs_annotations("queue_id".to_string(), body)
36+
.await;
37+
if let Ok(value) = resp {
38+
println!("{:#?}", value);
39+
} else {
40+
println!("{:#?}", resp.unwrap_err());
41+
}
42+
}

src/datadog/configuration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ impl Default for Configuration {
159159
"v2.delete_llm_obs_annotation_queue_interactions".to_owned(),
160160
false,
161161
),
162+
("v2.delete_llm_obs_annotations".to_owned(), false),
162163
("v2.delete_llm_obs_custom_eval_config".to_owned(), false),
163164
("v2.delete_llm_obs_data".to_owned(), false),
164165
("v2.delete_llm_obs_dataset_records".to_owned(), false),
@@ -206,6 +207,7 @@ impl Default for Configuration {
206207
("v2.update_llm_obs_experiment".to_owned(), false),
207208
("v2.update_llm_obs_project".to_owned(), false),
208209
("v2.upload_llm_obs_dataset_records_file".to_owned(), false),
210+
("v2.upsert_llm_obs_annotations".to_owned(), false),
209211
("v2.create_annotation".to_owned(), false),
210212
("v2.delete_annotation".to_owned(), false),
211213
("v2.get_page_annotations".to_owned(), false),

0 commit comments

Comments
 (0)