@usegrant/ai-sdk-tools
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

UseGrant AI SDK Tools

This is a set of tools for interacting with the UseGrant API using the Vercel AI SDK.

The tooks are exported for convinience to interact with UseGrant from any AI SDK. You can refer to the source src/index.ts to copy the code and customize it for your needs.

Requirements

  • A valid UseGrant API key. Refer here for more details.

Tools

  • listProviders: List all providers
  • createProvider: Create a new provider
  • getProvider: Get a provider by ID
  • deleteProvider: Delete a provider
  • listClients: List all clients for a provider
  • createClient: Create a new client for a provider
  • getClient: Get client details by provider and client ID
  • deleteClient: Delete a client from a provider
  • listDomains: List all domains for a provider
  • addDomain: Add a new domain for a provider
  • getDomain: Get a domain by provider and domain ID
  • deleteDomain: Delete a domain by provider and domain ID
  • verifyDomain: Verify a domain by provider and domain ID
  • createAccessToken: Create a new access token for a client
  • listTenants: List all tenants
  • createTenant: Create a new tenant
  • getTenant: Get a tenant by ID
  • deleteTenant: Delete a tenant
  • listTenantProviders: List all providers for a tenant
  • createTenantProvider: Create a new provider for a tenant
  • getTenantProvider: Get a provider for a tenant
  • deleteTenantProvider: Delete a provider for a tenant
  • validateAccessToken: Validate an access token for a tenant

Using with AI SDK

import { generateText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { createTools } from '@usegrant/ai-sdk-tools';

const tools = createTools('usegrant_api_key');

const { text } = await generateText({
  model: anthropic('claude-3-5-haiku-latest'),
  prompt: 'Invent a new holiday and describe its traditions.',
  tools: {
    ...tools,
    // other tools
  },
});

License

This project is licensed under the MIT License. See the LICENSE file for details.

Package Sidebar

Install

npm i @usegrant/ai-sdk-tools

Weekly Downloads

11

Version

1.2.0

License

MIT

Unpacked Size

53.8 kB

Total Files

6

Last publish

Collaborators

  • sibiraj-s