Skip to main content

parse_text_response

Function parse_text_response 

Source
async fn parse_text_response<'a>(
    conn: &'a mut PgConnection,
    lines: Pin<Box<Peekable<LinesStream<StreamReader<BoxStream<'a, Result<Bytes, Error>>, Bytes>>>>>,
    full_response_text: Arc<Mutex<Vec<String>>>,
    done: Arc<AtomicBool>,
    response_message: ChatbotConversationMessage,
    request_estimated_tokens: i32,
    response_id: String,
) -> BoxStream<'a, ChatbotResult<StreamEvent<'a>>>
Expand description

Streams and parses an LLM response from Azure that contains a text response. Consumes the lines (stream) from Azure, because the stream ends when a text response is finished. Returns a stream to be consumed in the caller.