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

Function createUIMessage

packages/ai-client/tests/test-utils.ts:9–15  ·  view source on GitHub ↗
(
  id: string,
  text: string = 'hello',
  role: UIMessage['role'] = 'user',
)

Source from the content-addressed store, hash-verified

7 * Build a minimal text {@link UIMessage} for tests.
8 */
9export function createUIMessage(
10 id: string,
11 text: string = 'hello',
12 role: UIMessage['role'] = 'user',
13): UIMessage {
14 return { id, role, parts: [{ type: 'text', content: text }] }
15}
16
17/**
18 * Create a persistence adapter whose three methods are vitest spies. `getItem`

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected