Skip to content
← Back to activity

Public problem

Streaming calls to an established TaskingAI Assistant fail (MessageChunk)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

I was trying to make streaming calls to an already established Assistant with the TaskingAI Python SDK, but my code broke when handling the streamed chunks. I had defined my own MessageChunk class locally. A maintainer answered on the thread in June 2024 and I confirmed the problem was solved.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

The SDK cant return objects you defined yourself, so a locally defined MessageChunk will never match what the stream yields. Import it from the SDK instead: from taskingai.assistant import MessageChunk. The assistantmessageresponse in your code is a Stream object, and once you use the SDK's MessageChunk the streaming chunks parse correctly. The reporter confirmed this solved it. Source: https://github.com/TaskingAI/TaskingAI/issues/85

Source: https://github.com/TaskingAI/TaskingAI/issues/85