simple flask server to host OpenVoiceOS persona plugins as a service
Project description
Persona Server
Running
$ ovos-persona-server --persona rivescript_bot.json
Personas
personas don't need to use LLMs, you don't need a beefy GPU to use ovos-persona, find solver plugins here
some repos and skills also provide solvers, such as ovos-classifiers (wordnet), skill-ddg, skill-wikipedia and skill-wolfie
{
"name": "OldSchoolBot",
"solvers": [
"ovos-solver-wikipedia-plugin",
"ovos-solver-ddg-plugin",
"ovos-solver-plugin-wolfram-alpha",
"ovos-solver-wordnet-plugin",
"ovos-solver-rivescript-plugin",
"ovos-solver-failure-plugin"
],
"ovos-solver-plugin-wolfram-alpha": {"appid": "Y7353-9HQAAL8KKA"}
}
this persona would search ddg api / wikipedia for "what is"/"tell me about" questions, falling back to wordnet when offline for dictionary look up, and finally rivescript for general chitchat, we also add the failure solver to be sure the persona always says something
wolfram alpha illustrates how to pass solver configs, it has a requirement for an API key
search/knowledge base solvers can be used together with LLM solvers to ensure factual answers and act as a tool/internet access layer, in the example above you would typically replace rivescript with a LLM.
Some solvers may also use other solvers internally, such as a MOS (Mixture Of Solvers)
Client side usage
OpenAI compatible API, for usage with OVOS see ovos-solver-plugin-openai-persona
import openai
openai.api_key = ""
openai.api_base = "http://localhost:8337"
# NOTE - most solvers don't support a chat history,
# only last message in messages list is considered
chat_completion = openai.ChatCompletion.create(
model="", # individual personas might support this, passed under context
messages=[{"role": "user", "content": "tell me a joke"}],
stream=False,
)
if isinstance(chat_completion, dict):
# not stream
print(chat_completion.choices[0].message.content)
else:
# stream
for token in chat_completion:
content = token["choices"][0]["delta"].get("content")
if content != None:
print(content, end="", flush=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovos_persona_server-0.4.1a1.tar.gz.
File metadata
- Download URL: ovos_persona_server-0.4.1a1.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdf82486424801929c1aed8f5b47b34bce8f6c8a0b657fc4890ccec38e5fb25b
|
|
| MD5 |
e8ab8cda4304be349a19cdbb115cc9cf
|
|
| BLAKE2b-256 |
cbdd67977c0d7bc1ea893cc5913fee95147123a3cfa156d4e0902c47b06f82da
|
File details
Details for the file ovos_persona_server-0.4.1a1-py3-none-any.whl.
File metadata
- Download URL: ovos_persona_server-0.4.1a1-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
044dc48baf077114bb3bb2bf20c7d346c51cdcd804b4dce05fa7285be477a97b
|
|
| MD5 |
dfb77f003d08a86f6a3df9e58a6ec49a
|
|
| BLAKE2b-256 |
04390bd92c7bcc6e68b8e25782deb2665df1749e58d281307253f765347c2425
|