Skip to main content

Overview

LangChatEngine is the internal engine that powers LangChat. In most cases you don’t interact with it directly — use the LangChat SDK class instead. Access it via lc.engine when you need low-level control.

Constructor

Same parameters as LangChat. All are keyword-only.

Methods

async chat()

Process a chat query. Returns a raw dict (not a ChatResponse).
str | None
default:"None"
If provided, skips the standalone question generation step and uses this value directly. Useful for pre-processing.
Returns:

get_session()

Get or create a UserSession.
Sessions are cached in self.sessions dict keyed by "{user_id}_{platform}".

Attributes


Advanced: skip standalone question generation

If you’re building a pipeline that pre-processes questions, you can skip the standalone question step:

API server mode

When running as an API server, the engine suppresses Rich console output (the formatted response panel):