1.优化隔离工作目录2.新增图像生成和编辑功能3.生成模型替换为本地flux2 klein
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import uuid
|
||||
import json
|
||||
@@ -6,6 +7,8 @@ from typing import AsyncGenerator
|
||||
|
||||
from fastapi import APIRouter
|
||||
from fastapi.responses import StreamingResponse
|
||||
|
||||
from src.core.config import PROJECT_ROOT
|
||||
from src.schemas.deep_agent_chat import DeepAgentChatRequest, HistoryResponse, HistoryItem
|
||||
from langchain_core.messages import HumanMessage, SystemMessage, AIMessageChunk, ToolMessage, AIMessage, ToolMessageChunk
|
||||
|
||||
@@ -77,13 +80,15 @@ async def chat_stream(request: DeepAgentChatRequest):
|
||||
source_thread_id = request.thread_id
|
||||
checkpoint_id = request.checkpoint_id
|
||||
|
||||
# 构建主agent
|
||||
main_agent = build_main_agent(request.use_report)
|
||||
|
||||
# 1. 確定目標 thread_id
|
||||
is_branching = source_thread_id and checkpoint_id
|
||||
target_thread_id = str(uuid.uuid4())[:8] if is_branching else (source_thread_id or str(uuid.uuid4())[:8])
|
||||
|
||||
# 构建主agent
|
||||
workspace_dir = os.path.join(PROJECT_ROOT, f"agent_workspace/{target_thread_id}")
|
||||
print(f"target_thread_id : workspace_dir: {workspace_dir}")
|
||||
main_agent = build_main_agent(request.use_report, workspace_dir)
|
||||
|
||||
# 2. 配置參數
|
||||
temp = request.config_params.temperature if request.config_params else 0.7
|
||||
|
||||
|
||||
Reference in New Issue
Block a user