refactor(prompt): streamline context handling in templates

- Removed redundant instructions from the context template to simplify user guidance.
- Added context retrieval information to the system prompt, ensuring consistency in how context is presented across templates.
- Enhanced parameter casting to allow single strings to be treated as string arrays, improving flexibility in parameter handling.
- Adjusted minimum thought requirements in sequential thinking to allow for more varied input scenarios.
This commit is contained in:
wizardchen
2026-03-25 16:27:41 +08:00
committed by lyingbug
parent ae89871ac5
commit 1416217a0a
5 changed files with 29 additions and 9 deletions
+6
View File
@@ -68,6 +68,12 @@ func CastParams(args json.RawMessage, schema json.RawMessage) json.RawMessage {
// Returns (newValue, true) if a conversion was made, (val, false) otherwise.
func castValue(val interface{}, targetType string) (interface{}, bool) {
switch targetType {
case "array":
// Allow a single string to satisfy string-array parameters used by tools.
if s, ok := val.(string); ok {
return []string{s}, true
}
case "boolean":
if s, ok := val.(string); ok {
lower := strings.ToLower(s)