diff options
author | Reinier van der Leer <pwuts@agpt.co> | 2024-01-19 15:45:31 +0100 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2024-01-19 15:45:31 +0100 |
commit | e4687e0f03a0bc7e313de24631270fdabfd3f86a (patch) | |
tree | 897b1922acefa371412a40682ce0cb61f5f41989 | |
parent | fix(agent): Handle artifact modification properly (diff) | |
download | Auto-GPT-e4687e0f03a0bc7e313de24631270fdabfd3f86a.tar.gz Auto-GPT-e4687e0f03a0bc7e313de24631270fdabfd3f86a.tar.bz2 Auto-GPT-e4687e0f03a0bc7e313de24631270fdabfd3f86a.zip |
fix(agent): Fix "ChatModelResponse not subscriptable" errors in `summarize_text` and `QueryLanguageModel` ability
- `summarize_text` and `QueryLanguageModel.__call__` still tried to access `response["content"]`, which isn't possible since upgrading to the OpenAI v1 client library.
-rw-r--r-- | autogpts/autogpt/autogpt/core/ability/builtins/query_language_model.py | 2 | ||||
-rw-r--r-- | autogpts/autogpt/autogpt/processing/text.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/autogpts/autogpt/autogpt/core/ability/builtins/query_language_model.py b/autogpts/autogpt/autogpt/core/ability/builtins/query_language_model.py index 63dd5cfb3..7a6ae68ee 100644 --- a/autogpts/autogpt/autogpt/core/ability/builtins/query_language_model.py +++ b/autogpts/autogpt/autogpt/core/ability/builtins/query_language_model.py @@ -62,5 +62,5 @@ class QueryLanguageModel(Ability): ability_name=self.name(), ability_args={"query": query}, success=True, - message=model_response.response["content"], + message=model_response.response.content or "", ) diff --git a/autogpts/autogpt/autogpt/processing/text.py b/autogpts/autogpt/autogpt/processing/text.py index c0e71c988..5fed8e6b7 100644 --- a/autogpts/autogpt/autogpt/processing/text.py +++ b/autogpts/autogpt/autogpt/processing/text.py @@ -119,7 +119,7 @@ async def summarize_text( temperature=0, max_tokens=500, ) - ).response["content"] + ).response.content logger.debug(f"\n{'-'*16} SUMMARY {'-'*17}\n{summary}\n{'-'*42}\n") return summary.strip(), None |