24 lines
450 B
Go
24 lines
450 B
Go
package builder
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
|
|
"screenmark/screenmark/.gen/haystack/agents/model"
|
|
. "screenmark/screenmark/.gen/haystack/agents/table"
|
|
|
|
. "github.com/go-jet/jet/v2/postgres"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type AgentModel struct {
|
|
dbPool *sql.DB
|
|
}
|
|
|
|
func (m AgentModel) SaveTool(ctx context.Context, agentId uuid.UUID, tool string) (model.Tools, error) {
|
|
insertToolStmt := Tools.
|
|
INSERT(Tools.Tool).
|
|
VALUES(Json(tool))
|
|
}
|