Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/feishu/src/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 996 B image not shown  

Quelle  tool-result.test.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { describe, expect, it } from "vitest";
import {
  jsonToolResult,
  toolExecutionErrorResult,
  unknownToolActionResult,
} from "./tool-result.js";

describe("jsonToolResult", () => {
  it("formats tool result with text content and details", () => {
    const payload = { ok: true, id: "abc" };
    expect(jsonToolResult(payload)).toEqual({
      content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
      details: payload,
    });
  });

  it("formats unknown action errors", () => {
    expect(unknownToolActionResult("create")).toEqual({
      content: [
        { type: "text", text: JSON.stringify({ error: "Unknown action: create" }, null, 2) },
      ],
      details: { error: "Unknown action: create" },
    });
  });

  it("formats execution errors", () => {
    expect(toolExecutionErrorResult(new Error("boom"))).toEqual({
      content: [{ type: "text", text: JSON.stringify({ error: "boom" }, null, 2) }],
      details: { error: "boom" },
    });
  });
});

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.