MCPcopy Index your code
hub / github.com/TanStack/ai / getLastAssistantMessage

Function getLastAssistantMessage

testing/e2e/tests/helpers.ts:80–85  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

78}
79
80export async function getLastAssistantMessage(page: Page): Promise<string> {
81 const messages = page.getByTestId('assistant-message')
82 const count = await messages.count()
83 if (count === 0) return ''
84 return messages.nth(count - 1).innerText()
85}
86
87/** Wait for an assistant message containing specific text (useful for tool-calling where
88 * the agentic loop produces multiple responses and waitForResponse returns too early) */

Calls 1

countMethod · 0.80

Tested by

no test coverage detected