# <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": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "ovos plugin utterance fallback query",
"author": "jarbasai",
"author_email": "jarbasai@mailfence.com",
"download_url": "https://files.pythonhosted.org/packages/b8/e6/06984c91c4bed94b6e8f87f363a627dc088cf520abc45ac24181d587a96f/ovos-solver-openai-persona-plugin-0.0.2.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.2",
"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": "a70b796fb28a5090169600e5bf3bff6aa63b8a88358e1f92fc37e7bdaa0de0db",
"md5": "99ed992aadcb013d6e008ad4f71e0084",
"sha256": "459df6811a2a8f2f1ad4f45c9bc84f9fc7fc858b82fb181d911d6c67db419dc1"
},
"downloads": -1,
"filename": "ovos_solver_openai_persona_plugin-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "99ed992aadcb013d6e008ad4f71e0084",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 13015,
"upload_time": "2024-09-11T02:25:30",
"upload_time_iso_8601": "2024-09-11T02:25:30.925984Z",
"url": "https://files.pythonhosted.org/packages/a7/0b/796fb28a5090169600e5bf3bff6aa63b8a88358e1f92fc37e7bdaa0de0db/ovos_solver_openai_persona_plugin-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b8e606984c91c4bed94b6e8f87f363a627dc088cf520abc45ac24181d587a96f",
"md5": "e673eeca362784e50956416199830d27",
"sha256": "6813c71beb243d4160b68fdec3b049024f9e341b043d1efe200a13bdf17e1bf1"
},
"downloads": -1,
"filename": "ovos-solver-openai-persona-plugin-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "e673eeca362784e50956416199830d27",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11364,
"upload_time": "2024-09-11T02:25:32",
"upload_time_iso_8601": "2024-09-11T02:25:32.471221Z",
"url": "https://files.pythonhosted.org/packages/b8/e6/06984c91c4bed94b6e8f87f363a627dc088cf520abc45ac24181d587a96f/ovos-solver-openai-persona-plugin-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-11 02:25:32",
"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": [
{
"name": "requests",
"specs": []
},
{
"name": "ovos-plugin-manager",
"specs": [
[
"<",
"1.0.0"
],
[
">=",
"0.0.26"
]
]
}
],
"lcname": "ovos-solver-openai-persona-plugin"
}