Skip to content

Commit efb9f97

Browse files
feat(adk): history entry support user input (#404)
1 parent fb62529 commit efb9f97

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

adk/flow.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ import (
2929
)
3030

3131
type HistoryEntry struct {
32-
AgentName string
33-
Message Message
32+
IsUserInput bool
33+
AgentName string
34+
Message Message
3435
}
3536

3637
type HistoryRewriter func(ctx context.Context, entries []*HistoryEntry) ([]Message, error)
@@ -227,6 +228,13 @@ func (a *flowAgent) genAgentInput(ctx context.Context, runCtx *runContext, skipT
227228
events := runCtx.Session.getEvents()
228229
historyEntries := make([]*HistoryEntry, 0)
229230

231+
for _, m := range input.Messages {
232+
historyEntries = append(historyEntries, &HistoryEntry{
233+
IsUserInput: true,
234+
Message: m,
235+
})
236+
}
237+
230238
for _, event := range events {
231239
if !belongToRunPath(event.RunPath, runPath) {
232240
continue

0 commit comments

Comments
 (0)