fix config

This commit is contained in:
geekan 2023-11-27 15:48:07 +08:00
parent 331d74059f
commit 715a1d874a
4 changed files with 12 additions and 13 deletions

View file

@ -7,9 +7,9 @@
## Or, you can configure OPENAI_PROXY to access official OPENAI_API_BASE.
OPENAI_API_BASE: "https://api.openai.com/v1"
#OPENAI_PROXY: "http://127.0.0.1:8118"
#OPENAI_API_KEY: "YOUR_API_KEY" # set the value to sk-xxx if you host the openai interface for open llm model
OPENAI_API_MODEL: "gpt-4"
MAX_TOKENS: 1500
#OPENAI_API_KEY: "YOUR_API_KEY" # set the value to sk-xxx if you host the openai interface for open llm model
OPENAI_API_MODEL: "gpt-4-1106-preview"
MAX_TOKENS: 4096
RPM: 10
#### if Spark

View file

@ -5,11 +5,10 @@
@File : SummarizeCode.py
"""
from tenacity import retry, stop_after_attempt, wait_fixed
from metagpt.actions.action import Action
from metagpt.logs import logger
from metagpt.schema import Message
from metagpt.utils.common import CodeParser
from tenacity import retry, stop_after_attempt, wait_fixed
PROMPT_TEMPLATE = """
NOTICE
@ -23,10 +22,10 @@ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenc
## Code Review All: 请你对历史所有文件进行阅读分析每个文件是否都完整实现了用户需求找到可能的bug如函数未实现、调用错误、未引用等
## Summary: 根据历史文件的实现情况进行总结
## Call flow: 根据实现的函数使用mermaid绘制完整的调用链
## Summary: 根据历史文件的实现情况进行总结
## TODOs: 这里写出需要修改的文件列表,我们会在之后进行修改
"""
@ -80,14 +79,13 @@ class SummarizeCode(Action):
super().__init__(name, context, llm)
@retry(stop=stop_after_attempt(2), wait=wait_fixed(1))
async def write_code_review_all(self, prompt):
async def summarize_code(self, prompt):
code_rsp = await self._aask(prompt)
return code_rsp
async def run(self, context):
format_example = FORMAT_EXAMPLE.format()
prompt = PROMPT_TEMPLATE.format(context=context, format_example=format_example)
logger.info(f'Code review all..')
rsp = await self.write_code_review_all(prompt)
logger.info("Code review all..")
rsp = await self.summarize_code(prompt)
return rsp

View file

@ -5,13 +5,13 @@
@Author : alexanderwu
@File : write_code.py
"""
from tenacity import retry, stop_after_attempt, wait_fixed
from metagpt.actions import WriteDesign
from metagpt.actions.action import Action
from metagpt.config import CONFIG
from metagpt.logs import logger
from metagpt.schema import Message
from metagpt.utils.common import CodeParser
from tenacity import retry, stop_after_attempt, wait_fixed
PROMPT_TEMPLATE = """
NOTICE

View file

@ -6,7 +6,8 @@ channels==4.0.0
# docx==0.2.4
#faiss==1.5.3
faiss_cpu==1.7.4
fire==0.4.0
# fire==0.4.0
typer
# godot==0.1.1
# google_api_python_client==2.93.0
lancedb==0.1.16