ballerinax/ai.devant Ballerina library

1.0.0
Ballerina AI Devant Module

Overview

The ai.devant module provides APIs to interact with Devant by WSO2, enabling document chunking and loading documents from a directory in the format expected by the Devant Chunker. It integrates seamlessly with the ballerina/ai module to provide a smooth workflow for processing AI documents using Devant AI services.

Prerequisites

Before using this module in your Ballerina application, ensure you have the following:

  • A valid Devant AI service URL
  • An access token to authenticate with the Devant platform

Quickstart

To use the ai.devant module in your Ballerina application, follow these steps:

Step 1: Import the module

Copy
import ballerinax/ai.devant;

Step 2: Load the document

Copy
devant:BinaryDataLoader loader = check new ("./sample.pdf");
ai:Document|ai:Document[] docs = check loader.load();

Step 3: Chunk the documents using the Devant service

Copy
devant:Chunker chunker = new (serviceUrl, accessToken);
if docs is ai:Document {
    ai:Chunk[] chunks = check chunker.chunk(docs);
}

Import

import ballerinax/ai.devant;Copy

Other versions

1.0.0

Metadata

Released date: 5 days ago

Version: 1.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 12

Current verison: 12


Weekly downloads


Source repository


Keywords

AI

Devant

Chunkers


Contributors