Coder Social home page Coder Social logo

gofireflyio / aiac Goto Github PK

View Code? Open in Web Editor NEW
3.3K 41.0 248.0 2.47 MB

Artificial Intelligence Infrastructure-as-Code Generator.

License: Apache License 2.0

Go 99.74% Dockerfile 0.26%
ai chatgpt iac openai pulumi terraform amazon-bedrock ollama llms

aiac's People

Contributors

dennislapchenko avatar eran-infralight avatar ido50 avatar junaid18183 avatar liavyona avatar martigit avatar yusadolat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiac's Issues

feature request: support Azure OpenAI

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?!

aiac doesn't work when installed via brew install on Mac arm

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.

Consider setting backend alternatives via config file, current signature makes for ungainly usage

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).

Geetting to many responses at once

Hello, i'm implementing the tool via docker and it works but i get too man results at once until it gives me a fail response:
image

I'm i doing something wrong?

Installing on Ubuntu CLI : ERROR Obtaining VCS status

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

Almost all the commands I give aiac don't work?

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.

encase example vars as {variable}

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.

Can't build - X11/Xlib.h : No such file or directory

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.

save and continue with chat feature in aiac

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.

Mac M2, installed via brew panic: runtime error: invalid memory address or nil pointer dereference

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

Formatting problem - MISSING

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.

`go install` command doesn't work...

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.

Following README Quick Start guide fails due to insufficient quota

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.
  • Do I need to be on a paid plan to use it? If so the README warrants updating to mention this.

Error: failed sending prompt - insufficient quota

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,

Packaging Issue

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

Support Azure OpenAI urls

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.