(message: Anthropic.MessageParam, reasoning?: string)
| 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() |
no test coverage detected