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)

OPM Tool Plugins — MCP and UTCP exposure

Installed ToolBox plugins (OPM entry-point group opm.agents.toolbox) are automatically surfaced over two protocols when the server starts.

Installing the MCP extra

pip install ovos-persona-server[mcp]

Without the [mcp] extra only the UTCP endpoints are active.

UTCP — Universal Tool Calling Protocol

Two endpoints are added at /tools:

Method Path Description
GET /tools/manual Returns a UTCP manual JSON listing all tools
POST /tools/{name} Invoke a tool by name with a JSON body

Fetch the manual:

curl http://localhost:8337/tools/manual

Response shape:

{
  "utcp_version": "1.0",
  "tools": [
    {
      "name": "my_tool",
      "description": "Does something useful.",
      "tool_provider": {
        "type": "http",
        "method": "POST",
        "url": "http://localhost:8337/tools/my_tool",
        "content_type": "application/json"
      },
      "inputs": [
        {"name": "query", "type": "string", "required": true, "description": "Search query"}
      ],
      "output_schema": { ... }
    }
  ]
}

Invoke a tool:

curl -X POST http://localhost:8337/tools/my_tool \
     -H "Content-Type: application/json" \
     -d '{"query": "hello"}'

MCP — Model Context Protocol

When the [mcp] extra is installed, the server mounts an MCP SSE endpoint at /mcp. Each installed ToolBox tool is registered as an MCP tool with the name, description, and JSON Schema derived from its OPM definition.

Claude Desktop / MCP client config:

{
  "mcpServers": {
    "ovos-persona-tools": {
      "url": "http://localhost:8337/mcp/sse"
    }
  }
}

Standalone stdio MCP server (for clients that spawn a subprocess):

ovos-persona-tools-mcp

This runs the same tool set over the stdio MCP transport.

Writing a ToolBox plugin

Implement ToolBox from ovos_plugin_manager.templates.agent_tools and register it under the opm.agents.toolbox entry-point group:

# pyproject.toml
[project.entry-points."opm.agents.toolbox"]
my_toolbox = "my_package.toolbox:MyToolBox"

The server picks it up automatically on the next start.

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.12.0a1.tar.gz (62.1 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.12.0a1-py3-none-any.whl (54.3 kB view details)

Uploaded Python 3

File details

Details for the file ovos_persona_server-0.12.0a1.tar.gz.

File metadata

  • Download URL: ovos_persona_server-0.12.0a1.tar.gz
  • Upload date:
  • Size: 62.1 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.12.0a1.tar.gz
Algorithm Hash digest
SHA256 cc06c3c774abbb6f5237be9ca22bf99f14d663d209d02753b8f4937f79129bde
MD5 ab9f2d8536ab9b46809fdc13c51619be
BLAKE2b-256 d5e02e31a90f36177c79439fb18eff63312f9fd06e40429dbb7464759cb55fbc

See more details on using hashes here.

File details

Details for the file ovos_persona_server-0.12.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_persona_server-0.12.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 480a4a2ada1602262fda2449d7e6afca5a934a173c39be68e88916471af7a715
MD5 f58e6524d6760cb1f3163583dc2092bc
BLAKE2b-256 7ce8481ea3f0b4fd93698322758efd1e276a907e55e47d6c9e03534b735b0b14

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