SimulateChunks simulates the agent sending streaming chunks. This triggers the onChunk callback as if the agent was responding.
(chunks ...string)
| 149 | // SimulateChunks simulates the agent sending streaming chunks. |
| 150 | // This triggers the onChunk callback as if the agent was responding. |
| 151 | func (m *mockAgentIO) SimulateChunks(chunks ...string) { |
| 152 | m.mu.Lock() |
| 153 | fn := m.onChunkFn |
| 154 | m.mu.Unlock() |
| 155 | for _, chunk := range chunks { |
| 156 | if fn != nil { |
| 157 | fn(chunk) |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | // GetWritten returns all data written to the agent. |
| 163 | func (m *mockAgentIO) GetWritten() []byte { |
no outgoing calls
no test coverage detected