MCPcopy Create free account
hub / github.com/Noumena-Network/code / queryModelWithStreaming

Function queryModelWithStreaming

src/services/api/claude.ts:779–807  ·  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

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

Callers 2

callFunction · 0.85

Calls 2

withStreamingVCRFunction · 0.85
queryModelFunction · 0.85

Tested by

no test coverage detected