feat: publish Agent Studio integrations and setup guide
This commit is contained in:
@@ -16,6 +16,17 @@ function event<T extends HarnessEvent>(value: Omit<T, "eventId" | "sessionId" |
|
||||
}
|
||||
|
||||
describe("reduceHarnessEvent", () => {
|
||||
it("shows tool-only assistant turns before the first text token without duplicating the final message", () => {
|
||||
const pending = [
|
||||
event<HarnessEvent>({ type: "run.started", sequence: 1, runId: "run_1", payload: { modelId: "qwen" } }),
|
||||
event<HarnessEvent>({ type: "tool.requested", sequence: 2, runId: "run_1", payload: { toolCallId: "tool_1", toolName: "mock_ads_metrics", arguments: { accountId: "demo-account", days: 7 } } }),
|
||||
].reduce(reduceHarnessEvent, createInitialHarnessState());
|
||||
expect(pending.messages.msg_run_1).toMatchObject({ role: "assistant", runId: "run_1", status: "running", text: "" });
|
||||
const final = reduceHarnessEvent(pending, event<HarnessEvent>({ type: "assistant.delta", sequence: 3, runId: "run_1", payload: { messageId: "msg_run_1", delta: "已获取指标" } }));
|
||||
expect(final.messageOrder).toEqual(["msg_run_1"]);
|
||||
expect(final.messages.msg_run_1?.text).toBe("已获取指标");
|
||||
});
|
||||
|
||||
it("builds messages, run state, tools, approvals, and timeline from ordered events", () => {
|
||||
const events: HarnessEvent[] = [
|
||||
event({ type: "user.message", sequence: 1, payload: { messageId: "msg_user", text: "分析素材", attachmentIds: [] } }),
|
||||
|
||||
Reference in New Issue
Block a user