Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_persona_server-0.5.2a2.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_persona_server-0.5.2a2-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file ovos_persona_server-0.5.2a2.tar.gz.

File metadata

  • Download URL: ovos_persona_server-0.5.2a2.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ovos_persona_server-0.5.2a2.tar.gz
Algorithm Hash digest
SHA256 d866a23ea0da8445e9c6675669ede34f3edce74caf0437f9994927c020db6953
MD5 c30e3f956c43c3fda5b87dcb0ac3f584
BLAKE2b-256 1075fa75b0ea17ab385be6cccf49ecb96d92c3b982711ae74718e7666d6ed870

See more details on using hashes here.

File details

Details for the file ovos_persona_server-0.5.2a2-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_persona_server-0.5.2a2-py3-none-any.whl
Algorithm Hash digest
SHA256 e94c28b6331b9a8b25fc06cfbbeb53887d7a05ba848a82b6b4b6284c385f2e0c
MD5 7cb69581e7ae84ccbaecb1802beaef1f
BLAKE2b-256 6bd6594b906c4b9abf459b45c5d9523f959e60040155c4b0b33562e48fa21ff0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page