mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 01:36:29 +02:00
feat: +metagpt llm
This commit is contained in:
parent
39e2e1d8a0
commit
4e92206301
1 changed files with 3 additions and 3 deletions
|
|
@ -17,17 +17,17 @@ class MetaGPTLLMAPI(OpenAIGPTAPI):
|
|||
"""MetaGPT LLM api"""
|
||||
|
||||
def __init__(self):
|
||||
self.__init_openai(CONFIG)
|
||||
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, config):
|
||||
def __init_openai(self):
|
||||
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.get("RPM", 10))
|
||||
self.rpm = int(CONFIG.RPM) if CONFIG.RPM else 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue