Skip to content

Introduce new helper type for acting as a liaison between rtvi message… #1589

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

Closed
wants to merge 1 commit into from

Conversation

mattieruth
Copy link
Contributor

…s and the llm

This somewhat parallels the helper system the RTVI clients have.

Please describe the changes in your PR. If it is addressing an issue, please reference that as well.

The best way to describe this new class is to see how it's implemented in the simple chatbot example, but basically, if you want to handle rtvi messages generated from client llm helpers, the server introduces its own llm helper that handles those messages.

Marking this as a draft pull request because i need to test with a service other than openai, but otherwise, I think it's ready and could use feedback for this approach.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/pipecat/processors/frameworks/rtvi_helpers/llm.py:66

  • [nitpick] The method name 'setupActions' does not follow Python's snake_case naming convention. Consider renaming it to 'setup_actions' for consistency.
def setupActions(self):

Comment on lines 38 to 41
APPEND_TO_MESSAGES = "append_to_messages",
GET_CONTEXT = "get_context",
SET_CONTEXT = "set_context",
RUN = "run",
Copy link
Preview

Copilot AI Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing comma in the enum member assignment causes its value to be a tuple instead of a string, which may lead to unexpected behavior. Consider removing the comma to assign a string value.

Suggested change
APPEND_TO_MESSAGES = "append_to_messages",
GET_CONTEXT = "get_context",
SET_CONTEXT = "set_context",
RUN = "run",
APPEND_TO_MESSAGES = "append_to_messages"
GET_CONTEXT = "get_context"
SET_CONTEXT = "set_context"
RUN = "run"

Copilot uses AI. Check for mistakes.

if run_immediately:
await rtvi.interrupt_bot()

# We just interrupted the bot so it should be find to use the
Copy link
Preview

Copilot AI Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo detected: 'find' should be 'fine'.

Suggested change
# We just interrupted the bot so it should be find to use the
# We just interrupted the bot so it should be fine to use the

Copilot uses AI. Check for mistakes.

RUN = "run",


class RTVIHelper(BaseModel):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if/when we introduce other types of helpers (tts, stt), I can move this to a separate file

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 76 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../pipecat/processors/frameworks/rtvi_helpers/llm.py 0.00% 76 Missing ⚠️
Files with missing lines Coverage Δ
.../pipecat/processors/frameworks/rtvi_helpers/llm.py 0.00% <0.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…s and the llm

This somewhat parallels the helper system the RTVI clients have.
@mattieruth mattieruth force-pushed the mrkb-add-rtvi-llm-helpers branch from 88b9fc4 to 424c2a3 Compare April 15, 2025 16:14
@mattieruth
Copy link
Contributor Author

going a different direction

@mattieruth mattieruth closed this May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant