SemanticKernel.Assistants:项目核心功能/场景

SemanticKernel.Assistants:项目核心功能/场景

SemanticKernel.Assistants Microsoft Semantic Kernel Assistants This enables the usage of assistants for the Semantic Kernel. It provides different scenarios for the usage of assistants such as: Assistant with Semantic Kernel plugins Multi-Assistant conversation SemanticKernel.Assistants 项目地址: https://gitcode.com/gh_mirrors/se/SemanticKernel.Assistants

项目介绍

SemanticKernel.Assistants 是一个开源项目,旨在为 Semantic Kernel 提供本地运行的助手功能,而不依赖于 OpenAI 的助手 API。它允许开发者利用 Semantic Kernel 的能力,创建和部署自定义的智能助手,以适应不同的应用场景。

项目技术分析

Semantic Kernel 本身是一个轻量级的 SDK,它使得大型语言模型(LLM)与传统的编程语言集成成为可能。它结合了自然语言处理、传统的代码功能和基于嵌入的内存管理,为应用程序添加了新的潜力和价值。

SemanticKernel.Assistants 通过以下技术特点实现了助手的本地化和定制化:

  • 本地插件运行:项目支持在本地环境中运行各种插件,包括数学计算、文件访问等。
  • 多助手对话:能够创建和管理多个助手之间的对话。
  • 自动生成对话:通过与 AutoGen 的集成,项目可以自动生成代码来响应用户请求。

项目及技术应用场景

SemanticKernel.Assistants 的应用场景广泛,以下是一些典型的使用案例:

  1. 教育辅导:创建一个数学助手,能够帮助学生解决数学问题,提供解题思路和答案。
  2. 客户服务:部署一个多语言客户服务助手,能够处理用户查询并提供即时帮助。
  3. 代码辅助:通过自动生成代码,帮助开发者快速实现功能,提高开发效率。

以下是一个具体的应用示例:

数学助手创建流程

  1. 定义助手描述文件:创建一个 YAML 文件,定义助手的名称、描述、指令和输入参数。
  2. 实例化助手:在代码中创建助手的实例,并加载必要的插件。
  3. 创建对话线程:与助手进行交互,通过调用 InvokeAsync 方法发送问题和接收答案。
name: Mathematician
description: A mathematician that resolves given maths problems.
instructions: |
  You are a mathematician.
  Given a math problem, you must answer it with the best calculation formula.
  No need to show your work, just give the answer to the math problem.
  Use calculation results.
input_parameters: 
  - name: input
    is_required: True
    default_value: ""
    description: |
       The word financial problem to solve in 2-3 sentences.
       Make sure to include all the input variables needed along with their values and units otherwise the math function will not be able to solve it.
execution_settings:
  planner: Handlebars
  prompt_settings: 
    temperature: 0.0
    top_p: 1
    max_tokens: 2000
var mathKernel = Kernel.CreateBuilder()
                        .AddAzureOpenAIChatCompletion(azureOpenAIChatCompletionDeployment, azureOpenAIEndpoint, azureOpenAIKey)
                        .Build();

mathKernel.ImportPluginFromObject(new MathPlugin());

var mathematician = AssistantBuilder.FromTemplate("./Assistants/Mathematician.yaml")
                                    .WithKernel(mathKernel)
                                    .Build();
var thread = mathematician.CreateThread();
await thread.InvokeAsync("Your ask to the assistant.");

项目特点

SemanticKernel.Assistants 项目具有以下显著特点:

  • 独立运行:不依赖于 OpenAI 的 API,可以在本地环境中独立运行。
  • 自定义模型支持:可以使用自己的模型,如 Ollama 模型,进行本地化部署。
  • 丰富的插件系统:提供了多种插件,如文件访问插件、代码解释器插件等,以扩展助手的职能。
  • 多助手协作:支持多个助手之间的对话,实现复杂的交互流程。

总之,SemanticKernel.Assistants 是一个强大而灵活的开源项目,为开发者提供了一个创建和部署智能助手的平台,具有广泛的应用前景。

SemanticKernel.Assistants Microsoft Semantic Kernel Assistants This enables the usage of assistants for the Semantic Kernel. It provides different scenarios for the usage of assistants such as: Assistant with Semantic Kernel plugins Multi-Assistant conversation SemanticKernel.Assistants 项目地址: https://gitcode.com/gh_mirrors/se/SemanticKernel.Assistants

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

强美玮Quincy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值