fixed 2 more switches for baseurl (#527)

This commit is contained in:
Cole Lashley 2024-03-28 13:14:05 -07:00 committed by GitHub
parent a61310afc3
commit 4879e90e91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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)