fix: route image presets through direct image mode
This commit is contained in:
parent
406bc6418e
commit
f18f9733df
@ -3884,6 +3884,16 @@ export async function POST(request: Request) {
|
|||||||
.trim();
|
.trim();
|
||||||
const autoContextText = typeof autoContext === "string" ? autoContext.trim() : "";
|
const autoContextText = typeof autoContext === "string" ? autoContext.trim() : "";
|
||||||
|
|
||||||
|
if (composerMode === "agent" && !agentPresetId) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
code: "bad_request:api",
|
||||||
|
message: "智能体模式缺少生图模式配置,请刷新页面后重新选择生图模式再试",
|
||||||
|
},
|
||||||
|
{ status: 400 },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
for (const [key, startedAt] of inFlightChatRequests.entries()) {
|
for (const [key, startedAt] of inFlightChatRequests.entries()) {
|
||||||
if (now - startedAt > IN_FLIGHT_REQUEST_TTL_MS) {
|
if (now - startedAt > IN_FLIGHT_REQUEST_TTL_MS) {
|
||||||
|
|||||||
@ -1081,8 +1081,12 @@ export function AgentGenerationWorkspaceDarkV2({
|
|||||||
hiddenPrompt: hiddenPromptRef.current || undefined,
|
hiddenPrompt: hiddenPromptRef.current || undefined,
|
||||||
agentPresetId:
|
agentPresetId:
|
||||||
transportState.selectedAgentPresetId || selectedAgentPresetId || undefined,
|
transportState.selectedAgentPresetId || selectedAgentPresetId || undefined,
|
||||||
selectedChatModel: transportState.selectedModelId,
|
selectedChatModel:
|
||||||
composerMode: "agent" as const,
|
transportState.selectedModelId !== "auto"
|
||||||
|
? transportState.selectedModelId
|
||||||
|
: selectedAgentPreset?.defaultModelId || transportState.selectedModelId,
|
||||||
|
composerMode:
|
||||||
|
selectedAgentPreset?.type === "image" ? ("image" as const) : ("agent" as const),
|
||||||
selectedVisibilityType: "private",
|
selectedVisibilityType: "private",
|
||||||
imageParams: transportState.imageParams,
|
imageParams: transportState.imageParams,
|
||||||
contextPayload: {
|
contextPayload: {
|
||||||
|
|||||||
@ -365,8 +365,12 @@ export function AgentGenerationWorkspaceNew({
|
|||||||
hiddenPrompt: hiddenPromptRef.current || undefined,
|
hiddenPrompt: hiddenPromptRef.current || undefined,
|
||||||
agentPresetId:
|
agentPresetId:
|
||||||
transportState.selectedAgentPresetId || selectedAgentPresetId || undefined,
|
transportState.selectedAgentPresetId || selectedAgentPresetId || undefined,
|
||||||
selectedChatModel: transportState.selectedModelId,
|
selectedChatModel:
|
||||||
composerMode: "agent" as const,
|
transportState.selectedModelId !== "auto"
|
||||||
|
? transportState.selectedModelId
|
||||||
|
: selectedAgentPreset?.defaultModelId || transportState.selectedModelId,
|
||||||
|
composerMode:
|
||||||
|
selectedAgentPreset?.type === "image" ? ("image" as const) : ("agent" as const),
|
||||||
selectedVisibilityType: "private",
|
selectedVisibilityType: "private",
|
||||||
imageParams: transportState.imageParams,
|
imageParams: transportState.imageParams,
|
||||||
contextPayload: {
|
contextPayload: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user