feat: giving agent enough information to add to list instead of creating one

This commit is contained in:
2025-07-29 12:14:45 +01:00
parent ee109f05a0
commit 3d05ff708e
2 changed files with 13 additions and 5 deletions

View File

@ -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"`

View File

@ -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
} }