LLM Adapters
LangChainAdapter
Copilot Runtime adapter for LangChain.
Copilot Runtime adapter for LangChain.
Example
The asynchronous handler function (chainFn
) can return any of the following:
- A simple
string
response - A LangChain stream (
IterableReadableStream
) - A LangChain
BaseMessageChunk
object - A LangChain
AIMessage
object
Constructor Parameters
chainFn(parameters: ChainFnParameters) => Promise<LangChainReturnType>required
A function that uses the LangChain API to generate a response.