gofireflyio / aiac Goto Github PK
View Code? Open in Web Editor NEWArtificial Intelligence Infrastructure-as-Code Generator.
License: Apache License 2.0
Artificial Intelligence Infrastructure-as-Code Generator.
License: Apache License 2.0
Instead of creating the hcl with values and this note, such as:
region = "us-west-2"
and
Note: Make sure to replace the
ami,
key_name, and
regionvalues with your own values.
How about defining variables:
region = "{region1}"
(The number in the variable is when multiple regions are defined, which is typical of production hcl. Some would prefer {primary_region}. So a post-processor could make those changes if the values inserted are consistent.
When using aiac
with a different backend, such as Azure OpenAI one has to do something like this:
aiac get --api-version="2023-05-15" --url="https://tenant.openai.azure.com/openai/deployments/testdeployment" terraform code for ssm paramter
The --flags have to go after the aiac get
piece, and that makes it difficult to use aliases to make the above command shorter.
Could you consider using a config file instead, so we don't have to rely on aliases? Or allow putting the --flags before the subcommand (the only other subcommand I'm aware of wouldn't be impacted by it).
Would be great to have a feature where you can copy the generated output (e.g. CLI) to the clipboard, to be able to reuse it right away!
Hello team,
I encountered an error when attempting to run the command aiac get
The error message I received was:
$ aiac get dockerfile for nodejs with comments
Request failed: failed sending prompt: [insufficient_quota] You exceeded your current quota, please check your plan and billing details.
I have yet to try the tool, and I'm wondering if there are any restrictions in place right now.
Thanks,
Seems latest release has some packaging issue.
Both brew and go installs are failing, with below errors
❯ brew install gofirefly/aiac/aiac
==> Tapping gofirefly/aiac
Cloning into '/opt/homebrew/Library/Taps/gofirefly/homebrew-aiac'...
remote: Repository not found.
fatal: repository 'https://github.com/gofirefly/homebrew-aiac/' not found
Error: Failure while executing; `git clone https://github.com/gofirefly/homebrew-aiac /opt/homebrew/Library/Taps/gofirefly/homebrew-aiac --origin=origin --template= --config core.fsmonitor=false` exited with 128.
❯ go install github.com/gofirefly/aiac/v3@latest
go: github.com/gofirefly/aiac/v3@latest: module github.com/gofirefly/aiac/v3: git ls-remote -q origin in /Users/user/go/pkg/mod/cache/vcs/42614cb9d22f340d881bf8d7d99410e2728e11f8bb438ec3e9920787583357a3: exit status 128:
remote: Repository not found.
fatal: repository 'https://github.com/gofirefly/aiac/' not found
Working at a corporate behemoth, we are stuck with Azure due to compliance-related reasons, unable to use OpenAI as provided by its creators.
However, as far as I can tell, the OpenAI provided by Azure is supposed to be the same under the hood - could you please consider supporting Azure OpenAI as well?!
Request failed: failed sending prompt: [tokens] Rate limit reached for default-text-davinci-003 in organization org-mdLxX2PcWp5fsPwZXFbdHNdI on tokens per min. Limit: 150000.000000 / min. Current: 152160.000000 / min. Contact [email protected] if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.
after cloning the repository using git clone command
i ran go build
command inside aiac directory
it gives
javedkumail@DESKTOP-HESPAQG:~/aiac$ go build go: downloading github.com/alecthomas/kong v0.7.1 go: downloading github.com/adrg/xdg v0.4.0 go: downloading github.com/briandowns/spinner v1.19.0 go: downloading github.com/fatih/color v1.7.0 go: downloading github.com/google/uuid v1.1.2 go: downloading github.com/ido50/requests v1.5.0 go: downloading github.com/manifoldco/promptui v0.9.0 go: downloading github.com/mattn/go-colorable v0.1.2 go: downloading github.com/mattn/go-isatty v0.0.16 go: downloading go.uber.org/zap v1.24.0 go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e go: downloading golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab go: downloading go.uber.org/atomic v1.10.0 go: downloading go.uber.org/multierr v1.8.0 **error obtaining VCS status: exit status 128** Use -buildvcs=false to disable VCS stamping.
it gives error obtaining VCS status
even after running go build -buildvcs=false
i get this
go build github.com/gofireflyio/aiac: copying /tmp/go-build1528433998/b001/exe/a.out: open aiac: permission denied
aiac get bash script that shows current year
#!/bin/bash
#This script will print the current year
echo "The current year is $(date +%!Y(MISSING))"
this MISSING also occurs at sql scripts etc.
Sorry for the confusion, but I'm curious why you've decided to publish this now? I'd love to use something like this, but every time I give at an instruction I actually care about it's unable to run it? When I copy and paste use cases from the doc directly it works fine. For example none of these commands have run, though they run trivially on ChatGPT:
aiac get python that authenticates to aws
aiac get dockerfile for typescript program that runs terraformer from the command line
aiac get circleci orb for validating terraform json with opa
They all return Request failed: failed sending prompt: [server_error] The server had an error while processing your request. Sorry about that!
But this works fine:
aiac get terraform for AWS EC2
# Create a main.tf file
provider "aws" {
region = "us-east-1"
}
resource "aws_instance" "ec2-instance" {
ami = "ami-08d798f297f89fce1"
instance_type = "t2.micro"
tags = {
Name = "test-instance"
}
}
So I'm wondering what you're looking for from the community? I'm happy to be an early adopter, but how? I feel like my commands above are correct.
Subject says it all.
Following the directions i installed via brew (after brew upgrade) and getting the following error message
ic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x100b22e4c]
goroutine 1 [running]:
github.com/gofireflyio/aiac/v4/libaiac/openai.(*Conversation).Send(0x14000079130, {0x100d3a3b0, 0x140000280f8}, {0x140000239c0, 0x39}, {0x0, 0x0, 0x0?})
/home/runner/work/aiac/aiac/libaiac/openai/chat.go:65 +0x21c
main.generateCode({{0x100b63033, 0x6}, {{0x0, 0x0}}, {{0x0, 0x0}, {0x14000027c60, 0x19}, {0x0, 0x0}, ...}, ...})
/home/runner/work/aiac/aiac/main.go:197 +0x470
main.main()
/home/runner/work/aiac/aiac/main.go:88 +0x4d0
Unless there's an aiac branch I should be using. The @latest aiac v4 build seems to have things stubbed in, but requests are failing and it's falling back to quasi-OPENAI mode. Happy to help.
Hi
Can we have save and continue/chat feature to generate more code without losing context.
e.g.:
create python app >>save and continue>> create requirements.txt for generated code >>save and continue>> create dockerfile for the python app >>save and continue>> create jenkinsfile for cicd pipeline.
The readme says to run go install github.com/gofireflyio/aiac/v2
, but that produces an error:
go install: version is required when current directory is not in a module
Try 'go install github.com/gofireflyio/aiac/v2@latest' to install the latest version
Attempting the suggested command produces a lot of output (I don't see any errors, looks like warnings) and doesn't add a binary to my $GOBIN
folder.
panic: clipboard: cannot use when CGO_ENABLED=0
goroutine 1 [running]:
golang.design/x/clipboard.initialize(...)
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard_nocgo.go:9
golang.design/x/clipboard.Init.func1()
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard.go:107 +0x2c
sync.(*Once).doSlow(0x1400002e480?, 0x140000752b0?)
/opt/hostedtoolcache/go/1.19.8/x64/src/sync/once.go:74 +0x104
sync.(*Once).Do(...)
/opt/hostedtoolcache/go/1.19.8/x64/src/sync/once.go:65
golang.design/x/clipboard.Init()
/home/runner/go/pkg/mod/golang.design/x/[email protected]/clipboard.go:106 +0x3c
main.generateCode({{{0x0, 0x0}}, {{0x140000286c0, 0x33}, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0, ...}, ...})
/home/runner/work/aiac/aiac/main.go:147 +0x300
main.main()
/home/runner/work/aiac/aiac/main.go:75 +0x4d0
CGO_ENABLED=1 # doesn't help
git clone && go build works.
It would be cool if it supported https://ollama.ai/ so that we could run it using local models :)
Go version : go version go1.20.3 linux/amd64
Hi
I encountered an error while compiling the Aiac program in Go. The error message states that "X11/Xlib.h: No such file or directory" is missing. Can you please help me resolve this issue?
Thank you.
go: downloading golang.design/x/clipboard v0.7.0
go: downloading github.com/fatih/color v1.7.0
go: downloading github.com/rodaine/table v1.1.0
go: downloading github.com/alecthomas/kong v0.7.1
go: downloading github.com/briandowns/spinner v1.19.0
go: downloading github.com/manifoldco/promptui v0.9.0
go: downloading github.com/ido50/requests v1.5.0
go: downloading github.com/mattn/go-isatty v0.0.16
go: downloading github.com/mattn/go-colorable v0.1.2
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
go: downloading go.uber.org/zap v1.24.0
go: downloading golang.org/x/sys v0.5.0
go: downloading go.uber.org/multierr v1.8.0
go: downloading go.uber.org/atomic v1.10.0
# golang.design/x/clipboard
clipboard_linux.c:15:10: erreur fatale: X11/Xlib.h : No such file or directory
15 | #include <X11/Xlib.h>
| ^~~~~~~~~~~~
compilation terminée.
I'm not familiar with go, or I would do it myself.
The idea is to have a way to provide aiac with a way to customize urls, in order to be able to use Azure OpenAI URLs.
The API is the same, just the url has two variable parts, and the header containing the token is different.
As an example, the Azure tenant url is https://tenant.openai.azure.com/
, and then the path for our model is my-gpt-35-turbo-deployment
. The tenant
and my-gpt-35-turbo-deployment
are customizable.
The key should be in the header api-key
.
Reference from Azure:
https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference
14:32: alac ⧲ docker pull ghcr.io/gofireflyio/aiac
Trying to pull ghcr.io/gofireflyio/aiac:latest...
Getting image source signatures
Copying blob 6ac35d9e53ae done
Copying blob c158987b0551 done
Copying blob 1a6908c7faea done
Copying config e0d50b0000 done
Writing manifest to image destination
Storing signatures
e0d50b0000c33454954a39d6092b35641870a94bf375d3d25ee1971bc397464b
14:32: alac ⧲ docker run -it -e OPENAI_API_KEY=< REDACTED > ghcr.io/gofireflyio/aiac get terraform for ec2
Request failed: failed sending prompt: [insufficient_quota] You exceeded your current quota, please check your plan and billing details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.