MCPcopy Index your code
hub / github.com/codehamr/codehamr / New

Function New

internal/llm/llm.go:238–246  ·  view source on GitHub ↗

New builds a Client governed by the caller's context, not http.Client.Timeout. That timeout is end-to-end (it covers body reads) and would kill a slow but legitimate SSE stream mid-flight on slow local backends. tui.Model's turnCtx is the single cancellation source; connect-level safety (DNS/TCP) is

(base, model, token string)

Source from the content-addressed store, hash-verified

236// legitimate SSE stream mid-flight on slow local backends. tui.Model's turnCtx
237// is the single cancellation source; connect-level safety (DNS/TCP) is already
238// bounded by Go's default Dialer (30s).
239func New(base, model, token string) *Client {
240 return &Client{
241 BaseURL: strings.TrimRight(base, "/"),
242 Model: model,
243 Token: token,
244 HTTP: &http.Client{},
245 IdleTimeout: idleTimeoutFromEnv(),
246 }
247}
248
249// ProbeResult holds what Probe extracts from a one-shot hello request: the

Calls 1

idleTimeoutFromEnvFunction · 0.85