利用Copilot Studio 为 Microsoft 365 Copilot开发智能体(Agent)之外部系统整合

利用Copilot Studio你可以轻松为Microsoft 365 Copilot 定制智能体(Agent),而且还可以通过Actions 对接任意的外部系统,例如数据库。本文用一个简单的示例,给大家展示一下这个开发过程,这里用的数据库是微软的在线实时分析数据库, Azure Data Explorer.

首先,你可以定义一个action。

5b3234d794800fcab8e1ecdc491bdae2.png

c5da754679bf9f1575f66a42c43fdd9e.png

7898d463e36cb0e837719e40abace2c1.png

22a1ecfb099c69b2dca8d5a0b571ad38.png

f34b454a23c0fcc9a72370d3b690b24c.png

e867b21503f0ffa3685cbdfa6658bc17.png

6a8ed4eefb91738f15938b810ea187b2.png

然后你可以在你的Agent 中使用这个Action。

05f8dfbedc008895b84ebbca7011f279.png

fa6153acd9d9aa54e5f6714d3aac7b72.png

你可以进一步指定详细的信息,例如服务器地址,数据库信息等。

4ed78c216d1b5e9b6ab7fe824a22d61a.png

这个提示词大致如下。

- Generate Kusto queries based on user requests.
- Execute the generated Kusto queries.
- Return the results of the executed queries to the users.
- Ensure the queries are accurate and efficient.
- Provide clear and concise responses to users.
- Handle errors gracefully and inform users of any issues.
- Understand the schema provided by the user for generating and executing Kusto queries.
- Table name is StormEvents
- The schema includes columns such as StartTime, EndTime, EpisodeId, EventId, State, EventType, InjuriesDirect, InjuriesIndirect, DeathsDirect, DeathsIndirect, DamageProperty, DamageCrops, Source, BeginLocation, EndLocation, BeginLat, BeginLon, EndLat, EndLon, EpisodeNarrative, EventNarrative, and StormSummary.
- Communicate in a casual manner.
- format the result as a table

安装测试效果如下

bec31641ede5dd90f4eeb6054588671a.png

为了安全起见,Copilot会尝试问你是否要允许执行外部的操作,你可以选择 'Always allow" 或 "Allow once"。第一次使用时,用户还需要自己去完成身份验证。这样就确保只有本身具有数据库访问权限的用户才能执行这些查询。

7a1b884d5915303c2f84e6ea76e8be28.png

结果如下,非常完美。

3b9addf444913f229aaf6d78f9c09203.png

还有更炸裂的呢,你其实可以让任何你喜欢的语言(或者说理论上几乎所有的语言)表达你的需求,Copilot能自动理解你的需求,并且转换成正确的数据库查询,然后执行返回结果给你。而这个过程,你是不需要做任何的处理的,这就是我们基于Microsoft 365 Copilot来定制开发智能体的一个很大的好处。

下面这个是中文版

5210924af13933c25b9ac7537ae0e761.png

下面这个是日语版

51a32de4e8bae57d795d5af137b89133.png

你还可以像下面这样玩,把数据查询的工作和其他的任务整合起来。

846e5910c6e3459d3a3501a03a380000.png

02d548213f0bb673a358e4e373d8153d.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值