@salesforce/agents
Version:
Client side APIs for working with Salesforce agents
38 lines • 1.43 kB
JavaScript
;
/*
* Copyright (c) 2023, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AgentTrace = void 0;
const maybe_mock_1 = require("./maybe-mock");
/**
* A service for retrieving agent execution traces. Provides detailed information
* about agent plan execution including steps, timing, and safety scores.
*
* **Examples**
*
* Get trace data for a specific trace ID:
*
* `const traceData = await AgentTrace.getTrace(connection, '12-23-34');`
*/
class AgentTrace {
/**
* Get the trace data for a given trace ID.
*
* @param connection The connection to use for making the API request
* @param traceId The trace ID to retrieve trace data for
* @returns Promise that resolves with the trace data response containing actions and their execution details
* @beta
*/
static async getTrace(connection, traceId) {
const maybeMock = new maybe_mock_1.MaybeMock(connection);
// TODO: who knows what the real endpoint will be, or if the return type is 100% accurate
const url = `/api/trace/${traceId}`;
return maybeMock.request('GET', url);
}
}
exports.AgentTrace = AgentTrace;
//# sourceMappingURL=agentTrace.js.map