AutoGPT
AutoGPT copied to clipboard
Use `async`/`await` where applicable
Background
Needed for #386 @itaim Needed for #1139 @merwanehamadi Needed for #1937 @arrenv Needed for #1243 Needed for #2442 @SwiftyTheCoder
Changes
Use async
/await
where applicable, change openai.{ChatCompletion,Embedding}.create
to .acreate
Documentation
Test Plan
PR Quality Checklist
- [x] My pull request is atomic and focuses on a single change.
- [x] I have thoroughly tested my changes with multiple different prompts.
- [x] I have considered potential risks and mitigations for my changes.
- [x] I have documented my changes clearly and comprehensively.
- [x] I have not snuck in any "extra" small tweaks changes
Sounds great, I think it will also fix my issue where agents start talking asynchronously for some reason. I hear them talking word for word in a very weird and gibberish way
@Androbin There are conflicts now
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.
Coverage report
The coverage rate went from 31.23%
to 31.2%
:arrow_down:
The branch rate is 17%
.
34.78%
of new lines are covered.
Diff Coverage details (click to unfold)
autogpt/commands/improve_code.py
0%
of new lines are covered (0%
of the complete file).
Missing lines: 14
, 35
autogpt/commands/image_gen.py
50%
of new lines are covered (21.42%
of the complete file).
Missing lines: 32
, 101
autogpt/memory/milvus.py
0%
of new lines are covered (2.7%
of the complete file).
Missing lines: 42
, 51
, 59
, 64
, 86
, 97
autogpt/commands/analyze_code.py
0%
of new lines are covered (0%
of the complete file).
Missing lines: 13
, 31
autogpt/processing/text.py
20%
of new lines are covered (17.07%
of the complete file).
Missing lines: 112
, 120
, 131
, 138
autogpt/json_utils/json_fix_llm.py
54.54%
of new lines are covered (33.62%
of the complete file).
Missing lines: 65
, 96
, 98
, 179
, 220
autogpt/memory/base.py
57.14%
of new lines are covered (57.14%
of the complete file).
Missing lines: 14
, 19
, 22
autogpt/commands/web_selenium.py
0%
of new lines are covered (0%
of the complete file).
Missing lines: 34
, 46
autogpt/app.py
36.36%
of new lines are covered (21.01%
of the complete file).
Missing lines: 110
, 111
, 113
, 155
, 206
, 212
, 222
autogpt/main.py
0%
of new lines are covered (0%
of the complete file).
Missing lines: 2
, 7
autogpt/agent/agent_manager.py
50%
of new lines are covered (12.84%
of the complete file).
Missing lines: 42
, 96
autogpt/commands/write_tests.py
0%
of new lines are covered (0%
of the complete file).
Missing lines: 15
, 37
autogpt/memory/redismem.py
50%
of new lines are covered (26.76%
of the complete file).
Missing lines: 91
, 113
, 133
autogpt/memory/weaviate.py
0%
of new lines are covered (2.59%
of the complete file).
Missing lines: 73
, 74
, 89
, 90
, 102
, 103
autogpt/logs.py
33.33%
of new lines are covered (33.33%
of the complete file).
Missing lines: 215
, 222
autogpt/commands/file_operations.py
50%
of new lines are covered (16.93%
of the complete file).
Missing lines: 133
autogpt/agent/agent.py
20%
of new lines are covered (8.9%
of the complete file).
Missing lines: 86
, 95
, 194
, 215
autogpt/memory/local.py
50%
of new lines are covered (42.25%
of the complete file).
Missing lines: 76
, 111
, 124
autogpt/memory/no_memory.py
100%
of new lines are covered (62.5%
of the complete file).
autogpt/memory/pinecone.py
50%
of new lines are covered (25%
of the complete file).
Missing lines: 47
, 55
, 67
autogpt/chat.py
50%
of new lines are covered (19.78%
of the complete file).
Missing lines: 182
, 198
autogpt/llm_utils.py
33.33%
of new lines are covered (11.53%
of the complete file).
Missing lines: 52
, 100
, 108
, 136
, 164
, 171
, 174
, 187
autogpt/cli.py
0%
of new lines are covered (0%
of the complete file).
Missing lines: 2
, 53
, 179
, 183
@Pwuts PTAL
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Can we put a pin in this one? There's another async PR that I'd prefer to have merged.
https://github.com/Significant-Gravitas/Auto-GPT/pull/2442
Sorry, super-awkward when this happens. I've put a wontfix label on this one for now.
Team is working on a mechanism whereby PRs need to be created as an issue that then is referenced by the PR, so we can avoid dups.
If there's a reason for promoting THIS PR, please do say!
Conflicts have been resolved! π A maintainer will review the pull request shortly.
Codecov Report
Patch coverage: 34.78
% and project coverage change: -7.50
:warning:
Comparison is base (
2b5852f
) 45.09% compared to head (7744460
) 37.60%.
Additional details and impacted files
@@ Coverage Diff @@
## master #1245 +/- ##
==========================================
- Coverage 45.09% 37.60% -7.50%
==========================================
Files 60 60
Lines 2856 2864 +8
Branches 472 473 +1
==========================================
- Hits 1288 1077 -211
- Misses 1463 1725 +262
+ Partials 105 62 -43
Impacted Files | Coverage Ξ | |
---|---|---|
autogpt/__main__.py | 0.00% <0.00%> (ΓΈ) |
|
autogpt/cli.py | 0.00% <0.00%> (ΓΈ) |
|
autogpt/commands/analyze_code.py | 0.00% <0.00%> (ΓΈ) |
|
autogpt/commands/improve_code.py | 0.00% <0.00%> (ΓΈ) |
|
autogpt/commands/web_selenium.py | 0.00% <0.00%> (ΓΈ) |
|
autogpt/commands/write_tests.py | 0.00% <0.00%> (ΓΈ) |
|
autogpt/memory/milvus.py | 3.03% <0.00%> (ΓΈ) |
|
autogpt/memory/weaviate.py | 3.27% <0.00%> (ΓΈ) |
|
autogpt/agent/agent.py | 12.74% <20.00%> (-28.44%) |
:arrow_down: |
autogpt/processing/text.py | 21.87% <20.00%> (ΓΈ) |
|
... and 13 more |
... and 8 files with indirect coverage changes
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@p-i- I don't see how this PR conflicts with #2442. It does not change any structure, all it does is replace .create
with .acreate
and propagate async
and await
through the caller hierarchy. Any PR seeking to introduce async code has to do exactly that. If #2442 ends up reimplementing some of these functions, it still needs to add async
and await
everywhere else.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! π A maintainer will review the pull request shortly.