Skip to content

Commit 7704c4b

Browse files
committed
Fixed to be able to parse tasks even when rules are recited; added instructions on how to stop containers in README.md
1 parent 5aec50b commit 7704c4b

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

README-jp.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,19 @@ https://x.com/saten_work/status/1791558481432232355
7575

7676
前提条件として、docker と docker-compose がインストールされている必要があります。Docker desktop は最もシンプルなオプションです https://www.docker.com/products/docker-desktop/
7777

78-
以下を実行してください。
78+
## 実行
7979

8080
```
8181
docker-compose up -d && docker attach babyagi
8282
```
8383

84-
**注意:Ctrl+Cで終了しても```./clean.sh```の実行やDocker Desktopなどでコンテナ停止しないと停止しなくなりました。ご注意ください。**
84+
## 停止
85+
86+
```
87+
docker-compose stop
88+
```
89+
90+
**注意:Ctrl+Cで終了しても```docker-compose stop``````./clean.sh```を実行しない限り停止しません。ご注意ください。**
8591

8692
**注意:目的を達成できず、ループし続けることがあります。AnthropicやOpenAIのAPIの使用料にご注意ください。**
8793

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,19 @@ Please follow the steps below:
7575

7676
As a prerequisite, docker and docker-compose must be installed. Docker desktop is the simplest option https://www.docker.com/products/docker-desktop/
7777

78-
Please execute the following:
78+
## Run
7979

8080
```
8181
docker-compose up -d && docker attach babyagi
8282
```
8383

84-
**Note: Even if you exit with Ctrl+C, it will not stop unless you run ```./clean.sh``` or stop the container using Docker Desktop. Please be careful.**
84+
## Stop
85+
86+
```
87+
docker-compose stop
88+
```
89+
90+
**Note: Even if you exit with Ctrl+C, it will not stop unless you run ```docker-compose stop``` or ```./clean.sh```. Please be careful.**
8591

8692
**Note: The agent might loop indefinitely if it cannot achieve its objective. Please be aware of the cost of Anthropic and OpenAI APIs usage.**
8793

task_parser.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
class TaskParser:
55

66
def decode(self, input_string: str) -> List[dict]:
7-
data = input_string.strip().split("type:")[1:]
7+
input_string = input_string.strip()
8+
if input_string.startswith("type:"):
9+
# The "type:" at the beginning should be deleted because it will all be added later.
10+
input_string = input_string[len("type:"):]
11+
data = input_string.split("\ntype:")
12+
else:
13+
# Ignore the first part of the "\ntype:" division if it does not begin with "type:".
14+
data = input_string.split("\ntype:")[1:]
15+
816
if len(data) == 0:
917
raise ValueError("No valid items found")
1018
parsed_data = []

0 commit comments

Comments
 (0)