MCPcopy
hub / github.com/mudler/LocalAI / New

Function New

pkg/mcp/localaitools/httpapi/client.go:38–44  ·  view source on GitHub ↗

New returns a Client targeting baseURL with an optional bearer token.

(baseURL, apiKey string)

Source from the content-addressed store, hash-verified

36
37// New returns a Client targeting baseURL with an optional bearer token.
38func 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.
47var _ localaitools.LocalAIClient = (*Client)(nil)

Callers 4

RunMethod · 0.92
inprocLikeFromHTTPFunction · 0.92
parity_test.goFile · 0.92
client_test.goFile · 0.70

Calls 1

NewWithTimeoutFunction · 0.92

Tested by 1

inprocLikeFromHTTPFunction · 0.74