MCPcopy
hub / github.com/continuedev/continue / getStreamingResponse

Function getStreamingResponse

extensions/cli/src/commands/chat.ts:167–194  ·  view source on GitHub ↗
(
  compactionIndex: number | null | undefined,
  model: ModelConfig,
  llmApi: BaseLlmApi,
)

Source from the content-addressed store, hash-verified

165
166// Helper function to get streaming response based on compaction state
167async function getStreamingResponse(
168 compactionIndex: number | null | undefined,
169 model: ModelConfig,
170 llmApi: BaseLlmApi,
171): Promise<string> {
172 const abortController = new AbortController();
173
174 if (compactionIndex !== null && compactionIndex !== undefined) {
175 // Use service to compute history for LLM
176 const historyForLLM =
177 services.chatHistory.getHistoryForLLM(compactionIndex);
178
179 return await streamChatResponse(
180 historyForLLM,
181 model,
182 llmApi,
183 abortController,
184 );
185 } else {
186 // No compaction - get full history from service
187 return await streamChatResponse(
188 services.chatHistory.getHistory(),
189 model,
190 llmApi,
191 abortController,
192 );
193 }
194}
195
196// Helper function to process and output response in headless mode
197function processAndOutputResponse(

Callers 1

processMessageFunction · 0.85

Calls 3

streamChatResponseFunction · 0.85
getHistoryForLLMMethod · 0.80
getHistoryMethod · 0.45

Tested by

no test coverage detected