fix: inject current date into WebSearchTool description
Make WebSearchTool.Description() dynamic so the LLM sees today's date exactly at the point where it constructs search queries. Previously, the static description caused the model to default to its training-cutoff year for time-relative queries (e.g. "yesterday's AI news"). Fixes #754
This commit is contained in:
parent
094d65916d
commit
771169e32f
1 changed files with 1 additions and 1 deletions
|
|
@ -449,7 +449,7 @@ func (t *WebSearchTool) Name() string {
|
|||
}
|
||||
|
||||
func (t *WebSearchTool) Description() string {
|
||||
return "Search the web for current information. Returns titles, URLs, and snippets from search results."
|
||||
return fmt.Sprintf("Search the web for current information. Returns titles, URLs, and snippets from search results. Today's date is %s. When constructing queries about recent events, use this date as reference.", time.Now().Format("2006-01-02"))
|
||||
}
|
||||
|
||||
func (t *WebSearchTool) Parameters() map[string]any {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue