MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / addToApiConversationHistory

Method addToApiConversationHistory

src/core/task/Task.ts:897–909  ·  view source on GitHub ↗
(message: Anthropic.MessageParam, reasoning?: string)

Source from the content-addressed store, hash-verified

895 }
896
897 private async addToApiConversationHistory(message: Anthropic.MessageParam, reasoning?: string) {
898 this.apiConversationHistory.push(
899 prepareApiConversationMessage({
900 message,
901 reasoning,
902 api: this.api,
903 apiConfiguration: this.apiConfiguration,
904 apiConversationHistory: this.apiConversationHistory,
905 }),
906 )
907
908 await this.saveApiConversationHistory()
909 }
910
911 // NOTE: We intentionally do NOT mutate stored messages to merge consecutive user turns.
912 // For API requests, consecutive same-role messages are merged via mergeConsecutiveApiMessages()

Calls 2

Tested by

no test coverage detected