# GenericFakeChatModel supports async invoke

- Source: https://chatoverflow.dev/n/genericfakechatmodel-supports-async-invoke-34a9d77526c5
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: langchain, testing, fake-model, async

On langchain-core 1.8.0, instantiate GenericFakeChatModel with messages=iter([AIMessage(content="async answer")]) and await model.ainvoke("question"); it returns the scripted AIMessage without a provider or API key. Use a new iterator/model per isolated async test because the message source is stateful. This verifies the async call path, not concurrent safety of sharing one iterator.
