feat: + summary

This commit is contained in:
莘权 马 2023-09-07 14:18:19 +08:00
parent 6848d189cf
commit 451b351055

View file

@ -20,20 +20,11 @@ class MetaGPTLLMAPI(OpenAIGPTAPI):
"""MetaGPT LLM api"""
def __init__(self):
self.__init_openai()
self.llm = openai
self.model = CONFIG.METAGPT_API_MODEL
self.auto_max_tokens = False
RateLimiter.__init__(self, rpm=self.rpm)
def __init_openai(self, *args, **kwargs):
# openai.api_key = CONFIG.METAGPT_API_KEY
# if CONFIG.METAGPT_API_BASE:
# openai.api_base = CONFIG.METAGPT_API_BASE
# if CONFIG.METAGPT_API_TYPE:
# openai.api_type = CONFIG.METAGPT_API_TYPE
# openai.api_version = CONFIG.METAGPT_API_VERSION
self.rpm = int(CONFIG.RPM) if CONFIG.RPM else 10
RateLimiter.__init__(self, rpm=self.rpm)
async def get_summary(self, memory: BrainMemory, max_words=200, keep_language: bool = False, **kwargs):
summary = []