nsmcp::ChatCompletionsRun method drain (protected)
<instance of nsmcp::ChatCompletionsRun> drain key
Defined in /usr/local/ns/tcl/nsmcp/question-chat-completions.tcl
- Parameters:
- key (required)
- Testcases:
- No testcase defined.
Source code: set record [${:backend} streamDrain $key] if {[dict get $record error] ne ""} {error [dict get $record error]} set status [dict get $record status] if {$status == 200} { if {![string match -nocase {text/event-stream*} [dict get $record contentType]]} { error "Provider did not return an event stream" } :feed [dict get $record data] } elseif {$status != 0} { # Do not echo provider bodies: they may contain credentials or # sensitive request data. Status is sufficient for basic diagnosis. error "Provider returned HTTP $status" }XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)