mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
fixed 2 more switches for baseurl (#527)
This commit is contained in:
parent
a61310afc3
commit
4879e90e91
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user