MCPcopy
hub / github.com/claude-code-best/claude-code / queryModelWithStreaming

Function queryModelWithStreaming

src/services/api/claude.ts:775–803  ·  view source on GitHub ↗
({
  messages,
  systemPrompt,
  thinkingConfig,
  tools,
  signal,
  options,
}: {
  messages: Message[]
  systemPrompt: SystemPrompt
  thinkingConfig: ThinkingConfig
  tools: Tools
  signal: AbortSignal
  options: Options
})

Source from the content-addressed store, hash-verified

773}
774
775export async function* queryModelWithStreaming({
776 messages,
777 systemPrompt,
778 thinkingConfig,
779 tools,
780 signal,
781 options,
782}: {
783 messages: Message[]
784 systemPrompt: SystemPrompt
785 thinkingConfig: ThinkingConfig
786 tools: Tools
787 signal: AbortSignal
788 options: Options
789}): AsyncGenerator<
790 StreamEvent | AssistantMessage | SystemAPIErrorMessage,
791 void
792> {
793 return yield* withStreamingVCR(messages, async function* () {
794 yield* queryModel(
795 messages,
796 systemPrompt,
797 thinkingConfig,
798 tools,
799 signal,
800 options,
801 )
802 })
803}
804
805/**
806 * Determines if an LSP tool should be deferred (tool appears with defer_loading: true)

Callers 2

searchMethod · 0.85
streamCompactSummaryFunction · 0.85

Calls 2

withStreamingVCRFunction · 0.85
queryModelFunction · 0.85

Tested by

no test coverage detected