feat: giving agent enough information to add to list instead of creating one
This commit is contained in:
@ -162,7 +162,6 @@ const listTools = `
|
|||||||
}
|
}
|
||||||
]`
|
]`
|
||||||
|
|
||||||
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"`
|
||||||
|
@ -86,12 +86,21 @@ func (m ListModel) Save(ctx context.Context, userId uuid.UUID, name string, desc
|
|||||||
return listWithItems, err
|
return listWithItems, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m ListModel) List(ctx context.Context, userId uuid.UUID) ([]model.Lists, error) {
|
func (m ListModel) List(ctx context.Context, userId uuid.UUID) ([]ListWithItems, error) {
|
||||||
stmt := Lists.SELECT(Lists.AllColumns).
|
getListsWithItems := SELECT(
|
||||||
|
Lists.AllColumns,
|
||||||
|
Schemas.AllColumns,
|
||||||
|
SchemaItems.AllColumns,
|
||||||
|
).
|
||||||
|
FROM(
|
||||||
|
Lists.
|
||||||
|
INNER_JOIN(Schemas, Schemas.ListID.EQ(Lists.ID)).
|
||||||
|
INNER_JOIN(SchemaItems, SchemaItems.SchemaID.EQ(Schemas.ID)),
|
||||||
|
).
|
||||||
WHERE(Lists.UserID.EQ(UUID(userId)))
|
WHERE(Lists.UserID.EQ(UUID(userId)))
|
||||||
|
|
||||||
lists := []model.Lists{}
|
lists := []ListWithItems{}
|
||||||
err := stmt.QueryContext(ctx, m.dbPool, &lists)
|
err := getListsWithItems.QueryContext(ctx, m.dbPool, &lists)
|
||||||
|
|
||||||
return lists, err
|
return lists, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user