]> git.giacomolli.uk - onechat/blobdiff - subagent.go
Give the root agent the schedule tools
[onechat] / subagent.go
index 596c03818510460456b8cbead078bf0051aeee3f..2e50d5d87ffdd05e18581f7a9c71e1d74426d864 100644 (file)
@@ -169,6 +169,14 @@ func (a *Subagent) Flush(ctx context.Context) error {
        return a.syncer.Flush(ctx)
 }
 
        return a.syncer.Flush(ctx)
 }
 
+// First returns the first message of the log.
+func (a *Subagent) First() (Message, error) {
+       a.mutex.Lock()
+       defer a.mutex.Unlock()
+
+       return a.log.Message(0)
+}
+
 // Show returns the whole log, each message as "i|kind: text", with a blank line
 // between messages.
 func (a *Subagent) Show() (string, error) {
 // Show returns the whole log, each message as "i|kind: text", with a blank line
 // between messages.
 func (a *Subagent) Show() (string, error) {