mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Add WOTD language rotation, fancy word detection, arena improvements, and death consolidation
- Rotate WOTD between Portuguese, French, and English daily with cognate filtering - Replace LLM-based fancy word detection with DreamDict frequency data (batch API + cache) - Track fancy word usage per user and add Wordsmith archetype - Restore full arena combat flavor text and add player miss actions - Consolidate death logic into Kill() method with 2-hour lockout - Fix arena death XP grant missing level-up check - Fix LLM wotd_used classification by injecting actual WOTD into prompt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -189,6 +190,31 @@ func (c *Client) Frequency(word, lang string) (int, error) {
|
||||
return result.Frequency, nil
|
||||
}
|
||||
|
||||
// FrequencyBatch returns frequency scores for multiple words in a single request.
|
||||
func (c *Client) FrequencyBatch(words []string, lang string) (map[string]int, error) {
|
||||
u := c.baseURL + "/frequency/batch?" + url.Values{
|
||||
"words": {strings.Join(words, ",")},
|
||||
"lang": {lang},
|
||||
}.Encode()
|
||||
resp, err := c.httpClient.Get(u)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("dreamdict: frequency batch: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("dreamdict: frequency batch: status %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
var result struct {
|
||||
Frequencies map[string]int `json:"frequencies"`
|
||||
}
|
||||
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||
return nil, fmt.Errorf("dreamdict: frequency batch: decode: %w", err)
|
||||
}
|
||||
return result.Frequencies, nil
|
||||
}
|
||||
|
||||
// Health checks if the DreamDict service is reachable and returns stats.
|
||||
func (c *Client) Health() (*HealthResponse, error) {
|
||||
resp, err := c.httpClient.Get(c.baseURL + "/health")
|
||||
|
||||
Reference in New Issue
Block a user