1.新增视觉能力 2.新增对上次图片 或 上传图片 引用图片做编辑能力.
This commit is contained in:
@@ -39,6 +39,8 @@ async def chat_stream(request: DeepAgentChatRequest):
|
|||||||
|
|
||||||
#### 2. 请求参数
|
#### 2. 请求参数
|
||||||
* `message`: 用户的设计意图(如:'我想设计一个极简风格的橡木办公桌')。
|
* `message`: 用户的设计意图(如:'我想设计一个极简风格的橡木办公桌')。
|
||||||
|
* `quote_image_path`: 用户引用图片地址 如:'["fida-test/furniture/sketches/8a1804d1-5ac9-4d02-bf17-e65fa7272f65.png"]')。
|
||||||
|
* `input_image_paths`: 用户上传图片地址集合如:('["fida-test/furniture/sketches/8a1804d1-5ac9-4d02-bf17-e65fa7272f65.png"]')。
|
||||||
* `thread_id`: (可选) 现有项目的唯一标识。若不传,系统将自动分配并返回。
|
* `thread_id`: (可选) 现有项目的唯一标识。若不传,系统将自动分配并返回。
|
||||||
* `checkpoint_id`: (可选) 历史快照 ID。
|
* `checkpoint_id`: (可选) 历史快照 ID。
|
||||||
* `config_params`: (可选) 对话配置参数
|
* `config_params`: (可选) 对话配置参数
|
||||||
@@ -70,6 +72,20 @@ async def chat_stream(request: DeepAgentChatRequest):
|
|||||||
"thread_id": "187e58af",
|
"thread_id": "187e58af",
|
||||||
"checkpoint_id": "1f101aa2-8f24-6e2a-8001-2952c3a7447a"
|
"checkpoint_id": "1f101aa2-8f24-6e2a-8001-2952c3a7447a"
|
||||||
}
|
}
|
||||||
|
用户上传:
|
||||||
|
{
|
||||||
|
"message": "合并两张图一边一半,左右拼",
|
||||||
|
"input_image_paths": [
|
||||||
|
"fida-test/furniture/sketches/218adbd2-c312-4298-9a82-5a92601ac9e2.png",
|
||||||
|
"fida-test/furniture/sketches/8a1804d1-5ac9-4d02-bf17-e65fa7272f65.png"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
用户引用:
|
||||||
|
{
|
||||||
|
"message": "描述这张图",
|
||||||
|
"quote_image_path":"fida-test/furniture/sketches/218adbd2-c312-4298-9a82-5a92601ac9e2.png"
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5. 响应流说明
|
### 5. 响应流说明
|
||||||
@@ -140,8 +156,8 @@ async def chat_stream(request: DeepAgentChatRequest):
|
|||||||
"current_image": ""
|
"current_image": ""
|
||||||
}
|
}
|
||||||
# 用户上传图片
|
# 用户上传图片
|
||||||
if request.input_image_path:
|
if request.input_image_paths:
|
||||||
for path in request.input_image_path:
|
for path in request.input_image_paths:
|
||||||
bucket, object_name = path.split('/', 1)
|
bucket, object_name = path.split('/', 1)
|
||||||
image_url = get_presigned_url(oss_client=minio_client, bucket=bucket, object_name=object_name)
|
image_url = get_presigned_url(oss_client=minio_client, bucket=bucket, object_name=object_name)
|
||||||
content.append({"type": "image_url", "image_url": {"url": image_url}})
|
content.append({"type": "image_url", "image_url": {"url": image_url}})
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class AgentConfig(BaseModel):
|
|||||||
class DeepAgentChatRequest(BaseModel):
|
class DeepAgentChatRequest(BaseModel):
|
||||||
message: str = Field(..., description="用户的输入指令")
|
message: str = Field(..., description="用户的输入指令")
|
||||||
quote_image_path: Optional[str] = Field(None, description="引用图片地址") # ✅ 新增
|
quote_image_path: Optional[str] = Field(None, description="引用图片地址") # ✅ 新增
|
||||||
input_image_path: Optional[list[str]] = Field(None, description="上传图片地址集合") # ✅ 新增
|
input_image_paths: Optional[list[str]] = Field(None, description="上传图片地址集合") # ✅ 新增
|
||||||
thread_id: Optional[str] = Field(None, description="会话线程ID,不传则开启新会话")
|
thread_id: Optional[str] = Field(None, description="会话线程ID,不传则开启新会话")
|
||||||
checkpoint_id: Optional[str] = Field(None, description="回溯点的ID,用于从历史点开启新对话")
|
checkpoint_id: Optional[str] = Field(None, description="回溯点的ID,用于从历史点开启新对话")
|
||||||
config_params: Optional[AgentConfig] = None
|
config_params: Optional[AgentConfig] = None
|
||||||
|
|||||||
@@ -71,8 +71,9 @@ def build_painter_prompt():
|
|||||||
|
|
||||||
### ✅ 1. 编辑类(必须使用 edit_furniture)
|
### ✅ 1. 编辑类(必须使用 edit_furniture)
|
||||||
当用户输入包含以下语义时:
|
当用户输入包含以下语义时:
|
||||||
- 修改 / 改成 / 换成 / 调整 / 优化 / 变成 / 改颜色 / 改样式
|
- 修改 / 改成 / 换成 / 调整 / 优化 / 变成 / 改颜色 / 改样式 / 拼接
|
||||||
- 或任何“基于已有图片做改变”的表达
|
- 或任何“基于已有图片做改变”的表达
|
||||||
|
- 或任何“基于多张图片做合并提取”的表达
|
||||||
|
|
||||||
👉 必须使用:
|
👉 必须使用:
|
||||||
edit_furniture
|
edit_furniture
|
||||||
|
|||||||
Reference in New Issue
Block a user