typerassistant


Nametyperassistant JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/eblume/TyperAssistant
SummaryAutomatically generate an OpenAI Assistant interface for any python typer CLI.
upload_time2023-12-29 21:56:41
maintainer
docs_urlNone
authorErich Blume
requires_python>=3.10,<4.0
licenseMIT
keywords typer openai assistant cli command-line interface ai artificial intelligence
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TyperAssistant
Instantly turn any python Typer CLI in to a function-calling OpenAI assistant.

Example [Typer](https://typer.tiangolo.com/) app:
```python
import getpass
import typer
from typerassistant import register_assistant

app = typer.Typer()
register_assistant(app)

@app.command()
def say_hello(name: str):
    print(f"Hello, {name}!")

@app.command()
def get_current_user():
    print(getpass.getuser())

if __name__ == "__main__":
    app()
```

Example CLI usage:
![python example_1.py ask "Please greet me by my name"](examples/example_1.png)


## Installing

TyperAssistant uses [poetry](https://python-poetry.org/) for a build system, so you can
safely install it like you would any python package.


```bash
$ pip install typerassistant
```

Or, with poetry:

```bash
$ poetry add typerassistant
```

## Usage

**Please be aware that OpenAI's API incurs fees.** See [OpenAI's help article on the
subject](https://help.openai.com/en/articles/8550641-assistants-api#h_061c53c67a) for more information.

A documentation pass is planned before the 1.0 release, but at this time the best way to learn how to use
TyperAssistant's features is to go check out the `examples/` directory. You can also see that the main `typerassistant`
package only exports three members:

* `Assistant`, a basic frontend for OpenAI's Assistant API that handles function calling and threads.
* `TyperAssistant`, an `Assistant` subclass which wraps a Typer application.
* `register_assistant(app: Typer)`, a function which registers an "ask" command and automatically generates an
    appropriate assistant for your application.

**Most use cases require only `register_assistant(app)` to begin working immediately!**

## Contributing

Patches are welcome, as are questions, suggestions, and example usecases! TyperAssistant is still in very early development, and I
am hoping to find some excited collaborators to help build the roadmap to 1.0.

For now, please use the github Issues feature, but I plan to investigate further as needs dictate.

## License

This software is licensed with the MIT license. Please see the file `LICENSE` for more information.

TyperAssistant is copyright Erich Blume, 2023.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eblume/TyperAssistant",
    "name": "typerassistant",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "typer,openai,assistant,cli,command-line,interface,ai,artificial intelligence",
    "author": "Erich Blume",
    "author_email": "blume.erich@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/99/c4/6d4545cf1a173c7ce4051aac1a6da8c8570e2fafe058d57121b46655f191/typerassistant-0.3.1.tar.gz",
    "platform": null,
    "description": "# TyperAssistant\nInstantly turn any python Typer CLI in to a function-calling OpenAI assistant.\n\nExample [Typer](https://typer.tiangolo.com/) app:\n```python\nimport getpass\nimport typer\nfrom typerassistant import register_assistant\n\napp = typer.Typer()\nregister_assistant(app)\n\n@app.command()\ndef say_hello(name: str):\n    print(f\"Hello, {name}!\")\n\n@app.command()\ndef get_current_user():\n    print(getpass.getuser())\n\nif __name__ == \"__main__\":\n    app()\n```\n\nExample CLI usage:\n![python example_1.py ask \"Please greet me by my name\"](examples/example_1.png)\n\n\n## Installing\n\nTyperAssistant uses [poetry](https://python-poetry.org/) for a build system, so you can\nsafely install it like you would any python package.\n\n\n```bash\n$ pip install typerassistant\n```\n\nOr, with poetry:\n\n```bash\n$ poetry add typerassistant\n```\n\n## Usage\n\n**Please be aware that OpenAI's API incurs fees.** See [OpenAI's help article on the\nsubject](https://help.openai.com/en/articles/8550641-assistants-api#h_061c53c67a) for more information.\n\nA documentation pass is planned before the 1.0 release, but at this time the best way to learn how to use\nTyperAssistant's features is to go check out the `examples/` directory. You can also see that the main `typerassistant`\npackage only exports three members:\n\n* `Assistant`, a basic frontend for OpenAI's Assistant API that handles function calling and threads.\n* `TyperAssistant`, an `Assistant` subclass which wraps a Typer application.\n* `register_assistant(app: Typer)`, a function which registers an \"ask\" command and automatically generates an\n    appropriate assistant for your application.\n\n**Most use cases require only `register_assistant(app)` to begin working immediately!**\n\n## Contributing\n\nPatches are welcome, as are questions, suggestions, and example usecases! TyperAssistant is still in very early development, and I\nam hoping to find some excited collaborators to help build the roadmap to 1.0.\n\nFor now, please use the github Issues feature, but I plan to investigate further as needs dictate.\n\n## License\n\nThis software is licensed with the MIT license. Please see the file `LICENSE` for more information.\n\nTyperAssistant is copyright Erich Blume, 2023.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Automatically generate an OpenAI Assistant interface for any python typer CLI.",
    "version": "0.3.1",
    "project_urls": {
        "Homepage": "https://github.com/eblume/TyperAssistant",
        "Repository": "https://github.com/eblume/TyperAssistant"
    },
    "split_keywords": [
        "typer",
        "openai",
        "assistant",
        "cli",
        "command-line",
        "interface",
        "ai",
        "artificial intelligence"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aeb102db69a9af73564f2ba6add7bd550ad20a4c41e3e811b0b93fb416d8fb92",
                "md5": "d1cba195df82956f00e7a2eaf225cca7",
                "sha256": "f4984f7981d28c57b39223b138c994bbb26d3d585dc50db2ba844685e900c759"
            },
            "downloads": -1,
            "filename": "typerassistant-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d1cba195df82956f00e7a2eaf225cca7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 10391,
            "upload_time": "2023-12-29T21:56:39",
            "upload_time_iso_8601": "2023-12-29T21:56:39.344421Z",
            "url": "https://files.pythonhosted.org/packages/ae/b1/02db69a9af73564f2ba6add7bd550ad20a4c41e3e811b0b93fb416d8fb92/typerassistant-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99c46d4545cf1a173c7ce4051aac1a6da8c8570e2fafe058d57121b46655f191",
                "md5": "156f7f9d8b1c48308866ce73a67474c3",
                "sha256": "69634f320db998d4402aea68724a52fddbe8c0a0aeabbda2410abbf86f6ed323"
            },
            "downloads": -1,
            "filename": "typerassistant-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "156f7f9d8b1c48308866ce73a67474c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 9781,
            "upload_time": "2023-12-29T21:56:41",
            "upload_time_iso_8601": "2023-12-29T21:56:41.794990Z",
            "url": "https://files.pythonhosted.org/packages/99/c4/6d4545cf1a173c7ce4051aac1a6da8c8570e2fafe058d57121b46655f191/typerassistant-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-29 21:56:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eblume",
    "github_project": "TyperAssistant",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "typerassistant"
}
        
Elapsed time: 0.73124s