ajndkr / lanarky

The web framework for building LLM microservices
https://lanarky.ajndkr.com/
MIT License
975 stars 74 forks source link

fix `StreamingResponse` message content encoding #55

Closed rbbby closed 1 year ago

rbbby commented 1 year ago

Description

When going from v0.6.2 -> v0.6.3 the following error started occurring on every new streamed token: Error in on_llm_new_token callback: sequence item 1: expected a bytes-like object, str found This happens for both regular chains and new agents as tested by multiple examples and a private app which uses lanarky. This fix solves this by encoding the message body to utf-8.

Changelog: