MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / appendAssistant

Method appendAssistant

src/core/session.ts:113–124  ·  view source on GitHub ↗

Append an assistant message to the session.

(
    content: string | ContentBlock[],
    provider: SessionEntry['provider'] = 'vercel-ai',
    metadata?: Record<string, unknown>,
  )

Source from the content-addressed store, hash-verified

111
112 /** Append an assistant message to the session. */
113 async appendAssistant(
114 content: string | ContentBlock[],
115 provider: SessionEntry['provider'] = 'vercel-ai',
116 metadata?: Record<string, unknown>,
117 ): Promise<SessionEntry> {
118 return this.append({
119 type: 'assistant',
120 message: { role: 'assistant', content },
121 provider,
122 ...(metadata ? { metadata } : {}),
123 })
124 }
125
126 /** Read all entries from the session file (including system/compact entries). */
127 async readAll(): Promise<SessionEntry[]> {

Callers

nothing calls this directly

Calls 1

appendMethod · 0.95

Tested by

no test coverage detected