Skip to content

feat: move automatic speech recognition agent to rai_core #357

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

Merged
merged 16 commits into from
Jan 24, 2025
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ repos:
rev: 7.1.0
hooks:
- id: flake8
args: ["--ignore=E501,E731,W503,W504"]
args: ["--ignore=E501,E731,W503,W504,E203"]
75 changes: 66 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ tomli = "^2.0.1"
openwakeword = { git = "https://github.com/maciejmajek/openWakeWord.git", branch = "chore/remove-tflite-backend" }
pytest-timeout = "^2.3.1"
tomli-w = "^1.1.0"
faster-whisper = "^1.1.1"
[tool.poetry.group.dev.dependencies]
ipykernel = "^6.29.4"

Expand Down
2 changes: 2 additions & 0 deletions src/rai/rai/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
from rai.agents.conversational_agent import create_conversational_agent
from rai.agents.state_based import create_state_based_agent
from rai.agents.tool_runner import ToolRunner
from rai.agents.voice_agent import VoiceRecognitionAgent

__all__ = [
"ToolRunner",
"create_conversational_agent",
"create_state_based_agent",
"VoiceRecognitionAgent",
]
32 changes: 32 additions & 0 deletions src/rai/rai/agents/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2024 Robotec.AI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from abc import ABC, abstractmethod
from typing import Optional

from rai.communication import BaseConnector


class BaseAgent(ABC):
def __init__(
self, connectors: Optional[dict[str, BaseConnector]] = None, *args, **kwargs
):
if connectors is None:
connectors = {}
self.connectors: dict[str, BaseConnector] = connectors

@abstractmethod
def run(self, *args, **kwargs):
pass
Loading