改为oapi

This commit is contained in:
wood chen 2024-01-28 01:51:00 +08:00
parent 271ed0b7e0
commit 5b87b5e85b
2 changed files with 4 additions and 3 deletions

View File

@ -2,12 +2,13 @@ package initialization
import ( import (
"fmt" "fmt"
"github.com/spf13/pflag"
"os" "os"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"github.com/spf13/pflag"
"github.com/spf13/viper" "github.com/spf13/viper"
) )
@ -85,7 +86,7 @@ func LoadConfig(cfg string) *Config {
UseHttps: getViperBoolValue("USE_HTTPS", false), UseHttps: getViperBoolValue("USE_HTTPS", false),
CertFile: getViperStringValue("CERT_FILE", "cert.pem"), CertFile: getViperStringValue("CERT_FILE", "cert.pem"),
KeyFile: getViperStringValue("KEY_FILE", "key.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", ""), HttpProxy: getViperStringValue("HTTP_PROXY", ""),
AzureOn: getViperBoolValue("AZURE_ON", false), AzureOn: getViperBoolValue("AZURE_ON", false),
AzureApiVersion: getViperStringValue("AZURE_API_VERSION", "2023-03-15-preview"), AzureApiVersion: getViperStringValue("AZURE_API_VERSION", "2023-03-15-preview"),

View File

@ -6,7 +6,7 @@ import (
"time" "time"
) )
//https://api.openai.com/dashboard/billing/credit_grants // https://api.openai.com/dashboard/billing/credit_grants
type Billing struct { type Billing struct {
Object string `json:"object"` Object string `json:"object"`
TotalGranted float64 `json:"total_granted"` TotalGranted float64 `json:"total_granted"`