Skip to content

Commit

Permalink
Merge branch 'dm2' into ENG-472-Component-Wrap-up-LLMCommandGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
djcowley committed Oct 13, 2023
2 parents 6b13c0a + ea8e574 commit 4b4a29c
Show file tree
Hide file tree
Showing 60 changed files with 1,063 additions and 236 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rasa/tests
rasa/scripts
data/
examples/
docker-data/*
32 changes: 25 additions & 7 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,15 @@ jobs:
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 0
- name: Install ddtrace
if: needs.changes.outputs.backend == 'true'
run: poetry run pip install -U ddtrace
- name: Install ddtrace on Linux
if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-22.04'
run: poetry run pip install -U 'ddtrace<2.0.0'

- name: Install ddtrace on Windows
if: needs.changes.outputs.backend == 'true' && matrix.os == 'windows-2019'
run: |
.\.venv\Scripts\activate
py -m pip install -U 'ddtrace<2.0.0'
- name: Test Code 🔍 (multi-process)
if: needs.changes.outputs.backend == 'true'
Expand Down Expand Up @@ -492,9 +498,15 @@ jobs:
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 0
- name: Install ddtrace
if: needs.changes.outputs.backend == 'true'
run: poetry run pip install -U ddtrace
- name: Install ddtrace on Linux
if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-22.04'
run: poetry run pip install -U 'ddtrace<2.0.0'

- name: Install ddtrace on Windows
if: needs.changes.outputs.backend == 'true' && matrix.os == 'windows-2019'
run: |
.\.venv\Scripts\activate
py -m pip install -U 'ddtrace<2.0.0'
- name: Test Code 🔍 (multi-process)
if: needs.changes.outputs.backend == 'true'
Expand Down Expand Up @@ -1040,8 +1052,11 @@ jobs:
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt clean
docker image prune -a
docker image prune -a -f
docker volume prune -f
docker container prune -f
df -h
- name: Read Poetry Version 🔢
Expand Down Expand Up @@ -1069,6 +1084,9 @@ jobs:
run: |
docker buildx bake --set *.platform=linux/amd64,linux/arm64 -f docker/docker-bake.hcl ${{ matrix.image }}
- name: Check how much space is left after Docker build
run: df -h

- name: Push image with main tag 📦
if: needs.changes.outputs.docker == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'RasaHQ/rasa'
run: |
Expand Down
1 change: 1 addition & 0 deletions data/test_prompt_templates/test_prompt.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test prompt.
1 change: 1 addition & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-data/*
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude = "((.eggs | .git | .pytest_cache | build | dist))"

[tool.poetry]
name = "rasa"
version = "3.8.0a9"
version = "3.8.0a11"
description = "Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants"
authors = [ "Rasa Technologies GmbH <[email protected]>",]
maintainers = [ "Tom Bocklisch <[email protected]>",]
Expand Down
10 changes: 7 additions & 3 deletions rasa/core/actions/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ def default_actions(action_endpoint: Optional[EndpointConfig] = None) -> List["A
from rasa.dialogue_understanding.patterns.correction import ActionCorrectFlowSlot
from rasa.dialogue_understanding.patterns.cancel import ActionCancelFlow
from rasa.dialogue_understanding.patterns.clarify import ActionClarifyFlows
from rasa.core.actions.action_run_slot_rejections import (
ActionRunSlotRejections,
)
from rasa.core.actions.action_run_slot_rejections import ActionRunSlotRejections
from rasa.core.actions.action_trigger_chitchat import ActionTriggerChitchat
from rasa.core.actions.action_trigger_search import ActionTriggerSearch
from rasa.core.actions.action_clean_stack import ActionCleanStack

return [
ActionListen(),
Expand All @@ -123,6 +124,9 @@ def default_actions(action_endpoint: Optional[EndpointConfig] = None) -> List["A
ActionCorrectFlowSlot(),
ActionClarifyFlows(),
ActionRunSlotRejections(),
ActionCleanStack(),
ActionTriggerSearch(),
ActionTriggerChitchat(),
]


Expand Down
4 changes: 2 additions & 2 deletions rasa/core/actions/action_clean_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Optional, Dict, Any, List

from rasa.core.actions import action
from rasa.core.actions.action import Action
from rasa.core.channels import OutputChannel
from rasa.core.nlg import NaturalLanguageGenerator
from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack
Expand All @@ -18,7 +18,7 @@
from rasa.shared.core.trackers import DialogueStateTracker


class ActionCleanStack(action.Action):
class ActionCleanStack(Action):
"""Action which cancels a flow from the stack."""

def name(self) -> str:
Expand Down
32 changes: 32 additions & 0 deletions rasa/core/actions/action_trigger_chitchat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from typing import Optional, Dict, Any, List

from rasa.core.actions.action import Action
from rasa.core.channels import OutputChannel
from rasa.core.nlg import NaturalLanguageGenerator
from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack
from rasa.dialogue_understanding.stack.frames import ChitChatStackFrame
from rasa.shared.core.constants import ACTION_TRIGGER_CHITCHAT
from rasa.shared.core.domain import Domain
from rasa.shared.core.events import Event
from rasa.shared.core.trackers import DialogueStateTracker


class ActionTriggerChitchat(Action):
"""Action which triggers a chitchat answer."""

def name(self) -> str:
"""Return the name of the action."""
return ACTION_TRIGGER_CHITCHAT

async def run(
self,
output_channel: OutputChannel,
nlg: NaturalLanguageGenerator,
tracker: DialogueStateTracker,
domain: Domain,
metadata: Optional[Dict[str, Any]] = None,
) -> List[Event]:
"""Run the predicate checks."""
dialogue_stack = DialogueStack.from_tracker(tracker)
dialogue_stack.push(ChitChatStackFrame())
return [dialogue_stack.persist_as_event()]
32 changes: 32 additions & 0 deletions rasa/core/actions/action_trigger_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from typing import Optional, Dict, Any, List

from rasa.core.actions.action import Action
from rasa.core.channels import OutputChannel
from rasa.core.nlg import NaturalLanguageGenerator
from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack
from rasa.dialogue_understanding.stack.frames import SearchStackFrame
from rasa.shared.core.constants import ACTION_TRIGGER_SEARCH
from rasa.shared.core.domain import Domain
from rasa.shared.core.events import Event
from rasa.shared.core.trackers import DialogueStateTracker


class ActionTriggerSearch(Action):
"""Action which triggers a search"""

def name(self) -> str:
"""Return the name of the action."""
return ACTION_TRIGGER_SEARCH

async def run(
self,
output_channel: OutputChannel,
nlg: NaturalLanguageGenerator,
tracker: DialogueStateTracker,
domain: Domain,
metadata: Optional[Dict[str, Any]] = None,
) -> List[Event]:
"""Run the predicate checks."""
dialogue_stack = DialogueStack.from_tracker(tracker)
dialogue_stack.push(SearchStackFrame())
return [dialogue_stack.persist_as_event()]
5 changes: 1 addition & 4 deletions rasa/core/actions/flow_trigger_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from rasa.core.channels import OutputChannel
from rasa.shared.constants import FLOW_PREFIX

from rasa.shared.core.constants import (
DIALOGUE_STACK_SLOT,
)
from rasa.shared.core.domain import Domain
from rasa.shared.core.events import (
ActiveLoop,
Expand Down Expand Up @@ -70,7 +67,7 @@ async def run(
]

events: List[Event] = [
SlotSet(DIALOGUE_STACK_SLOT, stack.as_dict())
stack.persist_as_event(),
] + slot_set_events
if tracker.active_loop_name:
events.append(ActiveLoop(None))
Expand Down
Loading

0 comments on commit 4b4a29c

Please sign in to comment.