Skip to content

Commit a408780

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c1852be of spec repo
1 parent 1350eff commit a408780

91 files changed

Lines changed: 11548 additions & 1785 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 1665 additions & 220 deletions
Large diffs are not rendered by default.

LICENSE-3rdparty.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jni-sys,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,"Steven Fackler <sfa
8282
jni-sys-macros,https://github.com/jni-rs/jni-sys,MIT OR Apache-2.0,Robert Bragg <robert@sixbynine.org>
8383
js-sys,https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers
8484
lazy_static,https://github.com/rust-lang-nursery/lazy-static.rs,MIT OR Apache-2.0,Marvin Löbel <loebel.marvin@gmail.com>
85-
libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The Rust Project Developers
85+
libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The libc Authors
8686
linux-raw-sys,https://github.com/sunfishcode/linux-raw-sys,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Dan Gohman <dev@sunfishcode.online>
8787
litemap,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers
8888
lock_api,https://github.com/Amanieu/parking_lot,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Create an LLM Observability prompt returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
use datadog_api_client::datadogV2::model::LLMObsCreatePromptData;
5+
use datadog_api_client::datadogV2::model::LLMObsCreatePromptDataAttributes;
6+
use datadog_api_client::datadogV2::model::LLMObsCreatePromptRequest;
7+
use datadog_api_client::datadogV2::model::LLMObsPromptTemplate;
8+
use datadog_api_client::datadogV2::model::LLMObsPromptType;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body =
13+
LLMObsCreatePromptRequest::new(
14+
LLMObsCreatePromptData::new(
15+
LLMObsCreatePromptDataAttributes::new(
16+
"Example-LLM-Observability".to_string(),
17+
LLMObsPromptTemplate::LLMObsPromptTextTemplate(
18+
"You are a helpful customer support assistant for {{company_name}}. Help {{customer_name}} with this question: {{question}}".to_string(),
19+
),
20+
).title("Customer Support Assistant".to_string()),
21+
LLMObsPromptType::PROMPT_TEMPLATES,
22+
),
23+
);
24+
let mut configuration = datadog::Configuration::new();
25+
configuration.set_unstable_operation_enabled("v2.CreateLLMObsPrompt", true);
26+
let api = LLMObservabilityAPI::with_config(configuration);
27+
let resp = api.create_llm_obs_prompt(body).await;
28+
if let Ok(value) = resp {
29+
println!("{:#?}", value);
30+
} else {
31+
println!("{:#?}", resp.unwrap_err());
32+
}
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Create a new LLM Observability prompt version returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
use datadog_api_client::datadogV2::model::LLMObsCreatePromptVersionData;
5+
use datadog_api_client::datadogV2::model::LLMObsCreatePromptVersionDataAttributes;
6+
use datadog_api_client::datadogV2::model::LLMObsCreatePromptVersionRequest;
7+
use datadog_api_client::datadogV2::model::LLMObsPromptTemplate;
8+
use datadog_api_client::datadogV2::model::LLMObsPromptVersionType;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
// there is a valid "prompt" in the system
13+
let prompt_data_attributes_prompt_id =
14+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
15+
let body =
16+
LLMObsCreatePromptVersionRequest::new(
17+
LLMObsCreatePromptVersionData::new(
18+
LLMObsCreatePromptVersionDataAttributes::new(
19+
LLMObsPromptTemplate::LLMObsPromptTextTemplate(
20+
"You are a concise customer support assistant for {{company_name}}. Answer {{customer_name}}'s question: {{question}}".to_string(),
21+
),
22+
),
23+
LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS,
24+
),
25+
);
26+
let mut configuration = datadog::Configuration::new();
27+
configuration.set_unstable_operation_enabled("v2.CreateLLMObsPromptVersion", true);
28+
let api = LLMObservabilityAPI::with_config(configuration);
29+
let resp = api
30+
.create_llm_obs_prompt_version(prompt_data_attributes_prompt_id.clone(), body)
31+
.await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Delete an LLM Observability prompt returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "prompt" in the system
8+
let prompt_data_attributes_prompt_id =
9+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.DeleteLLMObsPrompt", true);
12+
let api = LLMObservabilityAPI::with_config(configuration);
13+
let resp = api
14+
.delete_llm_obs_prompt(prompt_data_attributes_prompt_id.clone())
15+
.await;
16+
if let Ok(value) = resp {
17+
println!("{:#?}", value);
18+
} else {
19+
println!("{:#?}", resp.unwrap_err());
20+
}
21+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get an LLM Observability prompt returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::GetLLMObsPromptOptionalParams;
4+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "prompt" in the system
9+
let prompt_data_attributes_prompt_id =
10+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
11+
let mut configuration = datadog::Configuration::new();
12+
configuration.set_unstable_operation_enabled("v2.GetLLMObsPrompt", true);
13+
let api = LLMObservabilityAPI::with_config(configuration);
14+
let resp = api
15+
.get_llm_obs_prompt(
16+
prompt_data_attributes_prompt_id.clone(),
17+
GetLLMObsPromptOptionalParams::default(),
18+
)
19+
.await;
20+
if let Ok(value) = resp {
21+
println!("{:#?}", value);
22+
} else {
23+
println!("{:#?}", resp.unwrap_err());
24+
}
25+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Get a specific LLM Observability prompt version returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "prompt" in the system
8+
let prompt_data_attributes_prompt_id =
9+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
10+
11+
// there is a valid "prompt_version" in the system
12+
let prompt_version_data_attributes_version: i64 =
13+
std::env::var("PROMPT_VERSION_DATA_ATTRIBUTES_VERSION")
14+
.unwrap()
15+
.parse()
16+
.unwrap();
17+
let mut configuration = datadog::Configuration::new();
18+
configuration.set_unstable_operation_enabled("v2.GetLLMObsPromptVersion", true);
19+
let api = LLMObservabilityAPI::with_config(configuration);
20+
let resp = api
21+
.get_llm_obs_prompt_version(
22+
prompt_data_attributes_prompt_id.clone(),
23+
prompt_version_data_attributes_version.clone(),
24+
)
25+
.await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// List versions of an LLM Observability prompt returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "prompt" in the system
8+
let prompt_data_attributes_prompt_id =
9+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.ListLLMObsPromptVersions", true);
12+
let api = LLMObservabilityAPI::with_config(configuration);
13+
let resp = api
14+
.list_llm_obs_prompt_versions(prompt_data_attributes_prompt_id.clone())
15+
.await;
16+
if let Ok(value) = resp {
17+
println!("{:#?}", value);
18+
} else {
19+
println!("{:#?}", resp.unwrap_err());
20+
}
21+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// List LLM Observability prompts returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
use datadog_api_client::datadogV2::api_llm_observability::ListLLMObsPromptsOptionalParams;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "prompt" in the system
9+
let prompt_data_attributes_prompt_id =
10+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
11+
let mut configuration = datadog::Configuration::new();
12+
configuration.set_unstable_operation_enabled("v2.ListLLMObsPrompts", true);
13+
let api = LLMObservabilityAPI::with_config(configuration);
14+
let resp = api
15+
.list_llm_obs_prompts(
16+
ListLLMObsPromptsOptionalParams::default()
17+
.filter_prompt_id(prompt_data_attributes_prompt_id.clone()),
18+
)
19+
.await;
20+
if let Ok(value) = resp {
21+
println!("{:#?}", value);
22+
} else {
23+
println!("{:#?}", resp.unwrap_err());
24+
}
25+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Update an LLM Observability prompt returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
4+
use datadog_api_client::datadogV2::model::LLMObsPromptType;
5+
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptData;
6+
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptDataAttributes;
7+
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptRequest;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
// there is a valid "prompt" in the system
12+
let prompt_data_attributes_prompt_id =
13+
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
14+
let body = LLMObsUpdatePromptRequest::new(LLMObsUpdatePromptData::new(
15+
LLMObsUpdatePromptDataAttributes::new().title("Customer Support Assistant".to_string()),
16+
LLMObsPromptType::PROMPT_TEMPLATES,
17+
));
18+
let mut configuration = datadog::Configuration::new();
19+
configuration.set_unstable_operation_enabled("v2.UpdateLLMObsPrompt", true);
20+
let api = LLMObservabilityAPI::with_config(configuration);
21+
let resp = api
22+
.update_llm_obs_prompt(prompt_data_attributes_prompt_id.clone(), body)
23+
.await;
24+
if let Ok(value) = resp {
25+
println!("{:#?}", value);
26+
} else {
27+
println!("{:#?}", resp.unwrap_err());
28+
}
29+
}

0 commit comments

Comments
 (0)