mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
fixed 2 more switches for baseurl (#527)
This commit is contained in:
@@ -2683,7 +2683,7 @@ func doOpenAICmdInfoCompletion(cmd *sstore.CmdType, clientId string, opts *sstor
|
||||
}()
|
||||
var ch chan *packet.OpenAIPacketType
|
||||
var err error
|
||||
if opts.APIToken == "" {
|
||||
if opts.BaseURL == "" && opts.APIToken == "" {
|
||||
var conn *websocket.Conn
|
||||
ch, conn, err = openai.RunCloudCompletionStream(ctx, clientId, opts, prompt)
|
||||
if conn != nil {
|
||||
|
||||
@@ -144,7 +144,7 @@ func RunCompletionStream(ctx context.Context, opts *sstore.OpenAIOptsType, promp
|
||||
if opts.Model == "" {
|
||||
return nil, fmt.Errorf("no openai model specified")
|
||||
}
|
||||
if opts.APIToken == "" {
|
||||
if opts.BaseURL == "" && opts.APIToken == "" {
|
||||
return nil, fmt.Errorf("no api token")
|
||||
}
|
||||
clientConfig := openaiapi.DefaultConfig(opts.APIToken)
|
||||
|
||||
Reference in New Issue
Block a user