/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { featuresGetWeightedIndex } from "../../funcs/featuresGetWeightedIndex.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetWeightedIndexRequest$inboundSchema, }; export const tool$featuresGetWeightedIndex: ToolDefinition = { name: "features-get-weighted-index", description: `Returns the values of a user-definable index by creating a linear combination of features Provides a facility to create an index formed as a weighted basket of the list of features provided. The features provided must exist and listed as available at the \`/v1/features\` endpoint.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await featuresGetWeightedIndex( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };