-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
38 lines (29 loc) · 937 Bytes
/
config.go
File metadata and controls
38 lines (29 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package wavespeed
import "os"
// APIConfig holds API client configuration options.
type APIConfig struct {
// Authentication
APIKey string
// API base URL
BaseURL string
// Connection timeout in seconds
ConnectionTimeout float64
// Total API call timeout in seconds
Timeout float64
// Maximum number of retries for the entire operation (task-level retries)
MaxRetries int
// Maximum number of retries for individual HTTP requests (connection errors, timeouts)
MaxConnectionRetries int
// Base interval between retries in seconds (actual delay = RetryInterval * attempt)
RetryInterval float64
}
// API is the global API configuration instance.
var API = &APIConfig{
APIKey: os.Getenv("WAVESPEED_API_KEY"),
BaseURL: "https://api.wavespeed.ai",
ConnectionTimeout: 10.0,
Timeout: 36000.0,
MaxRetries: 0,
MaxConnectionRetries: 5,
RetryInterval: 1.0,
}