MCPcopy Create free account
hub / github.com/cortexkit/magic-context / userMessage

Function userMessage

packages/pi-plugin/src/test-utils.test.ts:17–27  ·  view source on GitHub ↗
(
	content:
		| string
		| Array<
				| { type: "text"; text: string }
				| { type: "image"; data: string; mimeType: string }
		  >,
	timestamp = 1,
)

Source from the content-addressed store, hash-verified

15}
16
17export function userMessage(
18 content:
19 | string
20 | Array<
21 | { type: "text"; text: string }
22 | { type: "image"; data: string; mimeType: string }
23 >,
24 timestamp = 1,
25): PiMessage {
26 return { role: "user", content, timestamp } as PiMessage;
27}
28
29export function assistantMessage(
30 text: string,

Calls

no outgoing calls

Tested by

no test coverage detected