# 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
```[language]
# 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]
Raw data
{
"_id": null,
"home_page": "https://github.com/dist-bit/copilot_integrations",
"name": "nebuia-copilot-python",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "xellDart",
"author_email": "miguel@nebuia.com",
"download_url": "https://files.pythonhosted.org/packages/12/68/0131e072d57acdce79517841e9cc30bd83061ff242acc46a5f3baa7b3b34/nebuia_copilot_python-0.0.16.tar.gz",
"platform": null,
"description": "# Nebuia Integration Library\n\nThis library provides an interface to interact with the Nebuia API, allowing operations for document processing, custom brain searching, and batch management.\n\n## Key Features\n\n- Integrator initialization with API credentials\n- Custom brain searching\n- Document management (retrieve, clear, delete)\n- Batch handling (create, get documents, add files)\n- Document type retrieval\n\n## Installation\n\n[Specific installation instructions for each language]\n\n## Basic Usage\n\n```[language]\n# Integrator initialization\nintegrator = Integrator(with_base='http://nebuia.instance/api/v1', key='api_key', secret='api_secret')\n\n# Usage example: Custom brain search\nresults = integrator.search_in_brain(search_params=SearchParameters(batch=\"brain_id\", param=\"flu\", k=2, type_search=\"literal\"))\n\n# Usage example: Get documents by status\ndocs = integrator.get_documents_by_status(status=StatusDocument.ERROR_LINK)\n\n# Usage example: Create a new batch\nstatus, batch_id = integrator.create_batch(\"name_batch\", batch_type=BatchType.TESTING)\n```\n\n## API Reference\n\n### Integrator Class\n\n#### Main Methods:\n\n- `search_in_brain(search_params: SearchParameters) -> dict`\n- `get_documents_by_status(status: StatusDocument) -> list`\n- `clear_document_by_uuid(uuid: str) -> dict`\n- `delete_document(uuid: str) -> dict`\n- `get_documents_by_batch_id(batch_id: str) -> BatchDocuments`\n- `append_to_batch(batch_id: str, files: list[File]) -> dict`\n- `get_document_types() -> list[DocumentType]`\n- `create_batch(name: str, batch_type: BatchType) -> tuple[bool, str]`\n\n### Data Structures\n\n- `File`: Represents a file to process\n- `SearchParameters`: Parameters for brain searching\n- `StatusDocument`: Enumeration of document statuses\n- `BatchType`: Enumeration of batch types\n\n## Error Handling\n\nThe library uses the Loguru logger to log information and errors. Make sure to configure Loguru appropriately in your application.\n\n## Implementation Notes\n\n- The library should handle API responses and convert them into appropriate data structures for each language.\n- Input validations should be implemented for method parameters.\n- Error handling should be consistent across all methods, using specific exceptions when appropriate.\n\n## Contributions\n\n[Instructions for contributing to the project]\n\n## License\n\n[License information]\n",
"bugtrack_url": null,
"license": null,
"summary": "NebuIA Copilot python integration",
"version": "0.0.16",
"project_urls": {
"Homepage": "https://github.com/dist-bit/copilot_integrations"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12680131e072d57acdce79517841e9cc30bd83061ff242acc46a5f3baa7b3b34",
"md5": "7c2c00fabe21cbdeafdcd83597ff62db",
"sha256": "21a854d1414df388698a9b37ba47335feff22801bdd606d16bb419d64a06fc5f"
},
"downloads": -1,
"filename": "nebuia_copilot_python-0.0.16.tar.gz",
"has_sig": false,
"md5_digest": "7c2c00fabe21cbdeafdcd83597ff62db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 19601,
"upload_time": "2024-08-13T06:28:07",
"upload_time_iso_8601": "2024-08-13T06:28:07.287136Z",
"url": "https://files.pythonhosted.org/packages/12/68/0131e072d57acdce79517841e9cc30bd83061ff242acc46a5f3baa7b3b34/nebuia_copilot_python-0.0.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-13 06:28:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dist-bit",
"github_project": "copilot_integrations",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nebuia-copilot-python"
}