Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(agent): Fix "ChatModelResponse not subscriptable" errors in `summarize_text` and `QueryLanguageModel` ability

Reinier van der Leere4687e0f03a0
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 63dd5cfb34..7a6ae68eea 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 c0e71c988e..5fed8e6b7a 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