fix: address review findings
- install.sh: verify SHA-256 checksum before installing binary - install.sh: fallback to ~/.local/bin if /usr/local/bin not writable - install.sh: use sed instead of grep for POSIX-safe JSON parsing - release.yml: remove jq dependency, parse release ID with sed - llm: make temperature configurable via --llm-temperature / LLM_TEMPERATURE - llm: add WithTemperature builder method on Client - llm: omit temperature from request when zero (uses server default)
This commit is contained in:
@@ -14,6 +14,7 @@ type Client struct {
|
||||
BaseURL string
|
||||
APIKey string
|
||||
Model string
|
||||
Temperature float64
|
||||
HTTP *http.Client
|
||||
}
|
||||
|
||||
@@ -27,6 +28,13 @@ func NewClient(baseURL, apiKey, model string) *Client {
|
||||
}
|
||||
}
|
||||
|
||||
// WithTemperature sets the temperature for LLM requests.
|
||||
// If not set (zero value), the server default is used.
|
||||
func (c *Client) WithTemperature(t float64) *Client {
|
||||
c.Temperature = t
|
||||
return c
|
||||
}
|
||||
|
||||
// Message represents a chat message.
|
||||
type Message struct {
|
||||
Role string `json:"role"`
|
||||
@@ -53,6 +61,7 @@ type ChatResponse struct {
|
||||
func (c *Client) Complete(messages []Message) (string, error) {
|
||||
reqBody := ChatRequest{
|
||||
Model: c.Model,
|
||||
Temperature: c.Temperature,
|
||||
Messages: messages,
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user