Type annotation on stream_event v3?

Recently, Langgraph has v3 on stream_event and astream_event.

I tried using it, but I found it doesn’t have any type annotation - and things get worse when I try to annotate it with (Async)GraphRunStream, as it dynamically adds attributes like stream.messagesso that type checker never shows hint and even flags it as error.

So, my question is - is there any plan to add type annotation on those? v3 is still in beta phase, so I hope type annotation might got added one day…

This is an oversight! Sorry about this - am working on a fix right now.

So, I saw it had been updated to 1.2.10, and I updated - and still has an issue,

I copy-pasted this from document:

stream = graph.stream_events({
    "messages": [{"role": "user", "content": "What is 42 * 17?"}],
}, version="v3")

for message in stream.messages:
    for token in message.text:
        print(token, end="", flush=True)

final_state = stream.output

And it yields typeerror at stream.messages.

I read the PR, and it says

Opt-in native projections (updates, custom, checkpoints, debug, tasks) are only present when their transformer is registered, so they remain reached via extensions[...] rather than annotated as always-present.

So how do I annotate those correctly? (I really want to get help from autocompletion and not disturbed by type checker)

Could you please paste in the full TypeError traceback along with:

import langgraph, langchain_core
print(langgraph.**file**)
print(langgraph.**version** if hasattr(langgraph, "**version**") else "no **version**")
print(langchain_core.**version**)
print(type(graph))

Thank you! Sorry you are still running into the issue!

Oh, sorry, I meant red underline of static type checke, not real type error.

Ah ok. I retested and am not seeing this issue with 1.2.10. Could you please check that the interpreter in whatever code editor you are using is configured properly?

Oops, nevermind. I believe my typechecker couldn’t find update well at that moment - it works really well now. Sorry for interrupt.

The only issue(?) is that token of the code (message.text iterated) is Any.