blablado


Nameblablado JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/haesleinhuepf/blablado
SummaryUse LLMs to call functions.
upload_time2024-02-23 12:21:51
maintainer
docs_urlNone
authorRobert Haase
requires_python>=3.9
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # blablado

`blablado` is an extensible Assistant, that listens to your voice and can execute custom Python functions you provided. 
It can speak as well. It is based on [LangChain](https://python.langchain.com/docs/get_started/introduction.html) and [OpenAI's API](https://openai.com/blog/openai-api). You need an openai API account to use it.

## Usage: API

You can use it from Python ([see example notebook](https://github.com/haesleinhuepf/blablado/blob/main/demo/API_demo.ipynb)) by 

* initializing an `Assistant`, 
```python
from blablado import Assistant
assistant = Assistant()
```

* providing functions/tools and

```python
from datetime import datetime

@assistant.register_tool
def book_room(room:str, author:str, start:datetime, end:datetime):
    """Book a room for a specific person from start to end time."""
    
    print(f"""
    Booking {room} for {author} from {start} to {end}.
    """)
```


* prompting for tasks

```python
assistant.do("Hi I'm Robert, please book room A03.21 for me from 3 to 4 pm tomorrow. Thanks")
```

Output:
```
I have successfully booked room A03.21 for Robert from 3 to 4 pm tomorrow.
```

## Usage: Microphone

You can also use it via microphone ([see example notebook](https://github.com/haesleinhuepf/blablado/blob/main/demo/audio_demo.ipynb)). Therfore, it is recommended to print out the list of available microphones like this:

```python
from blablado import list_microphones
list_microphones()
```
Example output:
```
['Microsoft Sound Mapper - Input',
 'Microphone (KLICK&SHOW Audio)',
 'AI Noise-cancelling Input (ASUS',
 'Headset (MAJOR IV Hands-Free AG',
 'Microphone Array (Realtek(R) Au']
```

Then, choose the right microphone after initializing the assistant:

```python
from blablado import Assistant
assistant = Assistant()
assistant.microphone_index = 3
```

You can then call the assistant to listen to your voice and execute the function you want to call:
```python
assistant.listen()
```

## Usage: Voice output

To make the voice output work as well, just activate the voice when initializing the assistant:

```python
from blablado import Assistant
assistant = Assistant(has_voice=True)
```

## Installation

`blablado` is available on pypi and can be installed using `pip`. It is recommended to install it in a virtual environment, e.g. set up with mamba.

```
mamba create --name bla python=3.9
```

```
mamba activate bla
```

```
pip install blablado
```

To make the voice-output work (optional), consider installing [ffmpeg](https://anaconda.org/conda-forge/ffmpeg) using mamba.

```
mamba install ffmpeg
```

## Issues

If you encounter any problems or want to provide feedback or suggestions, please create a thread on [image.sc](https://image.sc) along with a detailed description and tag [@haesleinhuepf].

## Acknowledgements

Parts of the code reused here were originally written by [kevinyamauchi](https://github.com/kevinyamauchi) for the [bia-bob](https://github.com/haesleinhuepf/bia-bob) project.





            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/haesleinhuepf/blablado",
    "name": "blablado",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Robert Haase",
    "author_email": "robert.haase@uni-leipzig.de",
    "download_url": "https://files.pythonhosted.org/packages/4c/a4/572ffbdded1c0372e0e1d046350a49712677f6cfe565060530c2fd894361/blablado-0.1.2.tar.gz",
    "platform": null,
    "description": "# blablado\r\n\r\n`blablado` is an extensible Assistant, that listens to your voice and can execute custom Python functions you provided. \r\nIt can speak as well. It is based on [LangChain](https://python.langchain.com/docs/get_started/introduction.html) and [OpenAI's API](https://openai.com/blog/openai-api). You need an openai API account to use it.\r\n\r\n## Usage: API\r\n\r\nYou can use it from Python ([see example notebook](https://github.com/haesleinhuepf/blablado/blob/main/demo/API_demo.ipynb)) by \r\n\r\n* initializing an `Assistant`, \r\n```python\r\nfrom blablado import Assistant\r\nassistant = Assistant()\r\n```\r\n\r\n* providing functions/tools and\r\n\r\n```python\r\nfrom datetime import datetime\r\n\r\n@assistant.register_tool\r\ndef book_room(room:str, author:str, start:datetime, end:datetime):\r\n    \"\"\"Book a room for a specific person from start to end time.\"\"\"\r\n    \r\n    print(f\"\"\"\r\n    Booking {room} for {author} from {start} to {end}.\r\n    \"\"\")\r\n```\r\n\r\n\r\n* prompting for tasks\r\n\r\n```python\r\nassistant.do(\"Hi I'm Robert, please book room A03.21 for me from 3 to 4 pm tomorrow. Thanks\")\r\n```\r\n\r\nOutput:\r\n```\r\nI have successfully booked room A03.21 for Robert from 3 to 4 pm tomorrow.\r\n```\r\n\r\n## Usage: Microphone\r\n\r\nYou can also use it via microphone ([see example notebook](https://github.com/haesleinhuepf/blablado/blob/main/demo/audio_demo.ipynb)). Therfore, it is recommended to print out the list of available microphones like this:\r\n\r\n```python\r\nfrom blablado import list_microphones\r\nlist_microphones()\r\n```\r\nExample output:\r\n```\r\n['Microsoft Sound Mapper - Input',\r\n 'Microphone (KLICK&SHOW Audio)',\r\n 'AI Noise-cancelling Input (ASUS',\r\n 'Headset (MAJOR IV Hands-Free AG',\r\n 'Microphone Array (Realtek(R) Au']\r\n```\r\n\r\nThen, choose the right microphone after initializing the assistant:\r\n\r\n```python\r\nfrom blablado import Assistant\r\nassistant = Assistant()\r\nassistant.microphone_index = 3\r\n```\r\n\r\nYou can then call the assistant to listen to your voice and execute the function you want to call:\r\n```python\r\nassistant.listen()\r\n```\r\n\r\n## Usage: Voice output\r\n\r\nTo make the voice output work as well, just activate the voice when initializing the assistant:\r\n\r\n```python\r\nfrom blablado import Assistant\r\nassistant = Assistant(has_voice=True)\r\n```\r\n\r\n## Installation\r\n\r\n`blablado` is available on pypi and can be installed using `pip`. It is recommended to install it in a virtual environment, e.g. set up with mamba.\r\n\r\n```\r\nmamba create --name bla python=3.9\r\n```\r\n\r\n```\r\nmamba activate bla\r\n```\r\n\r\n```\r\npip install blablado\r\n```\r\n\r\nTo make the voice-output work (optional), consider installing [ffmpeg](https://anaconda.org/conda-forge/ffmpeg) using mamba.\r\n\r\n```\r\nmamba install ffmpeg\r\n```\r\n\r\n## Issues\r\n\r\nIf you encounter any problems or want to provide feedback or suggestions, please create a thread on [image.sc](https://image.sc) along with a detailed description and tag [@haesleinhuepf].\r\n\r\n## Acknowledgements\r\n\r\nParts of the code reused here were originally written by [kevinyamauchi](https://github.com/kevinyamauchi) for the [bia-bob](https://github.com/haesleinhuepf/bia-bob) project.\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Use LLMs to call functions.",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/haesleinhuepf/blablado/issues",
        "Documentation": "https://github.com/haesleinhuepf/blablado#README.md",
        "Homepage": "https://github.com/haesleinhuepf/blablado",
        "Source Code": "https://github.com/haesleinhuepf/blablado",
        "User Support": "https://github.com/haesleinhuepf/blablado/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfa66399cb5af8ae0de78f55b2d7145c9fa46267629469e6c4412c7006d04ce3",
                "md5": "9f4a2d2561efb323f53509c27bc89fc9",
                "sha256": "ba745fabffd4b293820935a97afb8bf34fb9cc58b5ebb3c621a72890f457ffbc"
            },
            "downloads": -1,
            "filename": "blablado-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f4a2d2561efb323f53509c27bc89fc9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7842,
            "upload_time": "2024-02-23T12:21:49",
            "upload_time_iso_8601": "2024-02-23T12:21:49.915573Z",
            "url": "https://files.pythonhosted.org/packages/cf/a6/6399cb5af8ae0de78f55b2d7145c9fa46267629469e6c4412c7006d04ce3/blablado-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ca4572ffbdded1c0372e0e1d046350a49712677f6cfe565060530c2fd894361",
                "md5": "971077023d2a666aa445d198a3e9d078",
                "sha256": "296f95bf2ee857da94dd2963eb08a5bf90cca900128f05fb06197bb3f26b1beb"
            },
            "downloads": -1,
            "filename": "blablado-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "971077023d2a666aa445d198a3e9d078",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 9419,
            "upload_time": "2024-02-23T12:21:51",
            "upload_time_iso_8601": "2024-02-23T12:21:51.152255Z",
            "url": "https://files.pythonhosted.org/packages/4c/a4/572ffbdded1c0372e0e1d046350a49712677f6cfe565060530c2fd894361/blablado-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-23 12:21:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "haesleinhuepf",
    "github_project": "blablado",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "blablado"
}
        
Elapsed time: 0.50534s