@ axiom-lattice/ protocols (英语)
Axiom Lattice框架的统一协议类型定义.
概览
这个软件包为Axiom Lattice框架提供了标准化协议接口的集合. 这些协议定义了系统不同组成部分之间的合同,确保了一致的行为和互操作性.
议定书
BaseLatticeProtocol: 适用于所有花纹类型的基本协议ModelLatticeProtocol: LLM 模型集成协议ToolLatticeProtocol: 工具执行协议AgentLatticeProtocol: 代理行为协议MemoryLatticeProtocol: 内存管理协议StorageLatticeProtocol: 数据存储协议UILatticeProtocol: UI 组件的协议MessageProtocol: 标准化信息通信协议
使用量
import {
ModelLatticeProtocol,
ToolLatticeProtocol,
MessageProtocol,
Message,
UserMessage,
AssistantMessage,
} from "@axiom-lattice/protocols";
// Implement a model lattice
class MyModelLattice implements ModelLatticeProtocol {
// Implementation details...
}
// Implement a tool lattice
class MyToolLattice implements ToolLatticeProtocol {
// Implementation details...
}
// Use message protocol for communication
class MyMessageHandler implements MessageProtocol {
// Implementation details...
// Example of creating a conversation
createConversation() {
const messages: Message[] = [
{
id: "user_1",
role: "user",
content: "Hello, can you help me?",
},
{
id: "asst_1",
role: "assistant",
content: "Of course! What can I help you with today?",
},
];
return messages;
}
}
许可证
麻省理工学院