add

AI-Driven Development
git clone git://git.lair.cx/add
Log | Files | Refs | README

README (1043B)


      1 # ADD; AI-Driven Development
      2 
      3 Because I am lazy.
      4 
      5 This program uses Huggingface Inference API. It's basically free-to-use, but I recommend pro plan, because it's much faster.
      6 
      7 
      8 # Getting started
      9 
     10 $ go install go.lair.cx/add/cmd/addgen@latest
     11 $ addgen --init # Generate sample configuration
     12 
     13 $ vi greetings.yaml
     14 
     15 
     16 ADD uses yaml to "define" the program.
     17 
     18 - name: Make Greetings
     19   type: Function
     20   input:
     21     - name: String
     22     - entered: 
     23   output:
     24     - message: String
     25   behavior: >
     26     This method creates a greetings message.
     27     If the entered variable is true, the message format is: "Hi, ${name}!"
     28     If the entered variable is false, the message format is: "Bye, ${name}!"
     29 
     30 
     31 Use `addgen [yaml]` to generate code.
     32 
     33 $ addgen greetings.yaml
     34 ```go
     35 // MakeGreeting generates a personalized greeting message based on the given name and whether the person has entered the room.
     36 func MakeGreeting(name string, entered bool) string {
     37 	if entered {
     38 		return fmt.Sprintf("Hi, %s!", name)
     39 	} else {
     40 		return fmt.Sprintf("Bye, %s!", name)
     41 	}
     42 }
     43 ```
     44