Semantic Kernel 入门系列:,Connector连接器

科技资讯 投稿 4800 0 评论

Semantic Kernel 入门系列:,Connector连接器

Connector更像是一种设计模式,并不像Function和Memory 一样有强制和明确的规定。所以从官方的接口定义上也没有一个 IConnector类似的东西。不过我们可以从官方示例中了解这一模式的使用方法。

IWebSearchEngineConnector 作为搜索引擎的查询服务。在构造的时候将Connector的实例注入到Skill中即可。这便是很常见的依赖注入。

IDocumentConnector 实现对于文档的读写操作的,使用IFileSystemConnector实现对于文件的访问。

这样看来,Semantic Kernel使用Connector可以连接一切。


参考资料:

    Connectors in Semantic Kernel | Microsoft Learn
  1. semantic-kernel/WebSearchEngineSkill.cs at main · microsoft/semantic-kernel · GitHub
  2. semantic-kernel/DocumentSkill.cs at main · microsoft/semantic-kernel · GitHub

编程笔记 » Semantic Kernel 入门系列:,Connector连接器

赞同 (23) or 分享 (0)
游客 发表我的评论   换个身份
取消评论

表情
(0)个小伙伴在吐槽