Skip to main content

An integration package created by the company LOGYCA to interact with ChatGPT and analyze documents, files and other functionality of the OpenAI library.

Project description

Logyca

LOGYCA public libraries

Package version Python


About us


LOGYCA public libraries: To interact with ChatGPT and analyze documents, files and other functionality of the OpenAI library.

Source code | Package (PyPI) | Samples

To interact with the examples, keep the following in mind

FastAPI example. Through Swagger, you can:

Script example. Through of code, you can:


OCR engine to extract images.

  • Tesseract is an optical character recognition engine for various operating systems. It is free software, released under the Apache License. Originally developed by Hewlett-Packard as proprietary software in the 1980s, it was released as open source in 2005 and development was sponsored by Google in 2006

Install

Example for simple conversation.

{
  "system": "Voy a definirte tu personalidad, contexto y proposito.\nActua como un experto en venta de frutas.\nSe muy positivo.\nTrata a las personas de usted, nunca tutees sin importar como te escriban.",
  "messages": [
    {
      "additional_content": "",
      "type": "text",
      "user": "Dime 5 frutas amarillas"
    },
    {
      "assistant": "\n¡Claro! Aquí te van 5 frutas amarillas:\n\n1. Plátano\n2. Piña\n3. Mango\n4. Melón\n5. Papaya\n"
    },
    {
      "additional_content": "",
      "type": "text",
      "user": "Dame los nombres en ingles."
    }
  ]
}

Example for image conversation.

Using public published URL for image

{
  "system": "Actua como una maquina lectora de imagenes.\nDevuelve la información sin lenguaje natural, sólo responde lo que se está solicitando.\nEl dispositivo que va a interactuar contigo es una api, y necesita la información sin markdown u otros caracteres especiales.",
  "messages": [
    {
      "additional_content": {
        "base64_content_or_url": "https://raw.githubusercontent.com/logyca/python-libraries/main/logyca-ai/logyca_ai/assets_for_examples/file_or_documents/image.png",
        "image_format": "image_url",
        "image_resolution": "auto"
      },
      "type": "image_url",
      "user": "Extrae el texto que recibas en la imagen y devuelvelo en formato json."
    }
  ]
}

Using image content in base64

{
  "system": "Actua como una maquina lectora de imagenes.\nDevuelve la información sin lenguaje natural, sólo responde lo que se está solicitando.\nEl dispositivo que va a interactuar contigo es una api, y necesita la información sin markdown u otros caracteres especiales.",
  "messages": [
    {
      "additional_content": {
        "base64_content_or_url": "<base64 image png content>",
        "image_format": "png",
        "image_resolution": "auto"
      },
      "type": "image_base64",
      "user": "Extrae el texto que recibas en la imagen y devuelvelo en formato json."
    }
  ]
}

Example for pdf conversation.

Using public published URL for pdf

{
  "system": "No uses lenguaje natural para la respuesta.\nDame la información que puedas extraer de la imagen en formato JSON.\nSolo devuelve la información, no formatees con caracteres adicionales la respuesta.",
  "messages": [
    {
      "additional_content": {
        "base64_content_or_url": "https://raw.githubusercontent.com/logyca/python-libraries/main/logyca-ai/logyca_ai/assets_for_examples/file_or_documents/pdf.pdf",
        "pdf_format": "pdf_url"
      },
      "type": "pdf_url",
      "user": "Dame los siguientes datos: Expediente, radicación, Fecha, Numero de registro, Vigencia."
    }
  ]
}

Using pdf content in base64

{
  "system": "No uses lenguaje natural para la respuesta.\nDame la información que puedas extraer de la imagen en formato JSON.\nSolo devuelve la información, no formatees con caracteres adicionales la respuesta.",
  "messages": [
    {
      "additional_content": {
        "base64_content_or_url": "<base64 pdf content>",
        "pdf_format": "pdf"
      },
      "type": "pdf_base64",
      "user": "Dame los siguientes datos: Expediente, radicación, Fecha, Numero de registro, Vigencia."
    }
  ]
}

Semantic Versioning

logyca_ai < MAJOR >.< MINOR >.< PATCH >

  • MAJOR: version when you make incompatible API changes
  • MINOR: version when you add functionality in a backwards compatible manner
  • PATCH: version when you make backwards compatible bug fixes

Definitions for releasing versions

  • https://peps.python.org/pep-0440/

    • X.YaN (Alpha release): Identify and fix early-stage bugs. Not suitable for production use.
    • X.YbN (Beta release): Stabilize and refine features. Address reported bugs. Prepare for official release.
    • X.YrcN (Release candidate): Final version before official release. Assumes all major features are complete and stable. Recommended for testing in non-critical environments.
    • X.Y (Final release/Stable/Production): Completed, stable version ready for use in production. Full release for public use.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Types of changes

  • Added for new features.
  • Changed for changes in existing functionality.
  • Deprecated for soon-to-be removed features.
  • Removed for now removed features.
  • Fixed for any bug fixes.
  • Security in case of vulnerabilities.

[0.0.1aX] - 2024-08-02

Added

  • First tests using pypi.org in develop environment.

[0.1.0] - 2024-08-02

Added

  • Completion of testing and launch into production.

[0.1.1] - 2024-08-16

Added

  • The functions of extracting text from PDF files are refactored, using disk to optimize the use of ram memory and methods are added to extract text from images within the pages of the PDF files.

[0.1.2] - 2024-08-26

Added

  • New feature of attaching documents with txt, csv, docx, xlsx extension

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

logyca_ai-0.2.0a4.tar.gz (625.1 kB view details)

Uploaded Source

Built Distribution

logyca_ai-0.2.0a4-py3-none-any.whl (625.0 kB view details)

Uploaded Python 3

File details

Details for the file logyca_ai-0.2.0a4.tar.gz.

File metadata

  • Download URL: logyca_ai-0.2.0a4.tar.gz
  • Upload date:
  • Size: 625.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for logyca_ai-0.2.0a4.tar.gz
Algorithm Hash digest
SHA256 64f6a4a2584606466929dff5f1c507aabe2760010cc530c2583a7a1a257c5371
MD5 d836ed267510337d6c618d4c30769d73
BLAKE2b-256 b43f27dcc2919ab4ec84bfc5d283ff23e965ac097cd5e5e9d11f8b86e23ca3bc

See more details on using hashes here.

File details

Details for the file logyca_ai-0.2.0a4-py3-none-any.whl.

File metadata

  • Download URL: logyca_ai-0.2.0a4-py3-none-any.whl
  • Upload date:
  • Size: 625.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for logyca_ai-0.2.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 2c0ab7563da2fcd30f6dab3bfe657f6cf09a6b53cf875e08b8b18b0c8b4486f0
MD5 a8e0882fa844ca69a5a6dbd14367f15a
BLAKE2b-256 cc5394bb38264eb1e66cbbd56f9b8a34a666391671d325c47650886a4f23c454

See more details on using hashes here.

Supported by

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