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

ovos-solver-openai-persona-plugin-1.1.2a1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for ovos-solver-openai-persona-plugin-1.1.2a1.tar.gz
Algorithm Hash digest
SHA256 c345db500e92b7058c50361c540245d2856b757a7e95bcc264cbdfe07cb0320a
MD5 8c11c1ff9b34b15ee0ba931eea0993d5
BLAKE2b-256 d884e3586bb6e2eb6c2ef2564e948f593520b7fe9e3f774a71070e1e6f8fd8ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ovos_solver_openai_persona_plugin-1.1.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d9e4ccd8fa8f5bd77fe7062f695ab22f30798ec0c82af2ac634b14c927d0983
MD5 fae7ebc957f4eab172b2c09507d3e17e
BLAKE2b-256 456051dbd202bf715da0f17baab5f48e65271be5c218fee20a44587502ba64a7

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