BranchSession creates a new session branched from the parent at the given position. Messages up to (but not including) branchAtPosition are deep-cloned into the new session.
(parent *Session, branchAtPosition int)
| 21 | // BranchSession creates a new session branched from the parent at the given position. |
| 22 | // Messages up to (but not including) branchAtPosition are deep-cloned into the new session. |
| 23 | func BranchSession(parent *Session, branchAtPosition int) (*Session, error) { |
| 24 | return branchSessionWithTitle(parent, branchAtPosition, generateBranchTitle) |
| 25 | } |
| 26 | |
| 27 | // ForkSession is like BranchSession but uses fork-numbered titles |
| 28 | // ("<title> (fork 1)", "(fork 2)", …). It is intended for HTTP/API clients |