OpenVoiceOS / OpenVoiceOS/ovos-workshop

missing tests for conversational intents

Open
#191 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

automations and tests good first issue
Dominant language
Python
Stars
6
Forks
17
Avg merge
1d 13h
Merged PRs (30d)
36

Description

tests for #12

from ovos_utils.fakebus import FakeBus, Message
from ovos_workshop.decorators import intent_handler, conversational_intent
from ovos_workshop.skills import OVOSSkill


class DogFactsSkill(OVOSSkill):

    @intent_handler("dog_facts.intent")
    def handle_intent(self, message):
        fact = "Dogs sense of smell is estimated to be 100,000 times more sensitive than humans"
        self.speak(fact)

    @conversational_intent("another_one.intent")
    def handle_followup_question(self, message):
        fact2 = "Dogs have a unique nose print,  making each one distinct and identifiable."
        self.speak(fact2)


if __name__ == "__main__":
    s = DogFactsSkill(skill_id="test", bus=FakeBus())

    r = s.converse_matchers["en-us"].calc_intent("another one")
    print(r)  # {'entities': {}, 'conf': 1, 'name': 'test.converse:another_one.intent'}

    m = Message(f"test.converse.request", {"utterances": ["one more"]})


    def handle_speak(m):
        print(m.data)
        # {'utterance': 'Dogs have a unique nose print,  making each one distinct and identifiable.',
        # 'expect_response': False, 'meta': {'skill': 'test'}, 'lang': 'en-us'}


    s.bus.on("speak", handle_speak)

    s.bus.emit(m)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing test entry points for OVOSSkill, FakeBus, Message, intent_handler, and conversational_intent. Use the DogFactsSkill example to exercise calc_intent and the emitted speak event; done means automated tests cover conversational intent matching and the expected response data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.