Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,885 changes: 1,665 additions & 220 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions examples/v2_llm-observability_CreateLLMObsPrompt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Create an LLM Observability prompt returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
use datadog_api_client::datadogV2::model::LLMObsCreatePromptData;
use datadog_api_client::datadogV2::model::LLMObsCreatePromptDataAttributes;
use datadog_api_client::datadogV2::model::LLMObsCreatePromptRequest;
use datadog_api_client::datadogV2::model::LLMObsPromptChatMessage;
use datadog_api_client::datadogV2::model::LLMObsPromptTemplate;
use datadog_api_client::datadogV2::model::LLMObsPromptType;

#[tokio::main]
async fn main() {
let body = LLMObsCreatePromptRequest::new(LLMObsCreatePromptData::new(
LLMObsCreatePromptDataAttributes::new(
"Example-LLM-Observability".to_string(),
LLMObsPromptTemplate::LLMObsPromptChatTemplate(vec![
LLMObsPromptChatMessage::new(
"You are a helpful customer support assistant for {{company_name}}."
.to_string(),
"system".to_string(),
),
LLMObsPromptChatMessage::new(
"Help {{customer_name}} with this question: {{question}}".to_string(),
"user".to_string(),
),
]),
)
.title("Customer Support Assistant".to_string()),
LLMObsPromptType::PROMPT_TEMPLATES,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateLLMObsPrompt", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api.create_llm_obs_prompt(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
43 changes: 43 additions & 0 deletions examples/v2_llm-observability_CreateLLMObsPromptVersion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Create a new LLM Observability prompt version returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
use datadog_api_client::datadogV2::model::LLMObsCreatePromptVersionData;
use datadog_api_client::datadogV2::model::LLMObsCreatePromptVersionDataAttributes;
use datadog_api_client::datadogV2::model::LLMObsCreatePromptVersionRequest;
use datadog_api_client::datadogV2::model::LLMObsPromptChatMessage;
use datadog_api_client::datadogV2::model::LLMObsPromptTemplate;
use datadog_api_client::datadogV2::model::LLMObsPromptVersionType;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
let body = LLMObsCreatePromptVersionRequest::new(LLMObsCreatePromptVersionData::new(
LLMObsCreatePromptVersionDataAttributes::new(
LLMObsPromptTemplate::LLMObsPromptChatTemplate(vec![
LLMObsPromptChatMessage::new(
"You are a concise customer support assistant for {{company_name}}."
.to_string(),
"system".to_string(),
),
LLMObsPromptChatMessage::new(
"Answer {{customer_name}}'s question: {{question}}".to_string(),
"user".to_string(),
),
]),
),
LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateLLMObsPromptVersion", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.create_llm_obs_prompt_version(prompt_data_attributes_prompt_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_llm-observability_DeleteLLMObsPrompt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Delete an LLM Observability prompt returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteLLMObsPrompt", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.delete_llm_obs_prompt(prompt_data_attributes_prompt_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
25 changes: 25 additions & 0 deletions examples/v2_llm-observability_GetLLMObsPrompt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get an LLM Observability prompt returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::GetLLMObsPromptOptionalParams;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetLLMObsPrompt", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.get_llm_obs_prompt(
prompt_data_attributes_prompt_id.clone(),
GetLLMObsPromptOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
31 changes: 31 additions & 0 deletions examples/v2_llm-observability_GetLLMObsPromptVersion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Get a specific LLM Observability prompt version returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();

// there is a valid "prompt_version" in the system
let prompt_version_data_attributes_version: i64 =
std::env::var("PROMPT_VERSION_DATA_ATTRIBUTES_VERSION")
.unwrap()
.parse()
.unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetLLMObsPromptVersion", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.get_llm_obs_prompt_version(
prompt_data_attributes_prompt_id.clone(),
prompt_version_data_attributes_version.clone(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_llm-observability_ListLLMObsPromptVersions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// List versions of an LLM Observability prompt returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListLLMObsPromptVersions", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.list_llm_obs_prompt_versions(prompt_data_attributes_prompt_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
25 changes: 25 additions & 0 deletions examples/v2_llm-observability_ListLLMObsPrompts.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// List LLM Observability prompts returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
use datadog_api_client::datadogV2::api_llm_observability::ListLLMObsPromptsOptionalParams;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListLLMObsPrompts", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.list_llm_obs_prompts(
ListLLMObsPromptsOptionalParams::default()
.filter_prompt_id(prompt_data_attributes_prompt_id.clone()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
29 changes: 29 additions & 0 deletions examples/v2_llm-observability_UpdateLLMObsPrompt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Update an LLM Observability prompt returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
use datadog_api_client::datadogV2::model::LLMObsPromptType;
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptData;
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptDataAttributes;
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptRequest;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();
let body = LLMObsUpdatePromptRequest::new(LLMObsUpdatePromptData::new(
LLMObsUpdatePromptDataAttributes::new().title("Customer Support Assistant".to_string()),
LLMObsPromptType::PROMPT_TEMPLATES,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateLLMObsPrompt", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.update_llm_obs_prompt(prompt_data_attributes_prompt_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
42 changes: 42 additions & 0 deletions examples/v2_llm-observability_UpdateLLMObsPromptVersion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Update a specific LLM Observability prompt version returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI;
use datadog_api_client::datadogV2::model::LLMObsPromptVersionType;
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptVersionData;
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptVersionDataAttributes;
use datadog_api_client::datadogV2::model::LLMObsUpdatePromptVersionRequest;

#[tokio::main]
async fn main() {
// there is a valid "prompt" in the system
let prompt_data_attributes_prompt_id =
std::env::var("PROMPT_DATA_ATTRIBUTES_PROMPT_ID").unwrap();

// there is a valid "prompt_version" in the system
let prompt_version_data_attributes_version: i64 =
std::env::var("PROMPT_VERSION_DATA_ATTRIBUTES_VERSION")
.unwrap()
.parse()
.unwrap();
let body = LLMObsUpdatePromptVersionRequest::new(LLMObsUpdatePromptVersionData::new(
LLMObsUpdatePromptVersionDataAttributes::new().description(
"Give concise answers and cite relevant help-center articles.".to_string(),
),
LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateLLMObsPromptVersion", true);
let api = LLMObservabilityAPI::with_config(configuration);
let resp = api
.update_llm_obs_prompt_version(
prompt_data_attributes_prompt_id.clone(),
prompt_version_data_attributes_version.clone(),
body,
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
9 changes: 9 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ impl Default for Configuration {
("v2.create_llm_obs_experiment_events".to_owned(), false),
("v2.create_llm_obs_integration_inference".to_owned(), false),
("v2.create_llm_obs_project".to_owned(), false),
("v2.create_llm_obs_prompt".to_owned(), false),
("v2.create_llm_obs_prompt_version".to_owned(), false),
("v2.delete_llm_obs_annotation_queue".to_owned(), false),
(
"v2.delete_llm_obs_annotation_queue_interactions".to_owned(),
Expand All @@ -165,6 +167,7 @@ impl Default for Configuration {
("v2.delete_llm_obs_experiments".to_owned(), false),
("v2.delete_llm_obs_patterns_config".to_owned(), false),
("v2.delete_llm_obs_projects".to_owned(), false),
("v2.delete_llm_obs_prompt".to_owned(), false),
("v2.export_llm_obs_dataset".to_owned(), false),
("v2.get_llm_obs_annotated_interactions".to_owned(), false),
(
Expand All @@ -179,6 +182,8 @@ impl Default for Configuration {
("v2.get_llm_obs_dataset_draft_state".to_owned(), false),
("v2.get_llm_obs_patterns_config".to_owned(), false),
("v2.get_llm_obs_patterns_run_status".to_owned(), false),
("v2.get_llm_obs_prompt".to_owned(), false),
("v2.get_llm_obs_prompt_version".to_owned(), false),
("v2.list_llm_obs_annotation_queues".to_owned(), false),
("v2.list_llm_obs_dataset_records".to_owned(), false),
("v2.list_llm_obs_datasets".to_owned(), false),
Expand All @@ -201,6 +206,8 @@ impl Default for Configuration {
false,
),
("v2.list_llm_obs_projects".to_owned(), false),
("v2.list_llm_obs_prompts".to_owned(), false),
("v2.list_llm_obs_prompt_versions".to_owned(), false),
("v2.list_llm_obs_spans".to_owned(), false),
("v2.lock_llm_obs_dataset_draft_state".to_owned(), false),
("v2.restore_llm_obs_dataset_version".to_owned(), false),
Expand All @@ -219,6 +226,8 @@ impl Default for Configuration {
("v2.update_llm_obs_dataset_records".to_owned(), false),
("v2.update_llm_obs_experiment".to_owned(), false),
("v2.update_llm_obs_project".to_owned(), false),
("v2.update_llm_obs_prompt".to_owned(), false),
("v2.update_llm_obs_prompt_version".to_owned(), false),
("v2.upload_llm_obs_dataset_records_file".to_owned(), false),
("v2.upsert_llm_obs_annotations".to_owned(), false),
("v2.upsert_llm_obs_patterns_config".to_owned(), false),
Expand Down
Loading
Loading