mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
Remove fatals, don't know why I added these (#1642)
This commit is contained in:
parent
0df0c57639
commit
6de98ac3fb
@ -18,13 +18,13 @@ var _ AIBackend = GoogleBackend{}
|
|||||||
func (GoogleBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType] {
|
func (GoogleBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType] {
|
||||||
client, err := genai.NewClient(ctx, option.WithAPIKey(request.Opts.APIToken))
|
client, err := genai.NewClient(ctx, option.WithAPIKey(request.Opts.APIToken))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to create client: %v", err)
|
log.Printf("failed to create client: %v", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
model := client.GenerativeModel(request.Opts.Model)
|
model := client.GenerativeModel(request.Opts.Model)
|
||||||
if model == nil {
|
if model == nil {
|
||||||
log.Fatal("model not found")
|
log.Println("model not found")
|
||||||
client.Close()
|
client.Close()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user