From 3ace9dd9974555b7b3b81de7036f044a80b0bd9c Mon Sep 17 00:00:00 2001 From: Kevin Jayne Date: Sat, 21 Dec 2024 19:01:41 -0500 Subject: [PATCH] V0.4.2 (#44) * rm tts debug * version update * update gha * docker build * go mod tidy * rm play audio to test on arm processor * rm play audio to test on arm processor * clean dockerfile * update goai * Release v0.4.2 --- .github/README.md | 2 +- cmd/http.go | 50 ------------------------------------- cmd/root.go | 2 +- go.mod | 2 +- go.sum | 2 ++ helm/Chart.yaml | 4 +-- helm/values.production.yaml | 2 +- 7 files changed, 8 insertions(+), 56 deletions(-) diff --git a/.github/README.md b/.github/README.md index 098c547..9724d23 100644 --- a/.github/README.md +++ b/.github/README.md @@ -73,7 +73,7 @@ ponder image "a ferocious cat with wings and fire" Ponder GitHub: https://github.com/seemywingz/ponder - App Version: v0.4.1 + App Version: v0.4.2 Ponder uses OpenAI's API to generate text responses to user input. Or whatever else you can think of. 🤔 diff --git a/cmd/http.go b/cmd/http.go index 5663efc..7df98b7 100644 --- a/cmd/http.go +++ b/cmd/http.go @@ -1,15 +1,11 @@ package cmd import ( - "encoding/json" - "errors" "fmt" "io" - "log" "net/http" "os" "path/filepath" - "strconv" "strings" "time" ) @@ -19,52 +15,6 @@ var httpClient = &http.Client{ Timeout: time.Second * 60, } -func httpMakeRequest(request *http.Request, responseJson interface{}) { - - // Make the HTTP Request - resp, err := httpClient.Do(request) - catchErr(err) - - // Read the JSON Response Body - jsonString, err := io.ReadAll(resp.Body) - catchErr(err) - - // Check for HTTP Errors - httpCatchErr(resp, jsonString) - if verbose { - b, err := io.ReadAll(resp.Body) - if err != nil { - log.Fatalln(err) - } - fmt.Println("🌐 HTTP Response", b) - } - - // Unmarshal the JSON Response Body into provided responseJson - err = json.Unmarshal([]byte(jsonString), &responseJson) - catchErr(err) - if verbose { - trace() - fmt.Println("🌐 HTTP Response String", string(jsonString)) - fmt.Println("🌐 HTTP Response JSON", responseJson) - } - // Close the HTTP Response Body - defer resp.Body.Close() -} - -func httpCatchErr(resp *http.Response, jsonString []byte) { - // Check for HTTP Response Errors - if resp.StatusCode != 200 { - catchErr(errors.New("API Error: " + strconv.Itoa(resp.StatusCode) + "\n" + string(jsonString))) - } -} - -// func httpDumpRequest(r *http.Request) { -// // Dump the HTTP Request -// dump, err := httputil.DumpRequest(r, true) -// catchErr(err) -// fmt.Println("🌐 HTTP Request", string(dump)) -// } - // download file from url and save to local directory func httpDownloadFile(url string, filePath string) string { // Replace spaces with underscores diff --git a/cmd/root.go b/cmd/root.go index 92126ee..fed56d8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,7 +15,7 @@ import ( ) var ponderMessages = []goai.Message{} -var APP_VERSION = "v0.4.1" +var APP_VERSION = "v0.4.2" var ai *goai.Client var verbose, diff --git a/go.mod b/go.mod index c899325..12906d9 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/alecthomas/chroma v0.10.0 github.com/bwmarrin/discordgo v0.28.1 github.com/pterm/pterm v0.12.80 - github.com/seemywingz/goai v0.0.0-20240428060229-cce9aefb4824 + github.com/seemywingz/goai v0.1.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 ) diff --git a/go.sum b/go.sum index ac7936e..24e6383 100644 --- a/go.sum +++ b/go.sum @@ -95,6 +95,8 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/seemywingz/goai v0.0.0-20240428060229-cce9aefb4824 h1:FZ9AyP936PADg5iW86XCXWqgHxjpxpd23BBS0b+194c= github.com/seemywingz/goai v0.0.0-20240428060229-cce9aefb4824/go.mod h1:mxBUzpw6bdDPvYXX/zAAWqvCDCJOPFvTufwGisOWt+k= +github.com/seemywingz/goai v0.1.0 h1:nkAQpVjEZyTQQJWH+ScfFkdER5JxKFmVUKq/7TMwR/8= +github.com/seemywingz/goai v0.1.0/go.mod h1:mxBUzpw6bdDPvYXX/zAAWqvCDCJOPFvTufwGisOWt+k= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 6a27bac..5189489 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: v0.4.1 +version: v0.4.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.4.1" +appVersion: "v0.4.2" diff --git a/helm/values.production.yaml b/helm/values.production.yaml index 434fb43..496bc33 100644 --- a/helm/values.production.yaml +++ b/helm/values.production.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: ghcr.io/seemywingz/ponder pullPolicy: Always - tag: v0.4.1 + tag: v0.4.2 imagePullSecrets: [] nameOverride: ""