Allow to interact with OneOffTech Librarian, an AI-enhanced knowledge search and synthesis agent for your organization's memories.
OneOffTech Librarian provides:
- Enterprise search, retrieve your organization's knowledge via search or chat
- Chat-based question and answer over multiple documents
- Summarization of documents in different languages
- Classification using existing machine learning models
- Extract information in a structured manner using LLMs, usefull for comparative analysis.
Important
The Librarian client package is a work in progress. Expect API changes between releases.
You can install the package via Composer:
composer require oneofftech/librarian-client
Requirements
- PHP 8.2+
The LibrarianConnector
is the main entry point for interacting with the OneOffTech Librarian AI service.
To create an instance of the LibrarianConnector
, you need to provide an authentication token and the base URL of the API. OneOffTech Librarian acts on a library, all or a subset of your organization's documents. Some of the features require a library identifier to perform actions on a specific set of documents. The library identifier is provided by OneOffTech during the configuration phase.
use OneOffTech\LibrarianClient\Connectors\LibrarianConnector;
$token = 'your-authentication-token';
$baseUrl = 'your-instance-url';
$connector = new LibrarianConnector($token, $baseUrl);
List All Documents in a Library
$documents = $connector->documents('library-id')->all();
foreach ($documents->items as $document) {
echo $document->id . ': ' . $document->title . PHP_EOL;
}
Get a Specific Document
$document = $connector->documents('library-id')->get('document-id');
echo $document->title;
Create a New Document
use OneOffTech\LibrarianClient\Dto\Document;
use OneOffTech\Parse\Client\DocumentFormat\DocumentNode;
$document = new Document(
id: 'new-document-id',
title: 'New Document',
data: DocumentNode::fromString('Document content')->toArray(),
);
$response = $connector->documents('library-id')->create($document);
echo $response->status();
Use our Parxy service to get the document content.
Delete a Document
$response = $connector->documents('library-id')->delete('document-id');
echo $response->status();
to be documented
to be documented
to be documented
to be documented
composer test
Please see CHANGELOG for more information on what has changed recently.
Thank you for considering contributing to the Librarian client! The contribution guide can be found in the CONTRIBUTING.md file.
Please review our security policy on how to report security vulnerabilities.
The project is provided and supported by OneOff-Tech (UG).
The MIT License (MIT). Please see License File for more information.