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

Function assistantToolCall

packages/pi-plugin/src/test-utils.test.ts:54–70  ·  view source on GitHub ↗
(
	id: string,
	name: string,
	args: Record<string, unknown> = {},
	timestamp = 2,
)

Source from the content-addressed store, hash-verified

52}
53
54export function assistantToolCall(
55 id: string,
56 name: string,
57 args: Record<string, unknown> = {},
58 timestamp = 2,
59): PiMessage {
60 return {
61 role: "assistant",
62 content: [{ type: "toolCall", id, name, arguments: args }],
63 api: "test-api",
64 provider: "test-provider",
65 model: "test-model",
66 usage: {},
67 stopReason: "stop",
68 timestamp,
69 } as PiMessage;
70}
71
72export function toolResultMessage(
73 toolCallId: string,

Callers 4

makeTranscriptIdFunction · 0.90
buildMessagesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected