parametersSchema (VoiceTools.swift)

iOS-vibebuddy · realtime, json-schema, function-calling, parameter-validation, voice-tools, ai

Builds JSON schema for voice tool parameters, enabling AI function calling.

// Source: https://github.com/semantic-craft/iOS-vibebuddy | License: MIT | Copyright 2026 Xianwei Zhang
// Provided via justclaw.it.com; keep this notice with the code.
import Foundation

/// One function-calling tool offered to a realtime voice session, in a
/// provider-agnostic shape. Each provider serializes it onto its own wire format
/// (`functionSchema()` for the OpenAI-Realtime-style providers, including Qwen;
/// `geminiDeclaration()` for Gemini Live). `Sendable` so it can cross into the
/// provider actors.
public struct VoiceTool: Sendable {
    public let name: String
    public let description: String
    public let parameters: [Parameter]
    public let required: [String]

    public struct Parameter: Sendable {
        public let name: String
        public let type: Strin

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key