Skip to content

Commit 4ad30f7

Browse files
committed
Adapt Suggestions
1 parent 2cea9e8 commit 4ad30f7

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

registry/coder/modules/aider/README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ module "aider" {
1515
source = "registry.coder.com/coder/aider/coder"
1616
version = "1.0.0"
1717
agent_id = coder_agent.example.id
18-
ai_api_key = var.api_key
19-
ai_provider = "google"
20-
ai_model = "gemini"
18+
credentials = var.api_key
19+
provider = "google"
20+
model = "gemini"
2121
}
2222
```
2323

@@ -38,10 +38,10 @@ module "aider" {
3838
source = "registry.coder.com/coder/aider/coder"
3939
version = "1.0.0"
4040
agent_id = coder_agent.example.id
41-
ai_api_key = var.gemini_api_key
41+
credentials = var.gemini_api_key
4242
install_aider = true
43-
ai_provider = "google"
44-
ai_model = "gemini"
43+
provider = "google"
44+
model = "gemini"
4545
install_agentapi = true
4646
system_prompt = "..."
4747
}
@@ -61,10 +61,10 @@ module "aider" {
6161
source = "registry.coder.com/coder/aider/coder"
6262
version = "1.0.0"
6363
agent_id = coder_agent.example.id
64-
ai_provider = "custom"
64+
provider = "custom"
6565
custom_env_var_name = "MY_CUSTOM_API_KEY"
66-
ai_model = "custom-model"
67-
ai_api_key = var.custom_api_key
66+
model = "custom-model"
67+
credentials = var.custom_api_key
6868
}
6969
```
7070

@@ -91,10 +91,6 @@ For a complete and up-to-date list of supported aliases and models, please refer
9191
- Logs are written under `/home/coder/.aider-module/` (`install.log`, `agentapi-start.log`) for debugging
9292
- If AgentAPI fails to start, verify that your container has network access and executable permissions for the scripts
9393

94-
> [!IMPORTANT]
95-
> To use **Coder Tasks** with Aider, make sure to set `ai_api_key`.
96-
> This ensures task reporting and status updates work seamlessly.
97-
9894
## References
9995

10096
- [Aider Documentation](https://aider.chat/docs)

registry/coder/modules/aider/main.tf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,22 @@ variable "experiment_additional_extensions" {
100100
default = null
101101
}
102102

103-
variable "ai_provider" {
103+
variable "provider" {
104104
type = string
105105
description = "AI provider to use with Aider (openai, anthropic, azure, google, etc.)"
106106
default = "google"
107107
validation {
108-
condition = contains(["openai", "anthropic", "azure", "google", "cohere", "mistral", "ollama", "custom"], var.ai_provider)
109-
error_message = "ai_provider must be one of: openai, anthropic, azure, google, cohere, mistral, ollama, custom"
108+
condition = contains(["openai", "anthropic", "azure", "google", "cohere", "mistral", "ollama", "custom"], var.provider)
109+
error_message = "provider must be one of: openai, anthropic, azure, google, cohere, mistral, ollama, custom"
110110
}
111111
}
112112

113-
variable "ai_model" {
113+
variable "model" {
114114
type = string
115115
description = "AI model to use with Aider. Can use Aider's built-in aliases like '4o' (gpt-4o), 'sonnet' (claude-3-7-sonnet), 'opus' (claude-3-opus), etc."
116116
}
117117

118-
variable "ai_api_key" {
118+
variable "credentials" {
119119
type = string
120120
description = "API key for the selected AI provider. This will be set as the appropriate environment variable based on the provider."
121121
default = ""
@@ -234,10 +234,10 @@ locals {
234234
}
235235

236236
# Get the environment variable name for selected provider
237-
env_var_name = local.provider_env_vars[var.ai_provider]
237+
env_var_name = local.provider_env_vars[var.provider]
238238

239239
# Model flag for aider command
240-
model_flag = var.ai_provider == "ollama" ? "--ollama-model" : "--model"
240+
model_flag = var.provider == "ollama" ? "--ollama-model" : "--model"
241241

242242
install_script = file("${path.module}/scripts/install.sh")
243243
start_script = file("${path.module}/scripts/start.sh")
@@ -269,9 +269,9 @@ module "agentapi" {
269269
echo -n '${base64encode(local.start_script)}' | base64 -d > /tmp/start.sh
270270
chmod +x /tmp/start.sh
271271
AIDER_START_DIRECTORY='${var.folder}' \
272-
ARG_API_KEY='${var.ai_api_key}' \
273-
ARG_AI_MODULE='${var.ai_model}' \
274-
ARG_AI_PROVIDER='${var.ai_provider}' \
272+
ARG_API_KEY='${var.credentials}' \
273+
ARG_MODEL='${var.model}' \
274+
ARG_PROVIDER='${var.provider}' \
275275
ARG_ENV_API_NAME_HOLDER='${local.env_var_name}' \
276276
AIDER_PROMPT='${var.aider_prompt}' \
277277
/tmp/start.sh

0 commit comments

Comments
 (0)