CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-gradio--client

JavaScript and TypeScript client library for interacting with Gradio APIs, providing methods to connect to, submit predictions to, and manage connections with Gradio applications.

Overall
score

96%

Overview
Eval results
Files

task.mdevals/scenario-8/

Gradio Space Inspector

Build a command-line tool that connects to a Gradio application and provides detailed information about its configuration and available API endpoints.

Requirements

The tool should accept a Gradio app URL or Hugging Face Space name as input and output the following information:

  1. Application Metadata: Display the app's title, version, and mode
  2. API Endpoints: List all available API endpoints with their names
  3. Endpoint Details: For each endpoint, show:
    • Parameter names and types
    • Whether each parameter is required or optional
    • Default values for optional parameters
  4. File Upload Limits: Display the maximum file size allowed for uploads (if configured)

Implementation Details

  • The tool should handle connection errors gracefully and provide meaningful error messages
  • Output should be formatted in a readable way (plain text or JSON)
  • Include proper error handling for cases where the space doesn't exist or is unavailable

Test Cases

  • When connecting to a valid Gradio application, the tool retrieves and displays the application title and mode from the configuration @test
  • When connected to a Gradio app with multiple endpoints, the tool lists all available endpoint names @test
  • For a given endpoint, the tool displays detailed parameter information including parameter names, types, and whether they are required or optional @test

Dependencies { .dependencies }

@gradio/client { .dependency }

Provides client library for connecting to and inspecting Gradio applications.

API

/**
 * Connects to a Gradio application and retrieves its configuration
 */
export async function inspectGradioApp(appReference: string): Promise<AppInfo>;

/**
 * Information about a Gradio application
 */
export interface AppInfo {
  title: string;
  version: string;
  mode: string;
  endpoints: EndpointInfo[];
  maxFileSize?: number;
}

/**
 * Information about an API endpoint
 */
export interface EndpointInfo {
  name: string;
  parameters: ParameterInfo[];
}

/**
 * Information about an endpoint parameter
 */
export interface ParameterInfo {
  name: string;
  type: string;
  required: boolean;
  default?: any;
}

Implementation

@generates

Install with Tessl CLI

npx tessl i tessl/npm-gradio--client

tile.json