Skip to main content

A question solver plugin for ovos

Project description

OpenAI Persona

Give OpenVoiceOS some sass with OpenAI!

Leverages OpenAI Completions API 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 completions backend, prompt engineering is used to behave like a voice assistant

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

Configuration

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

{
    "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.

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

Built Distribution

File details

Details for the file ovos-solver-openai-persona-plugin-1.1.0a1.tar.gz.

File metadata

File hashes

Hashes for ovos-solver-openai-persona-plugin-1.1.0a1.tar.gz
Algorithm Hash digest
SHA256 361fd9de12dd97fbcea6ee69ff39c5f6463f11fc7cfaf82bfb79c6a9be75ee59
MD5 df620237c8e61f1221a0c748b2a0b0fd
BLAKE2b-256 b6f14024657cabe0eaa338fe6984b2b02e7f511ff8936c6434b17c8c3a84ff40

See more details on using hashes here.

File details

Details for the file ovos_solver_openai_persona_plugin-1.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_solver_openai_persona_plugin-1.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d3edf7db49a8e0c8f6e8dea053a1393ec60115dcace492a1f0151e63af6f2ae
MD5 890cf9bef0019228aea2443ac9c01e72
BLAKE2b-256 f7a9fb880260c4d6355859498196f2d2072aea61039d879b4b9230b168708e5c

See more details on using hashes here.

Supported by

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