fastrag.query.llm.base#
The ChatModel contract: messages to a generated answer.
Classes
Turns a conversation into a generated answer. |
|
|
One turn in a chat conversation. |
- class fastrag.query.llm.base.Message(role, content)[source]#
Bases:
objectOne turn in a chat conversation.
- role#
Who sent the turn.
- Type:
Literal[‘system’, ‘user’, ‘assistant’]
- class fastrag.query.llm.base.ChatModel[source]#
Bases:
ABCTurns a conversation into a generated answer.
invokeandstreamare separate methods, not one method with a flag, because a streaming caller and a one-shot caller want different return shapes — tokens as they land versus one finished string — and forcing both through one signature would make one of the two callers reconstruct what it actually wanted from the other’s shape.