mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-30 03:16:23 +02:00
fixbug: last_talk
This commit is contained in:
parent
8e1034afff
commit
998411a125
2 changed files with 2 additions and 2 deletions
|
|
@ -233,7 +233,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
|
|||
|
||||
padding_size = 20 if max_token_count > 20 else 0
|
||||
text_windows = self.split_texts(text, window_size=max_token_count - padding_size)
|
||||
part_max_words = min(int(max_words / len(text_windows)) + 1, 100)
|
||||
part_max_words = min(int(max_words / len(text_windows)) + 1, 60)
|
||||
summaries = []
|
||||
for ws in text_windows:
|
||||
response = await self._get_summary(text=ws, max_words=part_max_words, keep_language=keep_language)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class Assistant(Role):
|
|||
return None
|
||||
if history_text == "":
|
||||
return last_talk
|
||||
history_summary = await self._llm.get_summary(history_text, max_words=800)
|
||||
history_summary = await self._llm.get_summary(history_text, max_words=800, keep_language=True)
|
||||
await self.memory.set_history_summary(
|
||||
history_summary=history_summary, redis_key=CONFIG.REDIS_KEY, redis_conf=CONFIG.REDIS
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue