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,730 changes: 1,510 additions & 220 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions examples/v2/llm-observability/CreateLLMObsPrompt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Create an LLM Observability prompt returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_llm_obs_prompt".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

body = DatadogAPIClient::V2::LLMObsCreatePromptRequest.new({
data: DatadogAPIClient::V2::LLMObsCreatePromptData.new({
attributes: DatadogAPIClient::V2::LLMObsCreatePromptDataAttributes.new({
env_ids: [],
labels: [],
prompt_id: "Example-LLM-Observability",
template: "Hello",
}),
type: DatadogAPIClient::V2::LLMObsPromptType::PROMPT_TEMPLATES,
}),
})
p api_instance.create_llm_obs_prompt(body)
22 changes: 22 additions & 0 deletions examples/v2/llm-observability/CreateLLMObsPromptVersion.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Create a new LLM Observability prompt version returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_llm_obs_prompt_version".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]

body = DatadogAPIClient::V2::LLMObsCreatePromptVersionRequest.new({
data: DatadogAPIClient::V2::LLMObsCreatePromptVersionData.new({
attributes: DatadogAPIClient::V2::LLMObsCreatePromptVersionDataAttributes.new({
env_ids: [],
labels: [],
template: "Hello v3",
}),
type: DatadogAPIClient::V2::LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS,
}),
})
p api_instance.create_llm_obs_prompt_version(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, body)
11 changes: 11 additions & 0 deletions examples/v2/llm-observability/DeleteLLMObsPrompt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Delete an LLM Observability prompt returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_llm_obs_prompt".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]
p api_instance.delete_llm_obs_prompt(PROMPT_DATA_ATTRIBUTES_PROMPT_ID)
11 changes: 11 additions & 0 deletions examples/v2/llm-observability/GetLLMObsPrompt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Get an LLM Observability prompt returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_llm_obs_prompt".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]
p api_instance.get_llm_obs_prompt(PROMPT_DATA_ATTRIBUTES_PROMPT_ID)
14 changes: 14 additions & 0 deletions examples/v2/llm-observability/GetLLMObsPromptVersion.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Get a specific LLM Observability prompt version returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_llm_obs_prompt_version".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]

# there is a valid "prompt_version" in the system
PROMPT_VERSION_DATA_ATTRIBUTES_VERSION = ENV["PROMPT_VERSION_DATA_ATTRIBUTES_VERSION"]
p api_instance.get_llm_obs_prompt_version(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, PROMPT_VERSION_DATA_ATTRIBUTES_VERSION.to_i)
11 changes: 11 additions & 0 deletions examples/v2/llm-observability/ListLLMObsPromptVersions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List versions of an LLM Observability prompt returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_llm_obs_prompt_versions".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]
p api_instance.list_llm_obs_prompt_versions(PROMPT_DATA_ATTRIBUTES_PROMPT_ID)
8 changes: 8 additions & 0 deletions examples/v2/llm-observability/ListLLMObsPrompts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List LLM Observability prompts returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_llm_obs_prompts".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new
p api_instance.list_llm_obs_prompts()
20 changes: 20 additions & 0 deletions examples/v2/llm-observability/UpdateLLMObsPrompt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Update an LLM Observability prompt returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_llm_obs_prompt".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]

body = DatadogAPIClient::V2::LLMObsUpdatePromptRequest.new({
data: DatadogAPIClient::V2::LLMObsUpdatePromptData.new({
attributes: DatadogAPIClient::V2::LLMObsUpdatePromptDataAttributes.new({
title: "New title",
}),
type: DatadogAPIClient::V2::LLMObsPromptType::PROMPT_TEMPLATES,
}),
})
p api_instance.update_llm_obs_prompt(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, body)
24 changes: 24 additions & 0 deletions examples/v2/llm-observability/UpdateLLMObsPromptVersion.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Update a specific LLM Observability prompt version returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_llm_obs_prompt_version".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new

# there is a valid "prompt" in the system
PROMPT_DATA_ATTRIBUTES_PROMPT_ID = ENV["PROMPT_DATA_ATTRIBUTES_PROMPT_ID"]

# there is a valid "prompt_version" in the system
PROMPT_VERSION_DATA_ATTRIBUTES_VERSION = ENV["PROMPT_VERSION_DATA_ATTRIBUTES_VERSION"]

body = DatadogAPIClient::V2::LLMObsUpdatePromptVersionRequest.new({
data: DatadogAPIClient::V2::LLMObsUpdatePromptVersionData.new({
attributes: DatadogAPIClient::V2::LLMObsUpdatePromptVersionDataAttributes.new({
env_ids: [],
labels: [],
}),
type: DatadogAPIClient::V2::LLMObsPromptVersionType::PROMPT_TEMPLATE_VERSIONS,
}),
})
p api_instance.update_llm_obs_prompt_version(PROMPT_DATA_ATTRIBUTES_PROMPT_ID, PROMPT_VERSION_DATA_ATTRIBUTES_VERSION.to_i, body)
33 changes: 33 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,39 @@
"project_id" => "String",
"body" => "LLMObsProjectUpdateRequest",
},
"v2.ListLLMObsPrompts" => {
"filter_prompt_id" => "String",
},
"v2.CreateLLMObsPrompt" => {
"body" => "LLMObsCreatePromptRequest",
},
"v2.DeleteLLMObsPrompt" => {
"prompt_id" => "String",
},
"v2.GetLLMObsPrompt" => {
"prompt_id" => "String",
"label" => "String",
},
"v2.UpdateLLMObsPrompt" => {
"prompt_id" => "String",
"body" => "LLMObsUpdatePromptRequest",
},
"v2.ListLLMObsPromptVersions" => {
"prompt_id" => "String",
},
"v2.CreateLLMObsPromptVersion" => {
"prompt_id" => "String",
"body" => "LLMObsCreatePromptVersionRequest",
},
"v2.GetLLMObsPromptVersion" => {
"prompt_id" => "String",
"version" => "Integer",
},
"v2.UpdateLLMObsPromptVersion" => {
"prompt_id" => "String",
"version" => "Integer",
"body" => "LLMObsUpdatePromptVersionRequest",
},
"v2.ListLLMObsSpans" => {
"filter_from" => "String",
"filter_to" => "String",
Expand Down
28 changes: 28 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,34 @@
"tag": "IP Allowlist",
"operationId": "UpdateIPAllowlist"
},
{
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"prompt-templates\",\n \"attributes\": {\n \"prompt_id\": \"{{ unique }}\",\n \"template\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n }\n }\n}"
}
],
"step": "there is a valid \"prompt\" in the system",
"key": "prompt",
"tag": "LLM Observability",
"operationId": "CreateLLMObsPrompt"
},
{
"parameters": [
{
"name": "prompt_id",
"source": "prompt.data.attributes.prompt_id"
},
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"prompt-template-versions\",\n \"attributes\": {\n \"template\": [{\"role\": \"user\", \"content\": \"Hello v2\"}]\n }\n }\n}"
}
],
"step": "there is a valid \"prompt_version\" in the system",
"key": "prompt_version",
"tag": "LLM Observability",
"operationId": "CreateLLMObsPromptVersion"
},
{
"parameters": [
{
Expand Down
Loading
Loading