新增应用样式 agent 工具
This commit is contained in:
@@ -5,6 +5,11 @@ import { useCallback } from "react";
|
||||
import { useChatToolStore, type ChatToolAction } from "@/store/chatToolStore";
|
||||
import type { StreamEvent } from "@/lib/chatStream";
|
||||
import type { AgentArtifact, AgentArtifactKind } from "../GlobalChatbox.types";
|
||||
import {
|
||||
APPLY_LAYER_STYLE_TOOL,
|
||||
describeApplyLayerStyle,
|
||||
parseApplyLayerStylePayload,
|
||||
} from "../toolCallStyleHelpers";
|
||||
|
||||
type ToolCallEvent = StreamEvent & { type: "tool_call" };
|
||||
|
||||
@@ -248,6 +253,23 @@ const buildToolAction = (
|
||||
};
|
||||
}
|
||||
|
||||
if (tool === APPLY_LAYER_STYLE_TOOL) {
|
||||
const payload = parseApplyLayerStylePayload(params);
|
||||
return {
|
||||
action: payload
|
||||
? {
|
||||
type: "apply_layer_style",
|
||||
layerId: payload.layerId,
|
||||
resetToDefault: payload.resetToDefault,
|
||||
styleConfig: payload.styleConfig,
|
||||
}
|
||||
: null,
|
||||
kind: "map",
|
||||
title: payload?.resetToDefault ? "重置图层样式" : "应用图层样式",
|
||||
description: payload ? describeApplyLayerStyle(payload) : "图层样式",
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
action: null,
|
||||
kind: "tool",
|
||||
|
||||
Reference in New Issue
Block a user