Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions libs/langgraph/src/lib/agent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,13 @@ export interface LangGraphAgent<T = unknown, ResolvedBag extends BagTemplate = B
reload: () => void;

/**
* Truncate the thread at the given assistant-message index and re-submit the
* preceding user message. Used by `<ngaf-chat>`'s regenerate action and any
* custom UI that wants the same semantics. Rejects if the agent is currently
* loading, if the index does not point at an assistant message, or if no
* preceding user message exists.
* Discards the assistant message at the given index AND all messages after
* it, then re-runs the agent against the trimmed conversation tail. The
* preceding user message (at index - 1) is preserved and re-submitted as
* the agent's input. No new user message is added to the history.
*
* Throws if the message at `index` is not 'assistant' role, or if the
* agent is currently loading another response.
*/
regenerate: (assistantMessageIndex: number) => Promise<void>;

Expand Down
Loading