mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
feat: + summary
This commit is contained in:
parent
451b351055
commit
098027d249
2 changed files with 1 additions and 14 deletions
|
|
@ -48,12 +48,6 @@ BRAIN_MEMORY = "BRAIN_MEMORY"
|
|||
SKILL_PATH = "SKILL_PATH"
|
||||
SERPER_API_KEY = "SERPER_API_KEY"
|
||||
|
||||
# Key Definitions for MetaGPT LLM
|
||||
METAGPT_API_MODEL = "METAGPT_API_MODEL"
|
||||
METAGPT_API_KEY = "METAGPT_API_KEY"
|
||||
METAGPT_API_BASE = "METAGPT_API_BASE"
|
||||
METAGPT_API_TYPE = "METAGPT_API_TYPE"
|
||||
METAGPT_API_VERSION = "METAGPT_API_VERSION"
|
||||
|
||||
# format
|
||||
BASE64_FORMAT = "base64"
|
||||
|
|
|
|||
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue