"vscode:/vscode.git/clone" did not exist on "3ff5e8c8d7c1f39c6f499e61407678cd61623e99"
Commit 8a41b244 authored by Matt Williams's avatar Matt Williams
Browse files

add golang gen


Signed-off-by: default avatarMatt Williams <m@technovangelist.com>
parent fc6b49be
package main
import (
"bytes"
"fmt"
"net/http"
"os"
"io"
"log"
)
func main() {
body := []byte(`{"model":"mistral"}`)
resp, err := http.Post("http://localhost:11434/api/generate", "application/json", bytes.NewBuffer(body))
if err != nil {
fmt.Print(err.Error())
os.Exit(1)
}
responseData, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(responseData))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment