在Semantic Kernel 中,提供了 2 种类型的 Function 。 之前我们已经介绍过其中的 Semantic Function ,相当于是 SK 将 Prompt 及其配置封装到了Function 中,方便系统的灵活调用和管理。 而今天我们就来看看另一种 Function - Native Function。 什么是 Native Function Native Function 被翻译为本机函数,通俗来讲就...
这样在 API 请求里面,只需要直接执行一个 Native Function 就行,而里面具体是怎么用 Semantic Function 获取意图,怎么判断意图执行不同操作的都写在 Native Function 中就行。 比如下图中们就是新建了一个叫做 OrchestratorPlugin.cs 的 Native Function。 其中实现的功能就是先调用 Semantic Function 获取意图,再 swi...
Semantic Kernel 中大部分的能力都是有插件提供的,例如Semantic Kernel的一个核心组件Planner,其实就是一组Semantic Plugin,另外官方提供了一些Core Plugin,基本是日常比较常用的。具体可以参考Plugins.Core 通过安装 Nuget packageMicrosoft.SemanticKernel.Plugins.Core即可,和自行定义的Native Function一样的,只需要使用Impo...
在之前的章节中我们介绍过在在 Semantic Kernel 中应用 Function Calling[1],在文中讲解了Functioncalling的概念,以及在SK中的应用。在Semantic Kernel中定义Native Plugins 函数插件,和 gpt-3.5-turbo 在 6 月 13 日 发布的 Function Calling特别的像,这是通过增加外部函数,通过调用来增强 OpenAI 模型的能力。 在...
usingSystem.ComponentModel;usingSystem.Text.Json;usingSystem.Text.Json.Nodes;usingMicrosoft.SemanticKernel;publicclassMusicLibraryPlugin{ [KernelFunction, Description("Get a list of music recently played by the user")]publicstaticstringGetRecentPlays(){stringdir = Directory.GetCurrentDirectory();s...
上一章节我们了解了一下Semantic Kernnel中Plugins插件的概念以及学习了的 Semantic Kernel 模板插件的创建,本章节我们来学习 Native Plugins 原生函数插件使用。 通过函数定义插件 在之前的章节中我们介绍过在在Semantic Kernel 中应用 Function Calling,在文中讲解了Functioncalling的概念,以及在SK中的应用。 在Semantic ...
If your function has a complex object as an input variable, Semantic Kernel will also generate a schema for that object and pass it to the AI agent. Similar to functions, you should provideDescriptionannotations for properties that are non-obvious to the AI. Below is the definition for theLi...
Work was done in#9375to make SemanticKernel trimming- and NativeAOT-friendly. In MEVD, this consisted of adding[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors)]for the user POCO type, which causes all properties to be preserved...
Semantic Kernel Integration: Enable sophisticated semantic search capabilities for more intuitive data retrieval and analysis. EF Core Integration:This integration simplifies the management of vector data within your existing applications. If you’re using Entity Framework Core to build a web ap...
The main new features of this version: replace the histogram with a more clear bucket histogram, support displaying examples on OpenMetrics counters, increase the semantic specification of database connection pool metrics, allow all metrics specifications to be synchronous or asynchronous, add HTTP/3,...