/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";

export type FunctionT = {
  name: string;
  description?: string | undefined;
  strict?: boolean | undefined;
  parameters: { [k: string]: any };
};

/** @internal */
export type FunctionT$Outbound = {
  name: string;
  description?: string | undefined;
  strict?: boolean | undefined;
  parameters: { [k: string]: any };
};

/** @internal */
export const FunctionT$outboundSchema: z.ZodType<
  FunctionT$Outbound,
  z.ZodTypeDef,
  FunctionT
> = z.object({
  name: z.string(),
  description: z.string().optional(),
  strict: z.boolean().optional(),
  parameters: z.record(z.any()),
});

export function functionToJSON(functionT: FunctionT): string {
  return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
}
