feat: initial attempt to create a schema
This commit is contained in:
@ -24,11 +24,10 @@ An example of lists are:
|
|||||||
- Movies
|
- Movies
|
||||||
- Books
|
- Books
|
||||||
|
|
||||||
You must call "listLists" to see which available lists are already available.
|
Another one of your tasks is to create a schema for this list. This should contain information that this, and following
|
||||||
|
pictures contain. Be specific but also generic. You should use the parameters in "createList" to create this schema.
|
||||||
|
|
||||||
*Important*
|
You must call "listLists" to see which available lists are already available.
|
||||||
You must not create lists with the names Locations, Events, Contacts or Notes. You can create lists adjacent to those, but
|
|
||||||
those lists are dealt with seperately.
|
|
||||||
|
|
||||||
**Tools:**
|
**Tools:**
|
||||||
* think: Internal reasoning/planning step.
|
* think: Internal reasoning/planning step.
|
||||||
@ -84,7 +83,23 @@ const listTools = `
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A simple description of this list."
|
"description": "A simple description of this list."
|
||||||
}
|
},
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"key": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The name of the key for this specific field. Similar to a column in a database"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["string", "number", "boolean"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"required": ["name", "description"]
|
"required": ["name", "description"]
|
||||||
}
|
}
|
||||||
@ -126,6 +141,10 @@ type listListsArguments struct{}
|
|||||||
type createListArguments struct {
|
type createListArguments struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Desription string `json:"description"`
|
Desription string `json:"description"`
|
||||||
|
Schema []struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Value string `json:"value"`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type addToListArguments struct {
|
type addToListArguments struct {
|
||||||
ListID string `json:"listId"`
|
ListID string `json:"listId"`
|
||||||
@ -154,6 +173,8 @@ func NewListAgent(log *log.Logger, listModel models.ListModel) client.AgentClien
|
|||||||
return model.Events{}, err
|
return model.Events{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Debug("Create list", "schema", args.Schema)
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
savedList, err := listModel.Save(ctx, info.UserId, args.Name, args.Desription)
|
savedList, err := listModel.Save(ctx, info.UserId, args.Name, args.Desription)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user