Alquimia Documentation
  • Welcome To Alquimia
  • Architecture
  • Operational Handler
  • Alquimia Runtime Helm Chart
  • UI SDK
    • Alquimia-AI Tools
      • Summary
      • getting-started
        • Getting Started with Alquimia Tools
    • Alquimia-AI UI
      • Summary
      • api-reference
        • API Types Reference
      • components
        • Atom Components
        • Molecules
        • Organism Components
        • Components Overview
      • examples
        • Examples
      • getting-started
        • Installation
      • styling
        • Styling Guide
        • Using Custom Themes with Tailwind CSS
    • Alquimia AI Widget
Powered by GitBook
On this page
  • Overview
  • Key Features
  • Quick Links
  • Installation
  • Package Structure
  • Core Modules
  • SDK Configuration
  • Available Providers
  • Utility Functions
  • Integration with UI Package
  • Best Practices
  • Related Links
  • License
  1. UI SDK

Alquimia-AI Tools

Library providing essential SDK functionality, hooks, and utilities for building Alquimia AI applications. This library serves as the core integration layer for AI-powered chat assistants. Its core components are the SDK and the useAlquimia hook, which are used to manage the assitant interactions, along with the UI components.

Overview

Alquimia Tools provides a comprehensive SDK and React UI components designed for building AI-powered chat assistants. Built with TypeScript and following best practices, it offers a flexible and maintainable solution for integrating Alquimia AI capabilities.

Key Features

  • 🔧 Core SDK

    • AI Service Integration

    • Message Management

    • Streaming Support

    • Provider System

  • 🎣 React Integration

    • Custom Hooks

    • State Management

    • Real-time Updates

    • TypeScript Support

  • 🛠️ Tech Stack

    • Next.js 14+

    • React 18+

    • TypeScript 5.3+

  • 🎯 Other Features

    • Speech-to-Text (Whisper)

    • Image Generation

    • Content Analysis

    • Feedback Collection

    • Logging System

Quick Links

Installation

# Using npm
npm install @alquimia-ai/tools

# Using yarn
yarn add @alquimia-ai/tools

# Using pnpm
pnpm add @alquimia-ai/tools

Basic usage:

Initialize the SDK in a config file, and use the useAlquimia hook in your components.

import { AlquimiaSDK } from '@alquimia-ai/tools/sdk'
import { useAlquimia } from '@alquimia-ai/tools/hooks'

// Initialize SDK
const sdk = new AlquimiaSDK({
  apiKey: 'your-api-key',
  chatUrl: 'your-chat-url',
  streamUrl: 'your-stream-url',
  assistantId: 'your-assistant-id'
})

// Use in components
function ChatComponent() {
  const { messages, input, handleSubmit } = useAlquimia(sdk)
  // Your implementation
}

Package Structure

@alquimia-ai/tools/
├── sdk/
├── hooks/
├── providers/
├── utils/
├── types/
└── actions/

Core Modules

SDK Configuration

The SDK supports various providers and configurations:

const sdk = new AlquimiaSDK(config)
  .withWhisperProvider(whisperProvider)
  .withRatingsProvider(ratingsProvider)
  .withLoggerProvider(loggerProvider)

Available Providers

  • WhisperProvider (Speech-to-Text)

  • StableDiffusionProvider (Image Generation)

  • CharacterizationProvider (Content Analysis)

  • RatingsProvider (Feedback)

  • LoggerProvider (Logging)

Utility Functions

  • Message formatting

  • Error handling

  • Data transformation

Integration with UI Package

While usable independently, this package is designed to work seamlessly with @alquimia-ai/ui, providing:

  • Ready-to-use chat interfaces

  • Message streaming visualization

  • Audio input/output handling

  • Rating and feedback components

Best Practices

  1. Always initialize SDK with proper configuration

  2. Use the useAlquimia hook for managing chat state

  3. Implement server actions with API Routes

  4. Leverage TypeScript for type safety

Related Links

License


PreviousUI SDKNextSummary

Last updated 4 months ago

To see full example, check the section.

MIT ©

Getting Started
Alquimia AI Website
Alquimia AI Docs
UI Package Documentation
Alquimia AI
Next: Getting Started →
Getting Started
SDK Reference
Hooks Reference
API Reference