UNPKG

@microsoft/teams-ai

Version:

SDK focused on building AI based applications for Microsoft Teams.

34 lines 1.19 kB
/** * @module teams-ai */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ /** * Utilities for working with Large Language Model responses. */ export declare class Response { /** * Parse all objects from a response string. * @param {string} text Response text to parse. * @returns {Record<string, any>[]} Array of parsed objects. */ static parseAllObjects(text: string): Record<string, any>[]; /** * Fuzzy JSON parser. * @template TObject Type of the object to parse. * @param {string} text text to parse. * @returns {TObject | undefined} The parsed object or undefined if the object could not be parsed. */ static parseJSON<TObject = {}>(text: string): TObject | undefined; /** * Removes any empty fields from an object. * @remarks * Empty fields include `null`, `undefined`, `[]`, `{}`, and `""`. * @param {Record<string, any>} obj The object to clean. * @returns {Record<string, any>} A cleaned object. */ static removeEmptyValuesFromObject(obj: Record<string, any>): Record<string, any>; } //# sourceMappingURL=Response.d.ts.map