mirror of
https://github.com/coalaura/whiskr.git
synced 2025-12-02 20:22:52 +00:00
incorrect time calculation for search
This commit is contained in:
4
exa.go
4
exa.go
@@ -134,7 +134,7 @@ func ExaRunSearch(ctx context.Context, args SearchWebArguments) (*ExaResults, er
|
|||||||
case "month":
|
case "month":
|
||||||
data["startPublishedDate"] = daysAgo(30)
|
data["startPublishedDate"] = daysAgo(30)
|
||||||
case "year":
|
case "year":
|
||||||
data["startPublishedDate"] = daysAgo(356)
|
data["startPublishedDate"] = daysAgo(365)
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := NewExaRequest(ctx, "/search", data)
|
req, err := NewExaRequest(ctx, "/search", data)
|
||||||
@@ -168,5 +168,5 @@ func ExaRunContents(ctx context.Context, args FetchContentsArguments) (*ExaResul
|
|||||||
}
|
}
|
||||||
|
|
||||||
func daysAgo(days int) string {
|
func daysAgo(days int) string {
|
||||||
return time.Now().Add(time.Duration(days) * 24 * time.Hour).Format(time.DateOnly)
|
return time.Now().Add(-time.Duration(days) * 24 * time.Hour).Format(time.DateOnly)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func GetSearchTools() []openrouter.Tool {
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Number of results to return (3-12). Default is 6.",
|
"description": "Number of results to return (3-12). Default is 6.",
|
||||||
"minimum": 3,
|
"minimum": 3,
|
||||||
"maximum": 10,
|
"maximum": 12,
|
||||||
},
|
},
|
||||||
"intent": map[string]any{
|
"intent": map[string]any{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
Reference in New Issue
Block a user