Skip to content

Commit

Permalink
fix: restore randomize examples setting
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Nov 17, 2024
1 parent 4662384 commit c6e40e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import datetime
import random
from typing import Dict, List, Tuple

from ovos_bus_client import Message
Expand Down Expand Up @@ -214,6 +215,8 @@ def update_examples(self):
for _skill_id, data in dict(self.skill_examples).items():
examples += data.get(self.lang, [])
examples = [e for e in examples if e.strip()] # ensure no empty strings
if self.settings.get("randomize_examples", True):
random.shuffle(examples)
if examples:
self.gui['skill_examples'] = {"examples": examples}
self.gui['skill_info_enabled'] = self.examples_enabled
Expand Down

0 comments on commit c6e40e6

Please sign in to comment.