Skip to content
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

An error occurred while attempting to correct template errors via AI #2253

Open
Finenyaco opened this issue Mar 15, 2024 · 0 comments
Open
Labels
bug Something isn't working in a real release

Comments

@Finenyaco
Copy link

Describe the bug

An error occurred while attempting to correct template completions via AI

Steps to reproduce

  1. Fill in the OpenAI token in the settings.
  2. Go to Operations -> Templates -> AI Draft Template
  3. Generate a template and click 'Correction'.

Result

  1. An error occurred.
image
2024-03-15T01:18:09.056Z	D	correction message is not in the format requested by the prompt. output:
{
"corrected": "
provider \"alicloud\" {
  access_key = \"your_access_key\"
  secret_key = \"your_secret_key\"
  region     = \"ap-southeast-1\"
}

resource \"alicloud_vpc\" \"my_vpc\" {
  name       = \"my-vpc\"
  cidr_block = \"10.0.0.0/16\"
}

resource \"alicloud_vswitch\" \"my_vswitch\" {
  vpc_id            = alicloud_vpc.my_vpc.id
  cidr_block        = \"10.0.1.0/24\"
  availability_zone = \"cn-hangzhou-b\"
}

resource \"alicloud_instance\" \"my_instance\" {
  image_id          = \"ubuntu_18_04_64_20G_alibase_20200319.vhd\"
  instance_type     = \"ecs.t5-lc1m1.small\"
  security_groups   = [\"default\"]
  vswitch_id        = alicloud_vswitch.my_vswitch.id
  internet_charge_type = \"PayByTraffic\"
  internet_max_bandwidth_out = 5
}
",
"explanation": "Fixed the typo in 'vswitch_id' attribute of alicloud_instance resource. Corrected 'alicloud_vswitch.my_vswicth.id' to 'alicloud_vswitch.my_vswitch.id'."
}
2024-03-15T01:18:09.056Z	E	api	error requesting POST /v1/template-completions/_/correct: 1 error occurred:
	* failed to parse correction advice


github.com/seal-io/walrus/pkg/apis/runtime.erroring
	github.com/seal-io/walrus/pkg/apis/runtime/middleware_error.go:45
github.com/gin-gonic/gin.(*Context).Next
	github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/seal-io/walrus/pkg/apis/runtime.recovering
	github.com/seal-io/walrus/pkg/apis/runtime/middleware_recovery.go:39
github.com/gin-gonic/gin.(*Context).Next
	github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/seal-io/walrus/pkg/apis/runtime.observing
	github.com/seal-io/walrus/pkg/apis/runtime/middleware_observation.go:89
github.com/gin-gonic/gin.(*Context).Next
	github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	github.com/gin-gonic/gin@v1.9.1/gin.go:576
github.com/seal-io/walrus/pkg/apis/runtime.(*Router).ServeHTTP
	github.com/seal-io/walrus/pkg/apis/runtime/router.go:194
net/http.serverHandler.ServeHTTP
	net/http/server.go:2938
net/http.initALPNRequest.ServeHTTP
	net/http/server.go:3546
net/http.(*http2serverConn).runHandler
	net/http/h2_bundle.go:6193
2024-03-15T01:18:09.056Z	D	api	500 | HTTP/2.0 |      769 B |      106 B |  5.440252843s |   192.168.247.1 | POST    /v1/template-completions/_/correct

Expected behavior

Environment

  • Walrus version: v0.6.0-rc2

Additional context
Add any other context about the problem here.

@Finenyaco Finenyaco added the bug Something isn't working in a real release label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in a real release
Projects
None yet
Development

No branches or pull requests

1 participant