feat: + summary

This commit is contained in:
莘权 马 2023-09-07 14:23:36 +08:00
parent 451b351055
commit 098027d249
2 changed files with 1 additions and 14 deletions

View file

@ -7,24 +7,17 @@
"""
import json
import openai
from pydantic import BaseModel
from metagpt.config import CONFIG
from metagpt.memory.brain_memory import BrainMemory
from metagpt.provider import OpenAIGPTAPI
from metagpt.provider.openai_api import RateLimiter
class MetaGPTLLMAPI(OpenAIGPTAPI):
"""MetaGPT LLM api"""
def __init__(self):
self.llm = openai
self.model = CONFIG.METAGPT_API_MODEL
self.auto_max_tokens = False
self.rpm = int(CONFIG.RPM) if CONFIG.RPM else 10
RateLimiter.__init__(self, rpm=self.rpm)
super().__init__()
async def get_summary(self, memory: BrainMemory, max_words=200, keep_language: bool = False, **kwargs):
summary = []