mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-31 11:54:30 +01:00
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.
This commit is contained in:
@@ -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 "",
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user