package llm // RequestOption configures a single completion request. type RequestOption func(*requestConfig) type requestConfig struct { tools *ToolBox temperature *float64 maxTokens *int topP *float64 stop []string } // WithTools attaches a toolbox to the request. func WithTools(tb *ToolBox) RequestOption { return func(c *requestConfig) { c.tools = tb } } // WithTemperature sets the sampling temperature. func WithTemperature(t float64) RequestOption { return func(c *requestConfig) { c.temperature = &t } } // WithMaxTokens sets the maximum number of tokens to generate. func WithMaxTokens(n int) RequestOption { return func(c *requestConfig) { c.maxTokens = &n } } // WithTopP sets the nucleus sampling parameter. func WithTopP(p float64) RequestOption { return func(c *requestConfig) { c.topP = &p } } // WithStop sets stop sequences. func WithStop(sequences ...string) RequestOption { return func(c *requestConfig) { c.stop = sequences } }