guillotina-nuclia


Nameguillotina-nuclia JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/guillotinaweb/guillotina_nuclia
Summarynuclia support for guillotina
upload_time2025-07-29 10:23:03
maintainerNone
docs_urlNone
authorNil Bacardit Vinyals
requires_pythonNone
licenseGPL version 3
keywords ai async guillotina nuclia
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            guillotina_nuclia – Quick Setup
================================

This package lets your Guillotina instance talk to **Nuclia**.
Below is the only thing you have to do: drop the utility in ``app_settings``
and export your credentials.

Install
-------

.. code-block:: bash

    pip install guillotina_nuclia

Configure the Nuclia utility
----------------------------

These are the settings regarding nuclia already configured in the package.
You mostly need to set up the next env variables: NUA_KEY, APIKEY, KBID, GENERATIVE_MODEL

.. code-block:: python

    import os

    app_settings = {
        "load_utilities": {
            "nuclia": {
                # interface that the utility will provide
                "provides": "guillotina_nuclia.utility.INucliaUtility",
                # dotted path to the factory
                "factory": "guillotina_nuclia.utility.NucliaUtility",
                # parameters forwarded to the factory
                "settings": {
                    # which LLM model Nuclia will use for generative answers
                    "generative_model": os.environ.get("GENERATIVE_MODEL", "chatgpt4o"),
                    # your personal Nuclia key (required)
                    "nua_key": os.environ.get("NUA_KEY"),
                    # hard limit for tokens (optional)
                    "max_tokens": os.environ.get("MAX_TOKENS"),
		    # Nuclia's API KEY
		    "apikey": os.environ.get("APIKEY"),
		    # Knowledge Box ID
		    "kbid": os.environ.get("KBID", ""),
		    
                },
            }
        }
    }

Set the environment variables
-----------------------------

.. list-table:: Environment variables
   :header-rows: 1

   * - Variable
     - Required
     - Example value
     - Description
   * - ``NUA_KEY``
     - **Yes**
     - ``nua_pk_live_…``
     - API token generated in the Nuclia dashboard.
   * - ``GENERATIVE_MODEL``
     - No
     - ``chatgpt4o`` (default)
     - LLM used for ``ask`` / ``predict``.
   * - ``MAX_TOKENS``
     - No
     - ``2048``
     - Maximum tokens per answer.

Export them before launching Guillotina:

.. code-block:: bash

    export NUA_KEY=\"nua_pk_live_your_token_here\"
    export KBID=\"Knwoledge box id\"
    export API_KEY=\"Nuclia's api key\"
    export GENERATIVE_MODEL=\"chatgpt4o\"   # optional
    export MAX_TOKENS=2048                 # optional

Done!
-----

Start Guillotina as usual—``INucliaUtility`` is now available
everywhere and the built-in routes POST (``@NucliaAsk``,
``@NucliaFind``, ``@NucliaPredict``, ``@NucliaSearch``,
``@NucliaAskStream``, etc.) will automatically work.

❤️  Happy coding!

1.0.3 (2025-07-29)
------------------

- Adding retrieval response in @NucliaAskStream
  [nilbacardit26]
- Convert all the endpoints from GET to POST. Now the question goes to
  the body
  [nilbacardit26]


1.0.2 (2025-07-28)
------------------

- Fixing TypeError: can only concatenate str when kbid is not passed
  [nilbacardit26]


1.0.1 (2025-07-28)
------------------

- Fixing KBID auth
  [nilbacardit26]
- Adding @NucliaAskStream endpoint
  [nilbacardit26]


1.0.0 (2025-07-23)
------------------

- Initial release
  [nilbacardit26]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guillotinaweb/guillotina_nuclia",
    "name": "guillotina-nuclia",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "AI async guillotina nuclia",
    "author": "Nil Bacardit Vinyals",
    "author_email": "n.bacardit@iskra.cat",
    "download_url": "https://files.pythonhosted.org/packages/6e/16/92ccce7f0901abe76346d2882841a63d029dbce2efa0acb449af063c4ddd/guillotina_nuclia-1.0.3.tar.gz",
    "platform": null,
    "description": "guillotina_nuclia \u2013 Quick Setup\n================================\n\nThis package lets your Guillotina instance talk to **Nuclia**.\nBelow is the only thing you have to do: drop the utility in ``app_settings``\nand export your credentials.\n\nInstall\n-------\n\n.. code-block:: bash\n\n    pip install guillotina_nuclia\n\nConfigure the Nuclia utility\n----------------------------\n\nThese are the settings regarding nuclia already configured in the package.\nYou mostly need to set up the next env variables: NUA_KEY, APIKEY, KBID, GENERATIVE_MODEL\n\n.. code-block:: python\n\n    import os\n\n    app_settings = {\n        \"load_utilities\": {\n            \"nuclia\": {\n                # interface that the utility will provide\n                \"provides\": \"guillotina_nuclia.utility.INucliaUtility\",\n                # dotted path to the factory\n                \"factory\": \"guillotina_nuclia.utility.NucliaUtility\",\n                # parameters forwarded to the factory\n                \"settings\": {\n                    # which LLM model Nuclia will use for generative answers\n                    \"generative_model\": os.environ.get(\"GENERATIVE_MODEL\", \"chatgpt4o\"),\n                    # your personal Nuclia key (required)\n                    \"nua_key\": os.environ.get(\"NUA_KEY\"),\n                    # hard limit for tokens (optional)\n                    \"max_tokens\": os.environ.get(\"MAX_TOKENS\"),\n\t\t    # Nuclia's API KEY\n\t\t    \"apikey\": os.environ.get(\"APIKEY\"),\n\t\t    # Knowledge Box ID\n\t\t    \"kbid\": os.environ.get(\"KBID\", \"\"),\n\t\t    \n                },\n            }\n        }\n    }\n\nSet the environment variables\n-----------------------------\n\n.. list-table:: Environment variables\n   :header-rows: 1\n\n   * - Variable\n     - Required\n     - Example value\n     - Description\n   * - ``NUA_KEY``\n     - **Yes**\n     - ``nua_pk_live_\u2026``\n     - API token generated in the Nuclia dashboard.\n   * - ``GENERATIVE_MODEL``\n     - No\n     - ``chatgpt4o`` (default)\n     - LLM used for ``ask`` / ``predict``.\n   * - ``MAX_TOKENS``\n     - No\n     - ``2048``\n     - Maximum tokens per answer.\n\nExport them before launching Guillotina:\n\n.. code-block:: bash\n\n    export NUA_KEY=\\\"nua_pk_live_your_token_here\\\"\n    export KBID=\\\"Knwoledge box id\\\"\n    export API_KEY=\\\"Nuclia's api key\\\"\n    export GENERATIVE_MODEL=\\\"chatgpt4o\\\"   # optional\n    export MAX_TOKENS=2048                 # optional\n\nDone!\n-----\n\nStart Guillotina as usual\u2014``INucliaUtility`` is now available\neverywhere and the built-in routes POST (``@NucliaAsk``,\n``@NucliaFind``, ``@NucliaPredict``, ``@NucliaSearch``,\n``@NucliaAskStream``, etc.) will automatically work.\n\n\u2764\ufe0f  Happy coding!\n\n1.0.3 (2025-07-29)\n------------------\n\n- Adding retrieval response in @NucliaAskStream\n  [nilbacardit26]\n- Convert all the endpoints from GET to POST. Now the question goes to\n  the body\n  [nilbacardit26]\n\n\n1.0.2 (2025-07-28)\n------------------\n\n- Fixing TypeError: can only concatenate str when kbid is not passed\n  [nilbacardit26]\n\n\n1.0.1 (2025-07-28)\n------------------\n\n- Fixing KBID auth\n  [nilbacardit26]\n- Adding @NucliaAskStream endpoint\n  [nilbacardit26]\n\n\n1.0.0 (2025-07-23)\n------------------\n\n- Initial release\n  [nilbacardit26]\n",
    "bugtrack_url": null,
    "license": "GPL version 3",
    "summary": "nuclia support for guillotina",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/guillotinaweb/guillotina_nuclia"
    },
    "split_keywords": [
        "ai",
        "async",
        "guillotina",
        "nuclia"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d7f3c7c61f0fb9f9ae8a06b93b9f7632e02f1117066e7a1a46c3ef1591e2fb72",
                "md5": "eadfb86888b308f4c62db2ddb11a615c",
                "sha256": "1b058b28d37273013b27080203241e482915ae0b075aba0a17731bf9270c1f93"
            },
            "downloads": -1,
            "filename": "guillotina_nuclia-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eadfb86888b308f4c62db2ddb11a615c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20260,
            "upload_time": "2025-07-29T10:23:02",
            "upload_time_iso_8601": "2025-07-29T10:23:02.397605Z",
            "url": "https://files.pythonhosted.org/packages/d7/f3/c7c61f0fb9f9ae8a06b93b9f7632e02f1117066e7a1a46c3ef1591e2fb72/guillotina_nuclia-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e1692ccce7f0901abe76346d2882841a63d029dbce2efa0acb449af063c4ddd",
                "md5": "67c0e3e7dd82c133e6ab0645968b39c8",
                "sha256": "49ecb9ec68709d6fa53b765d61d84f3c79a6460187a3e670ff8b4024c904d852"
            },
            "downloads": -1,
            "filename": "guillotina_nuclia-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "67c0e3e7dd82c133e6ab0645968b39c8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20055,
            "upload_time": "2025-07-29T10:23:03",
            "upload_time_iso_8601": "2025-07-29T10:23:03.903894Z",
            "url": "https://files.pythonhosted.org/packages/6e/16/92ccce7f0901abe76346d2882841a63d029dbce2efa0acb449af063c4ddd/guillotina_nuclia-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 10:23:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "guillotinaweb",
    "github_project": "guillotina_nuclia",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "guillotina-nuclia"
}
        
Elapsed time: 1.09741s