remove challenge's content
This commit is contained in:
@@ -14,17 +14,16 @@ SYSTEM_PROMPT = """你是一个网页生成助手。根据用户的需求描述
|
||||
6. 由于任何外部链接都被屏蔽,使用纯 HTML、CSS 和 JS 实现功能,不要依赖外部库"""
|
||||
|
||||
|
||||
def build_messages(task_content: str, history: list[dict]) -> list[dict]:
|
||||
def build_messages(history: list[dict]) -> list[dict]:
|
||||
"""Build the message list for the LLM API call."""
|
||||
system = SYSTEM_PROMPT + f"\n\n当前挑战任务要求:\n{task_content}"
|
||||
messages = [{"role": "system", "content": system}]
|
||||
messages = [{"role": "system", "content": SYSTEM_PROMPT}]
|
||||
messages.extend(history)
|
||||
return messages
|
||||
|
||||
|
||||
async def stream_chat(task_content: str, history: list[dict]):
|
||||
async def stream_chat(history: list[dict]):
|
||||
"""Stream chat completion from the LLM. Yields content chunks."""
|
||||
messages = build_messages(task_content, history)
|
||||
messages = build_messages(history)
|
||||
async with AsyncOpenAI(
|
||||
api_key=settings.LLM_API_KEY,
|
||||
base_url=settings.LLM_BASE_URL,
|
||||
|
||||
Reference in New Issue
Block a user