minimal working version of backend and cli
This commit is contained in:
@@ -5,8 +5,20 @@ import (
|
||||
"mind/internal/models"
|
||||
)
|
||||
|
||||
type ForkReq struct { ConversationID int64; Name string; HeadNodeID int64 }
|
||||
type ForkReq struct {
|
||||
ConversationID int64 `json:"conversation_id"`
|
||||
Name string `json:"name"`
|
||||
HeadNodeID int64 `json:"head_node_id"`
|
||||
}
|
||||
|
||||
func (g *Glue) ForkBranch(ctx context.Context, fr ForkReq) (models.Branch, error) {
|
||||
return g.repo.CreateOrGetBranch(ctx, fr.ConversationID, fr.Name, fr.HeadNodeID)
|
||||
}
|
||||
|
||||
func (g *Glue) DeleteBranch(ctx context.Context, conversationID int64, name string) error {
|
||||
return g.repo.DeleteBranch(ctx, conversationID, name)
|
||||
}
|
||||
|
||||
func (g *Glue) ListBranches(ctx context.Context, conversationID int64) ([]models.Branch, error) {
|
||||
return g.repo.ListBranches(ctx, conversationID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user