npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@workstudio/ai

v1.0.1

Published

Unified interface for AI agents supporting OpenAI, Gemini, Anthropic, and xAI with multimodal and tool-calling support.

Readme

@workstudio/ai

A unified, type-safe interface for building agentic AI applications. Support for OpenAI, Google Gemini, Anthropic Claude, and xAI Grok with a single, consistent API.

Features

  • Unified API: Switch between providers (OpenAI, Gemini, Anthropic, xAI) with minimal code changes.
  • Multimodal Support: Easily handle text and image inputs (base64) across all supported models.
  • Tool Calling: Standardized interface for function/tool calling for agentic workflows.
  • JSON Schema Enforcement: Native support for structured outputs using JSON schemas.
  • TypeScript First: Full type safety for messages, data parts, and provider configurations.

Installation

pnpm add @workstudio/ai
# or
npm install @workstudio/ai

Quick Start

Basic Text Prompt

import { OpenAIProvider } from "@workstudio/ai";

const ai = new OpenAIProvider("gpt-4o");

const messages = [
  { role: "user", parts: [{ text: "Hello, how are you?" }] }
];

const struct = {
  instructions: ["You are a helpful assistant."],
  context: [],
  responseSchema: {
    type: "object",
    properties: {
      reply: { type: "string" }
    },
    required: ["reply"]
  }
};

const response = await ai.prompt(messages, struct);
console.log(response.reply);

Multimodal (Image + Text)

import { GeminiProvider } from "@workstudio/ai";

const ai = new GeminiProvider(process.env.GEMINI_API_KEY);

const messages = [
  {
    role: "user",
    parts: [
      { text: "What is in this image?" },
      { 
        inlineData: { 
          data: "base64_encoded_image_data", 
          mimeType: "image/jpeg" 
        } 
      }
    ]
  }
];

const response = await ai.prompt(messages, {
  instructions: [],
  context: [],
  responseSchema: null
});

console.log(response.message);

Tool Calling

const struct = {
  instructions: ["Help the user with weather and time."],
  context: [],
  responseSchema: null,
  tools: [
    {
      name: "get_weather",
      description: "Get current weather for a location",
      parameters: {
        type: "object",
        properties: {
          location: { type: "string" }
        },
        required: ["location"]
      }
    }
  ]
};

const response = await ai.prompt(messages, struct);
if (response.tool_calls) {
    // Handle tool calling
}

Supported Providers

| Provider | Class | Default Model | | :--- | :--- | :--- | | OpenAI | OpenAIProvider | gpt-4o | | Gemini | GeminiProvider | gemini-2.0-flash | | Anthropic | AnthropicProvider | claude-3-5-sonnet-latest | | xAI | XAIProvider | grok-2-1218 |

Contributing

Please see CONTRIBUTING.md for details on how to get involved.

License

MIT © Workstudio