-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add ai configs resources #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
monsagri
wants to merge
26
commits into
main
Choose a base branch
from
ffeldberg/test-skill-on-ai-configs-resources
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
77de53a
first pass by claude
monsagri eb909f4
second pass using skill
monsagri 1643c17
fixes after branch comparison
monsagri 404ce8a
more fixes
monsagri 1362369
test fixes
monsagri ca38c26
more test fixes
monsagri 21bc8a7
handle last variation deletion
monsagri 6286e32
fix: remove redundant nil check flagged by gosimple linter
monsagri 41b778e
fix: clear constructor default for description and fix test configs
monsagri 3c13c97
fix: use handleLdapiErr to check response body for last variation error
monsagri 0d3c7a9
fix: add judge mode, fix evaluation metric test, fix is_inverted import
monsagri 2084bf7
chore: regenerate docs and integration configs after judge mode addition
monsagri 230fa7d
more comprehensive acceptance tests
monsagri aa5f35e
make generate
monsagri ab8a14c
pr feedback: docs feedback
monsagri 40df62d
fix tests and mismatch between docs and reality
monsagri 53a4602
move tests to serial instead of parallel to account for rate limits
monsagri 251bcce
add depends_on as needed for tests
monsagri b856f51
account for hidden underlying 429s
monsagri ac9603e
fix unintentional commits and add gitignore
monsagri f5f1cf0
review fixes: bug fixes, validation improvements, data source, and te…
monsagri 1b48fc7
pr feedback: address copilot comments
monsagri 8546828
Merge branch 'main' into ffeldberg/test-skill-on-ai-configs-resources
monsagri f0d02b5
more fixes to account for 400/429 issue
monsagri 8fa9157
account for lack of tools in api response
monsagri bc97d03
again
monsagri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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 either `completion` or `agent`. Defaults to `completion`. | ||
| - `name` (String) The AI config's human-readable name. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <a id="nestedatt--variations"></a> | ||
| ### Nested Schema for `variations` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `key` (String) | ||
| - `name` (String) | ||
| - `variation_id` (String) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This resource allows you to create and manage AI configurations within your LaunchDarkly project. | ||
| --- | ||
|
|
||
| # launchdarkly_ai_config (Resource) | ||
|
|
||
| Provides a LaunchDarkly AI config resource. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This resource allows you to create and manage AI configurations within your LaunchDarkly project. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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 either `completion` or `agent`. Defaults to `completion`. A change in this field will force the destruction of the existing resource and the creation of a new one. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `tags` (Set of String) Tags associated with your resource. | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `creation_date` (Number) A timestamp of when the AI config was created. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <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` | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| terraform import launchdarkly_ai_config.example example-project/customer-assistant | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| # 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. | ||
|
|
||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ## 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. | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `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. | ||
| - `model_config_key` (String) The key of a model config resource to use for this variation. | ||
| - `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` | ||
monsagri marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| terraform import launchdarkly_ai_config_variation.example example-project/customer-assistant/helpful-v1 | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "launchdarkly_ai_tool Resource - launchdarkly" | ||
| subcategory: "" | ||
| description: |- | ||
| Provides a LaunchDarkly AI tool resource. | ||
| This resource allows you to create and manage AI tools within your LaunchDarkly project. | ||
| --- | ||
|
|
||
| # launchdarkly_ai_tool (Resource) | ||
|
|
||
| Provides a LaunchDarkly AI tool resource. | ||
|
|
||
| This resource allows you to create and manage AI tools within your LaunchDarkly project. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| resource "launchdarkly_ai_tool" "example" { | ||
| project_key = launchdarkly_project.example.key | ||
| key = "web-search" | ||
| description = "Search the web for information" | ||
| schema_json = jsonencode({ | ||
| type = "object" | ||
| properties = { | ||
| query = { | ||
| type = "string" | ||
| description = "The search query" | ||
| } | ||
| } | ||
| required = ["query"] | ||
| }) | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `key` (String) The AI tool's unique key. A change in this field will force the destruction of the existing resource and the creation of a new one. | ||
| - `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. | ||
| - `schema_json` (String) A JSON string representing the JSON Schema for the tool's parameters. | ||
|
|
||
| ### Optional | ||
|
|
||
| - `custom_parameters` (String) A JSON string representing custom application-level metadata for the AI tool. | ||
| - `description` (String) The AI tool's description. | ||
| - `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`. | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `creation_date` (Number) The creation timestamp of the AI tool. | ||
| - `id` (String) The ID of this resource. | ||
| - `version` (Number) The version of the AI tool. | ||
|
|
||
| ## Import | ||
|
|
||
| Import is supported using the following syntax: | ||
|
|
||
| ```shell | ||
| # LaunchDarkly AI tools can be imported using the format `project_key/tool_key` | ||
| terraform import launchdarkly_ai_tool.example example-project/web-search | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.