Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/runtime_requirements gui #97

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions ovos_utils/network_utils.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
import socket
import requests
from dataclasses import dataclass


@dataclass
class NetworkRequirements:
# to ensure backwards compatibility the default values require internet before skill loading
# skills in the wild may assume this behaviour and require network on initialization
# any ovos aware skills should change these as appropriate

# xxx_before_load is used by skills service
network_before_load: bool = True
internet_before_load: bool = True

# requires_xxx is currently purely informative and not consumed by core
# this allows a skill to spec if it needs connectivity to handle utterances
requires_internet: bool = True
requires_network: bool = True

# xxx_fallback is currently purely informative and not consumed by core
# this allows a skill to spec if it has a fallback for temporary offline events, eg, by having a cache
no_internet_fallback: bool = False
no_network_fallback: bool = False
# backwards compat
from ovos_utils.process_utils import RuntimeRequirements as NetworkRequirements


def get_ip():
Expand Down
25 changes: 25 additions & 0 deletions ovos_utils/process_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
import sys
from collections import namedtuple
from enum import IntEnum
from dataclasses import dataclass


@dataclass
class RuntimeRequirements:
# to ensure backwards compatibility the default values require internet before skill loading
# skills in the wild may assume this behaviour and require network on initialization
# any ovos aware skills should change these as appropriate

# xxx_before_load is used by skills service
network_before_load: bool = True
internet_before_load: bool = True
gui_before_load: bool = False

# requires_xxx is currently purely informative and not consumed by core
# this allows a skill to spec if it needs connectivity to handle utterances
requires_internet: bool = True
requires_network: bool = True
requires_gui: bool = False

# xxx_fallback is currently purely informative and not consumed by core
# this allows a skill to spec if it has a fallback for temporary offline events, eg, by having a cache
no_internet_fallback: bool = False
no_network_fallback: bool = False
no_gui_fallback: bool = True # can work voice only


class ProcessState(IntEnum):
Expand Down