Skip to content

Commit

Permalink
feat: Managed policy arn
Browse files Browse the repository at this point in the history
Managed policy arn for user promt
  • Loading branch information
omer-topal committed Dec 26, 2024
1 parent 4718d56 commit 860b166
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/ai/user_promt.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var UserPromptSchema = map[string]interface{}{
},
"policy": map[string]interface{}{
"type": []string{"string", "null"},
"description": "The name of the policy. If it's too vague, return null. If the user input does not provide any meaningful context, the model must not guess a policy",
"description": "The name of the policy. If it's too vague, return null. If the user input does not provide any meaningful context, the model must not guess a policy. For Managed policies, use the arn foe example: arn:aws:iam::aws:policy/AdministratorAccess.",
},
"confidence": map[string]interface{}{
"type": "integer",
Expand Down Expand Up @@ -171,7 +171,7 @@ func GenerateCLICommand(response GPTResponse) string {

if response.Principal != nil {
if val, ok := response.Principal["type"]; ok && val != "" {
flags = append(flags, fmt.Sprintf("%s", val))
flags = append(flags, val)
if val == "users" {
flags = append(flags, "--user")
} else if val == "groups" {
Expand All @@ -181,7 +181,7 @@ func GenerateCLICommand(response GPTResponse) string {
}
}
if val, ok := response.Principal["name"]; ok && val != "" {
flags = append(flags, fmt.Sprintf("%s", val))
flags = append(flags, val)
}
}

Expand Down

0 comments on commit 860b166

Please sign in to comment.