From 5b87b5e85b1e597221fa5f42b3f131913442d65d Mon Sep 17 00:00:00 2001 From: wood chen <95951386+woodchen-ink@users.noreply.github.com> Date: Sun, 28 Jan 2024 01:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=BAoapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/initialization/config.go | 5 +++-- code/services/openai/billing.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/initialization/config.go b/code/initialization/config.go index 8e2079e..0c64d34 100644 --- a/code/initialization/config.go +++ b/code/initialization/config.go @@ -2,12 +2,13 @@ package initialization import ( "fmt" - "github.com/spf13/pflag" "os" "strconv" "strings" "sync" + "github.com/spf13/pflag" + "github.com/spf13/viper" ) @@ -85,7 +86,7 @@ func LoadConfig(cfg string) *Config { UseHttps: getViperBoolValue("USE_HTTPS", false), CertFile: getViperStringValue("CERT_FILE", "cert.pem"), KeyFile: getViperStringValue("KEY_FILE", "key.pem"), - OpenaiApiUrl: getViperStringValue("API_URL", "https://api.openai.com"), + OpenaiApiUrl: getViperStringValue("API_URL", "https://oapi.czl.net"), HttpProxy: getViperStringValue("HTTP_PROXY", ""), AzureOn: getViperBoolValue("AZURE_ON", false), AzureApiVersion: getViperStringValue("AZURE_API_VERSION", "2023-03-15-preview"), diff --git a/code/services/openai/billing.go b/code/services/openai/billing.go index 2148201..d3664c2 100644 --- a/code/services/openai/billing.go +++ b/code/services/openai/billing.go @@ -6,7 +6,7 @@ import ( "time" ) -//https://api.openai.com/dashboard/billing/credit_grants +// https://api.openai.com/dashboard/billing/credit_grants type Billing struct { Object string `json:"object"` TotalGranted float64 `json:"total_granted"`