From 49169452fea09956eecbf7b29de0fdeaa0953b00 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 23 Jan 2024 15:52:46 +0800 Subject: [PATCH] fix: read config upstream type default value --- structure.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/structure.go b/structure.go index 16a6cca..37cc721 100644 --- a/structure.go +++ b/structure.go @@ -62,11 +62,11 @@ func readConfig(filepath string) Config { log.Fatalf("Can't parse upstream endpoint URL '%s': %s", upstream.Endpoint, err) } config.Upstreams[i].URL = endpoint - if upstream.Type == "" { - upstream.Type = "openai" + if config.Upstreams[i].Type == "" { + config.Upstreams[i].Type = "openai" } - if (upstream.Type != "openai") && (upstream.Type != "replicate") { - log.Fatalf("Unsupported upstream type '%s'", upstream.Type) + if (config.Upstreams[i].Type != "openai") && (config.Upstreams[i].Type != "replicate") { + log.Fatalf("Unsupported upstream type '%s'", config.Upstreams[i].Type) } }