Install
withEra
Use withEra() for the simplest integration:
- Extracts
userandassistantmessages from the prompt. - Calls
era.turnContext()with those messages. - Adds the returned block to the system message.
- Calls the wrapped model.
eraMiddleware
Use eraMiddleware() when you need to compose multiple middleware:
TurnContextOptions, including visitorId,
partnerEndUserId, trusted email or phone, and sessionId.
The options are fixed when you create the wrapper. If identity changes per
request, create the wrapper inside that request or call
turnContext()
directly.LanguageModel interface, so they work with
any compatible model provider.
See both function signatures.