feat: Extend SchemaProperty and Parameter structures with new fields

- Add Items field to SchemaProperty for better JSON Schema representation.
- Introduce Strict field to Parameter for enhanced parameter validation options.
- Improve data structure flexibility for future tool enhancements.
This commit is contained in:
Max 2025-03-22 18:29:27 +08:00
parent f28076f908
commit d67807ca2e

View file

@ -19,8 +19,9 @@ type Tool struct {
// SchemaProperty represents a JSON Schema property
type SchemaProperty struct {
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Items Parameter `json:"items,omitempty"`
}
// Parameter represents the parameters field in function calling format
@ -29,6 +30,7 @@ type Parameter struct {
Properties map[string]SchemaProperty `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
AdditionalProperties bool `json:"additionalProperties"`
Strict bool `json:"strict,omitempty"`
}
// Example returns a formatted example of how to use this tool