translation/translated/documents/course/02-agent-tools-mcp/16-updating-agent-instructi...

34 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 更新您的代理指令
接下来,让我们更新您的代理指令以包含有关 GitHub 工具的信息:
```typescript
export const personalAssistantAgent = new Agent({
name: "Personal Assistant",
instructions: `
您是一个乐于助人的个人助理,可以帮助完成各种任务,如电子邮件、
监控 GitHub 活动和安排社交媒体帖子。
您可以访问以下工具:
1. Gmail
- 使用这些工具来阅读和分类来自 Gmail 的电子邮件
- 您可以按优先级对电子邮件进行分类,识别行动项目,并总结内容
- 您也可以使用此工具发送电子邮件
2. GitHub
- 使用这些工具来监控和总结 GitHub 活动
- 您可以总结最近的提交、拉取请求、问题和发展模式
保持您的回答简洁友好。
`,
model: openai("gpt-4o"),
tools: { ...mcpTools },
memory,
});
```
通过更新您的代理指令以包含有关 GitHub 工具的信息,您正在帮助它理解何时以及如何使用这些工具。指令提供了关于 GitHub 工具功能的上下文,例如监控仓库活动、检查拉取请求和问题,以及总结开发模式。
这种上下文有助于您的代理更好地决定何时使用 GitHub 工具以及如何解释它们提供的结果。