Skip to main content

NebuIA Copilot python integration

Project description

Nebuia Integration Library

This library provides an interface to interact with the Nebuia API, allowing operations for document processing, custom brain searching, and batch management.

Key Features

  • Integrator initialization with API credentials
  • Custom brain searching
  • Document management (retrieve, clear, delete)
  • Batch handling (create, get documents, add files)
  • Document type retrieval

Installation

[Specific installation instructions for each language]

Basic Usage

# Integrator initialization
integrator = Integrator(with_base='http://nebuia.instance/api/v1', key='api_key', secret='api_secret')

# Usage example: Custom brain search
results = integrator.search_in_brain(search_params=SearchParameters(batch="brain_id", param="flu", k=2, type_search="literal"))

# Usage example: Get documents by status
docs = integrator.get_documents_by_status(status=StatusDocument.ERROR_LINK)

# Usage example: Create a new batch
status, batch_id = integrator.create_batch("name_batch", batch_type=BatchType.TESTING)

API Reference

Integrator Class

Main Methods:

  • search_in_brain(search_params: SearchParameters) -> dict
  • get_documents_by_status(status: StatusDocument) -> list
  • clear_document_by_uuid(uuid: str) -> dict
  • delete_document(uuid: str) -> dict
  • get_documents_by_batch_id(batch_id: str) -> BatchDocuments
  • append_to_batch(batch_id: str, files: list[File]) -> dict
  • get_document_types() -> list[DocumentType]
  • create_batch(name: str, batch_type: BatchType) -> tuple[bool, str]

Data Structures

  • File: Represents a file to process
  • SearchParameters: Parameters for brain searching
  • StatusDocument: Enumeration of document statuses
  • BatchType: Enumeration of batch types

Error Handling

The library uses the Loguru logger to log information and errors. Make sure to configure Loguru appropriately in your application.

Implementation Notes

  • The library should handle API responses and convert them into appropriate data structures for each language.
  • Input validations should be implemented for method parameters.
  • Error handling should be consistent across all methods, using specific exceptions when appropriate.

Contributions

[Instructions for contributing to the project]

License

[License information]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nebuia_copilot_python-0.0.16.tar.gz (19.6 kB view details)

Uploaded Source

File details

Details for the file nebuia_copilot_python-0.0.16.tar.gz.

File metadata

  • Download URL: nebuia_copilot_python-0.0.16.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for nebuia_copilot_python-0.0.16.tar.gz
Algorithm Hash digest
SHA256 21a854d1414df388698a9b37ba47335feff22801bdd606d16bb419d64a06fc5f
MD5 7c2c00fabe21cbdeafdcd83597ff62db
BLAKE2b-256 12680131e072d57acdce79517841e9cc30bd83061ff242acc46a5f3baa7b3b34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page