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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user