UNPKG

@a2alite/sdk

Version:

A Modular SDK (Server & Client) for Agent to Agent (A2A) protocol, with easy task lifecycle management

44 lines (43 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTextPart = createTextPart; exports.createFilePart = createFilePart; exports.isFileWithBytes = isFileWithBytes; exports.isFileWithUri = isFileWithUri; exports.createDataPart = createDataPart; /** * Creates a text part with the given content and metadata */ function createTextPart(text, metadata) { return { kind: "text", text, ...(metadata && { metadata }), }; } /** * Creates a file part with the given file data and metadata */ function createFilePart(file, metadata) { return { kind: "file", file, ...(metadata && { metadata }), }; } function isFileWithBytes(file) { return "bytes" in file; } function isFileWithUri(file) { return "uri" in file; } /** * Creates a data part with the given data and metadata */ function createDataPart(data, metadata) { return { kind: "data", data, ...(metadata && { metadata }), }; }