Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
77de53a
first pass by claude
monsagri Mar 18, 2026
eb909f4
second pass using skill
monsagri Mar 18, 2026
1643c17
fixes after branch comparison
monsagri Mar 18, 2026
404ce8a
more fixes
monsagri Mar 18, 2026
1362369
test fixes
monsagri Mar 18, 2026
ca38c26
more test fixes
monsagri Mar 18, 2026
21bc8a7
handle last variation deletion
monsagri Mar 18, 2026
6286e32
fix: remove redundant nil check flagged by gosimple linter
monsagri Mar 18, 2026
41b778e
fix: clear constructor default for description and fix test configs
monsagri Mar 18, 2026
3c13c97
fix: use handleLdapiErr to check response body for last variation error
monsagri Mar 19, 2026
0d3c7a9
fix: add judge mode, fix evaluation metric test, fix is_inverted import
monsagri Mar 19, 2026
2084bf7
chore: regenerate docs and integration configs after judge mode addition
monsagri Mar 19, 2026
230fa7d
more comprehensive acceptance tests
monsagri Mar 19, 2026
aa5f35e
make generate
monsagri Mar 19, 2026
ab8a14c
pr feedback: docs feedback
monsagri Mar 19, 2026
40df62d
fix tests and mismatch between docs and reality
monsagri Mar 19, 2026
53a4602
move tests to serial instead of parallel to account for rate limits
monsagri Mar 19, 2026
251bcce
add depends_on as needed for tests
monsagri Mar 19, 2026
b856f51
account for hidden underlying 429s
monsagri Mar 19, 2026
ac9603e
fix unintentional commits and add gitignore
monsagri Mar 19, 2026
f5f1cf0
review fixes: bug fixes, validation improvements, data source, and te…
monsagri Mar 20, 2026
1b48fc7
pr feedback: address copilot comments
monsagri Mar 20, 2026
8546828
Merge branch 'main' into ffeldberg/test-skill-on-ai-configs-resources
monsagri Mar 20, 2026
f0d02b5
more fixes to account for 400/429 issue
monsagri Mar 20, 2026
8fa9157
account for lack of tools in api response
monsagri Mar 20, 2026
bc97d03
again
monsagri Mar 20, 2026
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ jobs:
strategy:
matrix:
test_case:
- TestAccAIConfig_
- TestAccAIConfigVariation
- TestAccAITool
- TestAccDataSource
- TestAccAccessToken
- TestAccAuditLogSubscription
Expand All @@ -93,6 +96,7 @@ jobs:
- TestAccFlagTemplates
- TestAccFlagTrigger
- TestAccMetric
- TestAccModelConfig
- TestAccProject
- TestAccRelayProxy
- TestAccSegment
Expand Down
462 changes: 462 additions & 0 deletions REVIEW_FIXES.md

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions docs/data-sources/ai_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "launchdarkly_ai_config Data Source - launchdarkly"
subcategory: ""
description: |-
Provides a LaunchDarkly AI Config data source.
This data source allows you to retrieve AI configuration information from your LaunchDarkly project.
---

# launchdarkly_ai_config (Data Source)

Provides a LaunchDarkly AI Config data source.

This data source allows you to retrieve AI configuration information from your LaunchDarkly project.

## Example Usage

```terraform
data "launchdarkly_ai_config" "example" {
key = "customer-assistant"
project_key = "example-project"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `key` (String) The AI Config's unique key.
- `project_key` (String) The project key.

### Read-Only

- `creation_date` (Number) A timestamp of when the AI Config was created.
- `description` (String) The AI Config's description.
- `evaluation_metric_key` (String) The key of the evaluation metric associated with this AI Config.
- `id` (String) The ID of this resource.
- `is_inverted` (Boolean) Whether the evaluation metric is inverted.
- `maintainer_id` (String) The member ID of the maintainer for this AI Config. Conflicts with `maintainer_team_key`.
- `maintainer_team_key` (String) The team key of the maintainer team for this AI Config. Conflicts with `maintainer_id`.
- `mode` (String) The AI Config's mode. Must be `completion`, `agent`, or `judge`. Defaults to `completion`.
- `name` (String) The AI Config's human-readable name.
- `tags` (Set of String) Tags associated with your resource.
- `variations` (List of Object) A list of variation summaries for this AI Config. (see [below for nested schema](#nestedatt--variations))
- `version` (Number) The version of the AI Config.

<a id="nestedatt--variations"></a>
### Nested Schema for `variations`

Read-Only:

- `key` (String)
- `name` (String)
- `variation_id` (String)
56 changes: 56 additions & 0 deletions docs/data-sources/ai_config_variation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "launchdarkly_ai_config_variation Data Source - launchdarkly"
subcategory: ""
description: |-
Provides a LaunchDarkly AI Config variation data source.
This data source allows you to retrieve AI Config variation information from your LaunchDarkly project.
---

# launchdarkly_ai_config_variation (Data Source)

Provides a LaunchDarkly AI Config variation data source.

This data source allows you to retrieve AI Config variation information from your LaunchDarkly project.

## Example Usage

```terraform
data "launchdarkly_ai_config_variation" "example" {
project_key = "example-project"
config_key = "customer-assistant"
key = "default"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `config_key` (String) The AI Config key that this variation belongs to.
- `key` (String) The variation's unique key.
- `project_key` (String) The project key.

### Read-Only

- `creation_date` (Number) The creation timestamp of the variation.
- `description` (String) The variation's description (used in agent mode).
- `id` (String) The ID of this resource.
- `instructions` (String) The variation's instructions (used in agent mode).
- `messages` (List of Object) A list of messages for completion mode. Each message has a `role` and `content`. (see [below for nested schema](#nestedatt--messages))
- `model` (String) A JSON string representing the inline model configuration for the variation. Conflicts with `model_config_key`.
- `model_config_key` (String) The key of a model config resource to use for this variation. Conflicts with `model`.
- `name` (String) The variation's human-readable name.
- `state` (String) The state of the variation. Must be `archived` or `published`.
- `tool_keys` (Set of String) A set of AI tool keys to associate with this variation.
- `variation_id` (String) The internal ID of the variation.
- `version` (Number) The version number of the variation.

<a id="nestedatt--messages"></a>
### Nested Schema for `messages`

Read-Only:

- `content` (String)
- `role` (String)
42 changes: 42 additions & 0 deletions docs/data-sources/ai_tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "launchdarkly_ai_tool Data Source - launchdarkly"
subcategory: ""
description: |-
Provides a LaunchDarkly AI tool data source.
This data source allows you to retrieve AI tool information from your LaunchDarkly project.
---

# launchdarkly_ai_tool (Data Source)

Provides a LaunchDarkly AI tool data source.

This data source allows you to retrieve AI tool information from your LaunchDarkly project.

## Example Usage

```terraform
data "launchdarkly_ai_tool" "example" {
key = "web-search"
project_key = "example-project"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `key` (String) The AI tool's unique key.
- `project_key` (String) The project key.

### Read-Only

- `creation_date` (Number) The creation timestamp of the AI tool.
- `custom_parameters` (String) A JSON string representing custom application-level metadata for the AI tool.
- `description` (String) The AI tool's description.
- `id` (String) The ID of this resource.
- `maintainer_id` (String) The member ID of the maintainer for this AI tool. Conflicts with `maintainer_team_key`.
- `maintainer_team_key` (String) The team key of the maintainer team for this AI tool. Conflicts with `maintainer_id`.
- `schema_json` (String) A JSON string representing the JSON Schema for the tool's parameters.
- `version` (Number) The version of the AI tool.
46 changes: 46 additions & 0 deletions docs/data-sources/model_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "launchdarkly_model_config Data Source - launchdarkly"
subcategory: ""
description: |-
Provides a LaunchDarkly model config data source.
This data source allows you to retrieve AI model configuration information from your LaunchDarkly project.
---

# launchdarkly_model_config (Data Source)

Provides a LaunchDarkly model config data source.

This data source allows you to retrieve AI model configuration information from your LaunchDarkly project.

## Example Usage

```terraform
data "launchdarkly_model_config" "example" {
key = "gpt-4-turbo"
project_key = "example-project"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `key` (String) The model config's unique key.
- `project_key` (String) The project key.

### Read-Only

- `cost_per_input_token` (Number) The cost per input token for the model.
- `cost_per_output_token` (Number) The cost per output token for the model.
- `custom_parameters` (String) A JSON string representing custom parameters for the model config.
- `global` (Boolean) Whether the model config is available globally.
- `icon` (String) The icon for the model config.
- `id` (String) The ID of this resource.
- `model_id` (String) The model identifier (e.g. `gpt-4`, `claude-3`).
- `model_provider` (String) The provider name for the model config (e.g. `openai`, `anthropic`).
- `name` (String) The model config's human-readable name.
- `params` (String) A JSON string representing the model parameters (e.g. `{"temperature": 0.7, "maxTokens": 4096}`).
- `tags` (Set of String) Tags associated with your resource.
- `version` (Number) The version of the model config.
71 changes: 71 additions & 0 deletions docs/resources/ai_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "launchdarkly_ai_config Resource - launchdarkly"
subcategory: ""
description: |-
Provides a LaunchDarkly AI Config resource.
This resource allows you to create and manage AI Configurations within your LaunchDarkly project.
---

# launchdarkly_ai_config (Resource)

Provides a LaunchDarkly AI Config resource.

This resource allows you to create and manage AI Configurations within your LaunchDarkly project.

## Example Usage

```terraform
resource "launchdarkly_ai_config" "example" {
project_key = launchdarkly_project.example.key
key = "customer-assistant"
name = "Customer Assistant"
description = "AI assistant for customer support"
mode = "completion"
tags = ["support"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `key` (String) The AI Config's unique key. A change in this field will force the destruction of the existing resource and the creation of a new one.
- `name` (String) The AI Config's human-readable name.
- `project_key` (String) The project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

### Optional

- `description` (String) The AI Config's description.
- `evaluation_metric_key` (String) The key of the evaluation metric associated with this AI Config.
- `is_inverted` (Boolean) Whether the evaluation metric is inverted.
- `maintainer_id` (String) The member ID of the maintainer for this AI Config. Conflicts with `maintainer_team_key`.
- `maintainer_team_key` (String) The team key of the maintainer team for this AI Config. Conflicts with `maintainer_id`.
- `mode` (String) The AI Config's mode. Must be `completion`, `agent`, or `judge`. Defaults to `completion`. A change in this field will force the destruction of the existing resource and the creation of a new one.
- `tags` (Set of String) Tags associated with your resource.

### Read-Only

- `creation_date` (Number) A timestamp of when the AI Config was created.
- `id` (String) The ID of this resource.
- `variations` (List of Object) A list of variation summaries for this AI Config. (see [below for nested schema](#nestedatt--variations))
- `version` (Number) The version of the AI Config.

<a id="nestedatt--variations"></a>
### Nested Schema for `variations`

Read-Only:

- `key` (String)
- `name` (String)
- `variation_id` (String)

## Import

Import is supported using the following syntax:

```shell
# LaunchDarkly AI Configs can be imported using the format `project_key/config_key`
terraform import launchdarkly_ai_config.example example-project/customer-assistant
```
80 changes: 80 additions & 0 deletions docs/resources/ai_config_variation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "launchdarkly_ai_config_variation Resource - launchdarkly"
subcategory: ""
description: |-
Provides a LaunchDarkly AI Config variation resource.
This resource allows you to create and manage AI Config variations within your LaunchDarkly project.
---

# launchdarkly_ai_config_variation (Resource)

Provides a LaunchDarkly AI Config variation resource.

This resource allows you to create and manage AI Config variations within your LaunchDarkly project.

## Example Usage

```terraform
resource "launchdarkly_ai_config_variation" "example" {
project_key = launchdarkly_project.example.key
config_key = launchdarkly_ai_config.example.key
key = "helpful-v1"
name = "Helpful V1"
model_config_key = launchdarkly_model_config.example.key

messages {
role = "system"
content = "You are a helpful customer support assistant."
}

messages {
role = "user"
content = "{{ ldctx.query }}"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `config_key` (String) The AI Config key that this variation belongs to. A change in this field will force the destruction of the existing resource and the creation of a new one.
- `key` (String) The variation's unique key. A change in this field will force the destruction of the existing resource and the creation of a new one.
- `name` (String) The variation's human-readable name.
- `project_key` (String) The project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

### Optional

- `description` (String) The variation's description (used in agent mode).
- `instructions` (String) The variation's instructions (used in agent mode).
- `messages` (Block List) A list of messages for completion mode. Each message has a `role` and `content`. (see [below for nested schema](#nestedblock--messages))
- `model` (String) A JSON string representing the inline model configuration for the variation. Conflicts with `model_config_key`.
- `model_config_key` (String) The key of a model config resource to use for this variation. Conflicts with `model`.
- `state` (String) The state of the variation. Must be `archived` or `published`.
- `tool_keys` (Set of String) A set of AI tool keys to associate with this variation.

### Read-Only

- `creation_date` (Number) The creation timestamp of the variation.
- `id` (String) The ID of this resource.
- `variation_id` (String) The internal ID of the variation.
- `version` (Number) The version number of the variation.

<a id="nestedblock--messages"></a>
### Nested Schema for `messages`

Required:

- `content` (String) The content of the message.
- `role` (String) The role of the message. Must be one of `system`, `user`, `assistant`, or `developer`.

## Import

Import is supported using the following syntax:

```shell
# LaunchDarkly AI Config variations can be imported using the format `project_key/config_key/variation_key`
terraform import launchdarkly_ai_config_variation.example example-project/customer-assistant/helpful-v1
```
Loading
Loading