New returns a Client targeting baseURL with an optional bearer token.
(baseURL, apiKey string)
| 36 | |
| 37 | // New returns a Client targeting baseURL with an optional bearer token. |
| 38 | func New(baseURL, apiKey string) *Client { |
| 39 | return &Client{ |
| 40 | BaseURL: strings.TrimRight(baseURL, "/"), |
| 41 | APIKey: apiKey, |
| 42 | HTTPClient: httpclient.NewWithTimeout(60 * time.Second), |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // Compile-time assertion. |
| 47 | var _ localaitools.LocalAIClient = (*Client)(nil) |