@fluidframework/tree-agent-langchain Package
LangChain integration helpers for the SharedTreeSemanticAgent.
Functions
| Function | Alerts | Return Type | Description |
|---|---|---|---|
| createLangchainChatModel(langchainModel) | Alpha | SharedTreeChatModel | Creates a stateless SharedTreeChatModel backed by LangChain. |
| createLegacyLangchainChatModel(langchainModel) | Deprecated, Alpha | SharedTreeChatModel | Creates a legacy stateful SharedTreeChatModel backed by LangChain. |
Function Details
createLangchainChatModel
Creates a stateless SharedTreeChatModel backed by LangChain.
This API is provided as an alpha preview and may change without notice.
To use, import via @fluidframework/tree-agent-langchain/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function createLangchainChatModel(langchainModel: BaseChatModel): SharedTreeChatModel;
Remarks
Use with createTreeAgent.
Parameters
| Parameter | Type | Description |
|---|---|---|
| langchainModel | BaseChatModel | The LangChain chat model to use. |
Returns
Return type: SharedTreeChatModel
createLegacyLangchainChatModel
Creates a legacy stateful SharedTreeChatModel backed by LangChain.
This API is deprecated and will be removed in a future release.
Use createLangchainChatModel(langchainModel) with createTreeAgent instead.
This API is provided as an alpha preview and may change without notice.
To use, import via @fluidframework/tree-agent-langchain/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function createLegacyLangchainChatModel(langchainModel: BaseChatModel): SharedTreeChatModel;
Remarks
This implementation maintains internal message history and manages the edit loop via the edit callback pattern. Use with SharedTreeSemanticAgent.
Parameters
| Parameter | Type | Description |
|---|---|---|
| langchainModel | BaseChatModel | The LangChain chat model to use. |
Returns
Return type: SharedTreeChatModel