ovos-solver-openai-persona-plugin


Nameovos-solver-openai-persona-plugin JSON
Version 0.0.0a8 PyPI version JSON
download
home_pagehttps://github.com/OpenVoiceOS/ovos-solver-plugin-openai-persona
SummaryA question solver plugin for ovos
upload_time2024-02-13 17:30:07
maintainer
docs_urlNone
authorjarbasai
requires_python
licenseMIT
keywords ovos plugin utterance fallback query
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # <img src='https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/robot.svg' card_color='#40DBB0' width='50' height='50' style='vertical-align:bottom'/> OpenAI Persona

Give OpenVoiceOS some sass with OpenAI!

Leverages [OpenAI Completions API](https://platform.openai.com/docs/api-reference/completions/create) to create some fun interactions.  Phrases not explicitly handled by other skills will be run by a LLM, so nearly every interaction will have _some_ response.  But be warned, Mycroft might become a bit obnoxious...


## Usage

Spoken answers api with OpenAI or [LocalAI](https://github.com/go-skynet/LocalAI) completions backend, prompt engineering is used to behave like a voice assistant

```python
from ovos_solver_openai_persona import OpenAIPersonaSolver

bot = OpenAIPersonaSolver({"key": "sk-XXX",
                           "persona": "helpful, creative, clever, and very friendly"})
print(bot.get_spoken_answer("describe quantum mechanics in simple terms"))
# Quantum mechanics is a branch of physics that deals with the behavior of particles on a very small scale, such as atoms and subatomic particles. It explores the idea that particles can exist in multiple states at once and that their behavior is not predictable in the traditional sense.
print(bot.spoken_answer("Quem encontrou o caminho maritimo para o Brazil", {"lang": "pt-pt"}))
# Explorador português Pedro Álvares Cabral é creditado com a descoberta do Brasil em 1500

```

This plugin will work with [ovos-persona-server](https://github.com/OpenVoiceOS/ovos-persona-server)

## Configuration

This plugin can be configured to use a LocalAI server instead of OpenAI.

```json
{
    "api_url": <your_local_LocalAI_server_url>,
    "key": <your_OpenAI_key>,
    "enable_memory": true,
    "memory_size": 15,
    "initial_prompt": "You are a helpful assistant."
}
```

When using LocalAI, the `"key"` can be anything, but it has to exist.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OpenVoiceOS/ovos-solver-plugin-openai-persona",
    "name": "ovos-solver-openai-persona-plugin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ovos plugin utterance fallback query",
    "author": "jarbasai",
    "author_email": "jarbasai@mailfence.com",
    "download_url": "https://files.pythonhosted.org/packages/95/8c/b3cee44347c78d64c7617ce546bd44f532e8b11592ae5917679790bfeb45/ovos-solver-openai-persona-plugin-0.0.0a8.tar.gz",
    "platform": null,
    "description": "# <img src='https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/robot.svg' card_color='#40DBB0' width='50' height='50' style='vertical-align:bottom'/> OpenAI Persona\n\nGive OpenVoiceOS some sass with OpenAI!\n\nLeverages [OpenAI Completions API](https://platform.openai.com/docs/api-reference/completions/create) to create some fun interactions.  Phrases not explicitly handled by other skills will be run by a LLM, so nearly every interaction will have _some_ response.  But be warned, Mycroft might become a bit obnoxious...\n\n\n## Usage\n\nSpoken answers api with OpenAI or [LocalAI](https://github.com/go-skynet/LocalAI) completions backend, prompt engineering is used to behave like a voice assistant\n\n```python\nfrom ovos_solver_openai_persona import OpenAIPersonaSolver\n\nbot = OpenAIPersonaSolver({\"key\": \"sk-XXX\",\n                           \"persona\": \"helpful, creative, clever, and very friendly\"})\nprint(bot.get_spoken_answer(\"describe quantum mechanics in simple terms\"))\n# Quantum mechanics is a branch of physics that deals with the behavior of particles on a very small scale, such as atoms and subatomic particles. It explores the idea that particles can exist in multiple states at once and that their behavior is not predictable in the traditional sense.\nprint(bot.spoken_answer(\"Quem encontrou o caminho maritimo para o Brazil\", {\"lang\": \"pt-pt\"}))\n# Explorador portugu\u00eas Pedro \u00c1lvares Cabral \u00e9 creditado com a descoberta do Brasil em 1500\n\n```\n\nThis plugin will work with [ovos-persona-server](https://github.com/OpenVoiceOS/ovos-persona-server)\n\n## Configuration\n\nThis plugin can be configured to use a LocalAI server instead of OpenAI.\n\n```json\n{\n    \"api_url\": <your_local_LocalAI_server_url>,\n    \"key\": <your_OpenAI_key>,\n    \"enable_memory\": true,\n    \"memory_size\": 15,\n    \"initial_prompt\": \"You are a helpful assistant.\"\n}\n```\n\nWhen using LocalAI, the `\"key\"` can be anything, but it has to exist.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A question solver plugin for ovos",
    "version": "0.0.0a8",
    "project_urls": {
        "Homepage": "https://github.com/OpenVoiceOS/ovos-solver-plugin-openai-persona"
    },
    "split_keywords": [
        "ovos",
        "plugin",
        "utterance",
        "fallback",
        "query"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a840083f8faf5b920e3d2607d8a5f03fbab565347354001e267f2ee1c2fc140",
                "md5": "1b44fcc1e2025d6e4490db08922bca46",
                "sha256": "360824da4e1f4f62aa629a722fbb004ad7d0b6da5d1a4ba8734255e78875a0ff"
            },
            "downloads": -1,
            "filename": "ovos_solver_openai_persona_plugin-0.0.0a8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b44fcc1e2025d6e4490db08922bca46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13051,
            "upload_time": "2024-02-13T17:30:05",
            "upload_time_iso_8601": "2024-02-13T17:30:05.586447Z",
            "url": "https://files.pythonhosted.org/packages/6a/84/0083f8faf5b920e3d2607d8a5f03fbab565347354001e267f2ee1c2fc140/ovos_solver_openai_persona_plugin-0.0.0a8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "958cb3cee44347c78d64c7617ce546bd44f532e8b11592ae5917679790bfeb45",
                "md5": "4117d933d408da22bbfbdd60eb133bcf",
                "sha256": "87be5fd1592bd219a27766913c566a36fd6395b1ac3a4a08c3da8dcc6ec8f6e2"
            },
            "downloads": -1,
            "filename": "ovos-solver-openai-persona-plugin-0.0.0a8.tar.gz",
            "has_sig": false,
            "md5_digest": "4117d933d408da22bbfbdd60eb133bcf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11338,
            "upload_time": "2024-02-13T17:30:07",
            "upload_time_iso_8601": "2024-02-13T17:30:07.701208Z",
            "url": "https://files.pythonhosted.org/packages/95/8c/b3cee44347c78d64c7617ce546bd44f532e8b11592ae5917679790bfeb45/ovos-solver-openai-persona-plugin-0.0.0a8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-13 17:30:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenVoiceOS",
    "github_project": "ovos-solver-plugin-openai-persona",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "ovos-solver-openai-persona-plugin"
}
        
Elapsed time: 0.26827s