You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ Unlike many agent frameworks that only track the chat history with LLMs in text,
23
23
24
24
25
25
## 🆕 News
26
+
- 📅2024-12-23: TaskWeaver has been integrated with the [AgentOps](https://microsoft.github.io/TaskWeaver/docs/observability) for better observability and monitoring.🔍
26
27
- 📅2024-09-13: We introduce the shared memory to store information that is shared between the roles in TaskWeaver. Please check the [memory](https://microsoft.github.io/TaskWeaver/docs/memory) for more details.🧠
27
28
- 📅2024-09-13: We have enhanced the experience feature by allowing static and dynamic experience selection. Please check the [experience](https://microsoft.github.io/TaskWeaver/blog/experience) for more details.📚
28
29
- 📅2024-07-02: We have optimized TaskWeaver to support not-that-large language models served locally. Please check this [post](https://microsoft.github.io/TaskWeaver/blog/local_llm) for more details.🔗
@@ -31,7 +32,7 @@ Unlike many agent frameworks that only track the chat history with LLMs in text,
31
32
- 📅2024-03-27: TaskWeaver now switches to `container` mode by default for code execution. Please check the [code execution](https://microsoft.github.io/TaskWeaver/docs/code_execution) for more details.🐳
32
33
- 📅2024-03-07: TaskWeaver now supports configuration of different LLMs for various components, such as the Planner and CodeInterpreter. Please check the [multi-llm](https://microsoft.github.io/TaskWeaver/docs/llms/multi-llm) for more details.🔗
33
34
- 📅2024-03-04: TaskWeaver now supports a [container](https://microsoft.github.io/TaskWeaver/docs/code_execution) mode, which provides a more secure environment for code execution.🐳
34
-
-📅2024-02-28: TaskWeaver now offers a [CLI-only](https://microsoft.github.io/TaskWeaver/docs/advanced/cli_only) mode, enabling users to interact seamlessly with the Command Line Interface (CLI) using natural language.📟
35
+
<!-- - 📅2024-02-28: TaskWeaver now offers a [CLI-only](https://microsoft.github.io/TaskWeaver/docs/advanced/cli_only) mode, enabling users to interact seamlessly with the Command Line Interface (CLI) using natural language.📟-->
35
36
<!-- - 📅2024-02-01: TaskWeaver now has a plugin [document_retriever](https://github.com/microsoft/TaskWeaver/blob/main/project/plugins/README.md#document_retriever) for RAG based on a knowledge base.📚 -->
36
37
<!-- - 📅2024-01-30: TaskWeaver introduces a new plugin-only mode that securely generates calls to specified plugins without producing extraneous code.🪡 -->
37
38
<!-- - 📅2024-01-23: TaskWeaver can now be personalized by transforming your chat histories into enduring [experiences](https://microsoft.github.io/TaskWeaver/docs/customization/experience) 🎉 -->
Copy file name to clipboardExpand all lines: taskweaver/planner/planner_prompt.yaml
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,14 @@ instruction_template: |-
21
21
22
22
## Planner Character
23
23
- Planner's main job is to make planning and to instruct Workers to resolve the request from the User.
24
-
- Planner can conduct basic analysis (e.g., comprehension, extraction, etc.) to solve simple problems after reading the messages from the User and the Workers.
25
-
- Planner should first try to solve the task by itself before reaching out to the Workers for their special expertise.
24
+
- Planner should independently handle basic tasks such as information extraction from text files, using its reasoning and comprehension skills before considering the involvement of Workers.
26
25
- Planner can assign different subtasks to different Workers, and each subtask should be assigned to only one Worker.
27
26
- Planner must reject the User's request if it contains potential security risks or illegal activities.
28
27
- Planner should ask the User to provide additional information critical for problem solving, but only after trying the best.
29
28
- Planner can talk to the User and Workers by specifying the `send_to` field in the response, but MUST NOT talk to the Planner itself.
30
29
- Planner should refine the plan according to its observations from the replies of the Workers or the new requests of User.
31
30
- Planner needs to inform Workers on the User's request, the current step, and necessary information to complete the task.
32
-
- Planner must check the Worker's response and provide feedback to the Worker if the response is incorrect or incomplete.
31
+
- Planner must thoroughly review Worker's response and provide feedback to the Worker if the response is incorrect or incomplete.
33
32
- Planner can ignore the permission or file access issues since Workers are powerful and can handle them.
34
33
35
34
## Planner's planning process
@@ -120,6 +119,10 @@ response_json_schema: |-
120
119
"response": {
121
120
"type": "object",
122
121
"properties": {
122
+
"reasoning": {
123
+
"type": "string",
124
+
"description": "The reasoning of the Planner's decision. It should include the analysis of the User's request, the Workers' responses, and the current environment context."
125
+
},
123
126
"init_plan": {
124
127
"type": "string",
125
128
"description": "The initial plan to decompose the User's task into subtasks and list them as the detailed subtask steps. The initial plan must contain dependency annotations for sequential and interactive dependencies."
@@ -132,10 +135,6 @@ response_json_schema: |-
132
135
"type": "string",
133
136
"description": "The current step Planner is executing."
134
137
},
135
-
"review": {
136
-
"type": "string",
137
-
"description": "The review of the current step. If the Worker's response is incorrect or incomplete, Planner should provide feedback to the Worker."
138
-
},
139
138
"send_to": {
140
139
"type": "string",
141
140
"description": "The name of character (User or name of the Worker) that Planner wants to speak to."
[AgentOps](https://www.agentops.ai/) is a platform that helps you to monitor and analyze the behavior and performance of your agents.
10
+
TaskWeaver is integrated with AgentOps, so you can use TaskWeaver to generate code and use AgentOps to observe all the events from the planning to the code execution.
11
+
12
+
## Get Started
13
+
14
+
TaskWeaver integration with AgentOps is documented [here](https://www.agentops.ai/docs/taskweaver).
15
+
16
+
To get started, you need an API key from AgentOps by [signing up](https://www.agentops.ai/signup) for a free account. Then you need to create a new project and generate the API key from the project settings.
17
+
18
+
Once you have the API keys, the following steps will help you to get started.
19
+
20
+
1. Install the `agentops`` package in your project.
21
+
```bash
22
+
pip install agentops
23
+
```
24
+
2. Import the `agentops` package in your project.
25
+
```python
26
+
import agentops
27
+
```
28
+
3. Initialize the `agentops` client with your API key.
29
+
```python
30
+
agentops.init(api_key="your_api_key")
31
+
```
32
+
33
+
:::note
34
+
You can also set the tags here to track your sessions in the AgentOps dashboard. By default, the "taskweaver" tag will be added to all the AgentOps sessions for TaskWeaver.
35
+
:::
36
+
37
+
4. Import the TaskWeaver handler `TaskWeaverEventHandler` and set it as the event handler for your TaskWeaver project.
38
+
```python
39
+
from agentops.providers.taskweaver import TaskWeaverEventHandler
40
+
handler = TaskWeaverEventHandler()
41
+
```
42
+
43
+
:::note
44
+
There are two ways to set the handler:
45
+
- Set the handler using the `session.event_handler.register()` method.
46
+
- Set the handler in every `session.send_message` function call in the `event_handler` parameter.
47
+
:::
48
+
49
+
:::warning
50
+
If you encounter "stuttering" in the recorded messages from the events, it is because the handler has been set with more than one instance.
51
+
:::
52
+
53
+
5. Now you can run your TaskWeaver project and observe the events in the AgentOps dashboard. When the client is initialized, it will automatically start to track the events and provide a link to the session in the AgentOps dashboard.
54
+
55
+
:::info
56
+
It is important to note that the LLM calls and the other events are tracked together in different modules of AgentOps. By default, all the LLM calls are tracked when the AgentOps client is initialized. However, the other events are only tracked when the `TaskWeaverEventHandler` handler is used in conjunction within the code.
57
+
58
+
Therefore, event observability is limited to LLM calls when TaskWeaver is used in [Terminal mode](../usage/cmd.md).
0 commit comments