Skip to content

Conversation

jpvajda
Copy link
Contributor

@jpvajda jpvajda commented Jun 27, 2025

Proposed changes

  • Adds support for inject user message
  • Adds unit test to test the code
  • Adds a new daily test to test the Agent API
  • updates .gitignore to ignore response_data output

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update or tests (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have lint'ed all of my code using repo standards
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • New Features
    • Added the ability to inject user messages into the agent via the websocket client, enabling direct user-to-agent text interactions.
  • Bug Fixes
    • Updated the ignore list to ensure test artifacts are properly excluded.
  • Tests
    • Introduced unit tests to verify user message injection and serialization functionality.

@jpvajda jpvajda changed the title [WIP] Feat/agent ium [WIP] Adds support for IUM Jun 27, 2025
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

Walkthrough

The changes introduce support for injecting user messages into the Deepgram agent via the websocket client. This includes a new dataclass for user message options, updated imports and exports throughout the client package, a new websocket event type, and new synchronous and asynchronous methods for sending user messages. Unit tests are added for this functionality.

Changes

File(s) Change Summary
.gitignore Corrected test artifact ignore pattern for test.mp3.
deepgram/init.py, deepgram/client.py, deepgram/clients/init.py Added InjectUserMessageOptions to imports/exports at various package levels.
deepgram/clients/agent/init.py, deepgram/clients/agent/v1/init.py Updated import lists to include InjectUserMessageOptions.
deepgram/clients/agent/client.py Added export alias: InjectUserMessageOptions = LatestInjectUserMessageOptions.
deepgram/clients/agent/enums.py Added enum member: InjectUserMessage to AgentWebSocketEvents.
deepgram/clients/agent/v1/websocket/options.py Added new dataclass: InjectUserMessageOptions for user message injection.
deepgram/clients/agent/v1/websocket/client.py Added method: inject_user_message to AgentWebSocketClient.
deepgram/clients/agent/v1/websocket/async_client.py Added async method: inject_user_message to AsyncAgentWebSocketClient.
deepgram/clients/agent/v1/websocket/init.py Added import of InjectUserMessageOptions from .options.
tests/unit_test/test_unit_agent_inject_user_message.py Added unit tests for inject_user_message and serialization of InjectUserMessageOptions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Client as AgentWebSocketClient
    participant Options as InjectUserMessageOptions
    participant WebSocket

    User->>Options: Create InjectUserMessageOptions(content)
    User->>Client: inject_user_message(options)
    Client->>Client: Validate options type
    alt Valid options
        Client->>WebSocket: send(str(options))
        WebSocket-->>Client: Send result (success/failure)
        Client-->>User: Return True/False
    else Invalid options
        Client-->>User: Return False
    end
Loading
sequenceDiagram
    participant User
    participant AsyncClient as AsyncAgentWebSocketClient
    participant Options as InjectUserMessageOptions
    participant WebSocket

    User->>Options: Create InjectUserMessageOptions(content)
    User->>AsyncClient: inject_user_message(options)
    AsyncClient->>AsyncClient: Validate options type
    alt Valid options
        AsyncClient->>WebSocket: send(str(options))
        WebSocket-->>AsyncClient: Send result (success/failure)
        AsyncClient-->>User: Return True/False
    else Invalid options
        AsyncClient-->>User: Return False
    end
Loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Pylint (3.3.7)
tests/unit_test/test_unit_agent_inject_user_message.py
deepgram/clients/agent/v1/websocket/client.py
deepgram/clients/agent/v1/websocket/async_client.py
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in a Comment
  • Commit Unit Tests in branch feat/agent-ium

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jpvajda jpvajda requested review from naomi-lgbt and lukeocodes June 27, 2025 23:21
@jpvajda
Copy link
Contributor Author

jpvajda commented Jun 27, 2025

We'll release this along with Speak Fallback which will come in another PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (7)
.gitignore (1)

31-33: Consider using a trailing slash to clearly mark the ignored directory

To avoid accidentally ignoring a file named tests/response_data (versus the directory), append a / so Git unambiguously treats this as a folder.

- tests/response_data
+ tests/response_data/
deepgram/clients/agent/v1/websocket/__init__.py (1)

26-33: Export list updated – ensure __all__ is kept in sync (if present)

Good catch adding InjectUserMessageOptions.
If this package defines an __all__ elsewhere, remember to include the new symbol there to guarantee it is re-exported by deepgram.clients.agent.v1.websocket.

deepgram/client.py (1)

347-355: Import added – confirm public re-exports stay coherent

InjectUserMessageOptions is now imported at the top level.
Double-check that deepgram.__init__ also exposes it (looks like it does) and that Sphinx/RTD docs pick it up so users find the new option in API docs.

tests/unit_test/test_unit_agent_inject_user_message.py (3)

22-34: Fix boolean comparison style.

Use direct boolean assertion instead of comparison.

-        assert result == True
+        assert result is True

36-43: Fix boolean comparison style.

Use direct boolean assertion instead of comparison.

-        assert result == False
+        assert result is False

45-58: Fix boolean comparison style.

Use direct boolean assertion instead of comparison.

-        assert result == True
+        assert result is True
tests/daily_test/test_daily_agent_websocket.py (1)

156-168: Consider making timeouts configurable.

The hardcoded timeout of 15 seconds (30 * 0.5) might be insufficient in some cases. Consider making this configurable or environment-dependent.

+        # Configurable timeout based on environment or test settings
+        max_response_timeout = int(os.environ.get('AGENT_TEST_TIMEOUT', '30'))
         # Wait for agent response (up to 15 seconds per message)
         response_timeout = 0
         initial_event_count = len(received_events)
 
-        while response_timeout < 30:
+        while response_timeout < max_response_timeout:
             if len(received_events) > initial_event_count:
                 # New events received, check if we got expected responses
                 recent_events = [e["type"] for e in received_events[initial_event_count:]]
                 if "ConversationText" in recent_events or "AgentStartedSpeaking" in recent_events:
                     break
             time.sleep(0.5)
             response_timeout += 1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1200c83 and e72d5bc.

📒 Files selected for processing (14)
  • .gitignore (1 hunks)
  • deepgram/__init__.py (1 hunks)
  • deepgram/client.py (1 hunks)
  • deepgram/clients/__init__.py (1 hunks)
  • deepgram/clients/agent/__init__.py (1 hunks)
  • deepgram/clients/agent/client.py (2 hunks)
  • deepgram/clients/agent/enums.py (1 hunks)
  • deepgram/clients/agent/v1/__init__.py (1 hunks)
  • deepgram/clients/agent/v1/websocket/__init__.py (1 hunks)
  • deepgram/clients/agent/v1/websocket/async_client.py (2 hunks)
  • deepgram/clients/agent/v1/websocket/client.py (2 hunks)
  • deepgram/clients/agent/v1/websocket/options.py (1 hunks)
  • tests/daily_test/test_daily_agent_websocket.py (1 hunks)
  • tests/unit_test/test_unit_agent_inject_user_message.py (1 hunks)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/clients/speak/v1/response.py:48-209
Timestamp: 2024-10-09T02:19:48.728Z
Learning: User dvonthenen prefers to defer certain suggestions, specifically regarding error handling and documentation enhancements in new data classes of `deepgram/clients/speak/v1/response.py`, and may revisit them later.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/clients/speak/v1/response.py:48-209
Timestamp: 2024-06-27T00:06:23.128Z
Learning: User dvonthenen prefers to defer certain suggestions, specifically regarding error handling and documentation enhancements in new data classes of `deepgram/clients/speak/v1/response.py`, and may revisit them later.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: examples/speak-stream/interactive/main.py:24-100
Timestamp: 2024-10-09T02:19:48.728Z
Learning: User dvonthenen prefers to ignore review comments for example files in the Deepgram Python SDK repository.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: examples/speak-stream/interactive/main.py:24-100
Timestamp: 2024-06-27T00:02:52.084Z
Learning: User dvonthenen prefers to ignore review comments for example files in the Deepgram Python SDK repository.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-06-12T18:02:10.651Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-10-09T02:19:48.728Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-07-11T14:10:24.647Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-07-11T14:10:17.231Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
.gitignore (2)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-06-12T18:02:10.651Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-10-09T02:19:48.728Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
deepgram/clients/agent/v1/websocket/__init__.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-07-11T14:10:17.231Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-07-11T14:10:24.647Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
deepgram/client.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:6-6
Timestamp: 2024-07-01T18:18:02.415Z
Learning: Imports for DeepgramClientOptions and ClientOptionsFromEnv in deepgram/clients/listen/__init__.py should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:6-6
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Imports for DeepgramClientOptions and ClientOptionsFromEnv in deepgram/clients/listen/__init__.py should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:54-55
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:37-38
Timestamp: 2024-07-01T19:13:29.909Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:54-55
Timestamp: 2024-07-01T19:13:11.612Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:37-38
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
deepgram/clients/__init__.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-07-01T19:12:57.715Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-07-01T19:13:28.504Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-07-01T19:14:20.539Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
deepgram/clients/agent/__init__.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:54-55
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:37-38
Timestamp: 2024-07-01T19:13:29.909Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:54-55
Timestamp: 2024-07-01T19:13:11.612Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:37-38
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-07-01T19:13:28.504Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
deepgram/clients/agent/client.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-07-01T19:12:57.715Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-07-01T19:13:28.504Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-07-01T19:14:20.539Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
deepgram/__init__.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#445
File: deepgram/__init__.py:163-164
Timestamp: 2024-07-31T20:47:09.717Z
Learning: To make new entities available for external use in the `deepgram/__init__.py` file, add them to the `__all__` list.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#445
File: deepgram/__init__.py:163-164
Timestamp: 2024-10-09T02:19:46.087Z
Learning: To make new entities available for external use in the `deepgram/__init__.py` file, add them to the `__all__` list.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-07-01T19:12:57.715Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:6-6
Timestamp: 2024-07-01T18:18:02.415Z
Learning: Imports for DeepgramClientOptions and ClientOptionsFromEnv in deepgram/clients/listen/__init__.py should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:6-6
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Imports for DeepgramClientOptions and ClientOptionsFromEnv in deepgram/clients/listen/__init__.py should not be flagged as unused in reviews.
deepgram/clients/agent/v1/__init__.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:54-55
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:37-38
Timestamp: 2024-07-01T19:13:29.909Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:37-38
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:54-55
Timestamp: 2024-07-01T19:13:11.612Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility.
tests/unit_test/test_unit_agent_inject_user_message.py (4)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-06-12T18:02:10.651Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-10-09T02:19:48.728Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
deepgram/clients/agent/v1/websocket/client.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-07-11T14:10:24.647Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-07-11T14:10:17.231Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/client.py:81-81
Timestamp: 2024-06-27T00:06:01.811Z
Learning: Imports for SpeakStreamClient and AsyncSpeakStreamClient in `deepgram/client.py` are necessary for export purposes and should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/client.py:81-81
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Imports for SpeakStreamClient and AsyncSpeakStreamClient in `deepgram/client.py` are necessary for export purposes and should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
tests/daily_test/test_daily_agent_websocket.py (3)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#472
File: examples/text-to-speech/websocket/simple/main.py:101-101
Timestamp: 2024-10-18T00:26:33.968Z
Learning: In the `examples/text-to-speech/websocket/simple/main.py` file, it's acceptable for `wait_for_complete()` to lack exception handling, as it is intended to demonstrate functionality in an example context.
deepgram/clients/agent/v1/websocket/async_client.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-07-11T14:10:24.647Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/client.py:81-81
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Imports for SpeakStreamClient and AsyncSpeakStreamClient in `deepgram/client.py` are necessary for export purposes and should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/client.py:81-81
Timestamp: 2024-06-27T00:06:01.811Z
Learning: Imports for SpeakStreamClient and AsyncSpeakStreamClient in `deepgram/client.py` are necessary for export purposes and should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-07-11T14:10:17.231Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#472
File: deepgram/clients/speak/v1/websocket/async_client.py:643-646
Timestamp: 2024-10-18T00:29:32.961Z
Learning: In `deepgram/clients/speak/v1/websocket/async_client.py`, the double call to `self._speaker.finish()` in the `finish` method of the `AsyncSpeakWSClient` class is intentional and required for proper cleanup.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#432
File: deepgram/client.py:65-66
Timestamp: 2024-10-09T02:19:46.086Z
Learning: The `ListenRESTClient` and `AsyncListenRESTClient` imports in `deepgram/client.py` are intentional to support direct invocation, as demonstrated in the `examples/advanced/rest/direct_invocation` example.
deepgram/clients/agent/v1/websocket/options.py (10)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-07-11T14:10:24.647Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-07-11T14:10:17.231Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/v1/websocket/response.py:23-30
Timestamp: 2024-07-01T19:12:00.190Z
Learning: When using the `dataclasses.field` with default values in the `deepgram/clients/speak/v1/websocket/response.py`, avoid using mutable default arguments. Instead, use `field(default_factory=...)`.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/v1/websocket/response.py:23-30
Timestamp: 2024-10-09T02:19:48.728Z
Learning: When using the `dataclasses.field` with default values in the `deepgram/clients/speak/v1/websocket/response.py`, avoid using mutable default arguments. Instead, use `field(default_factory=...)`.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
🧬 Code Graph Analysis (11)
deepgram/clients/agent/v1/websocket/__init__.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/clients/agent/enums.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • AgentKeepAlive (446-451)
deepgram/client.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/clients/__init__.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/clients/agent/__init__.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/clients/agent/client.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/__init__.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/clients/agent/v1/__init__.py (1)
deepgram/clients/agent/v1/websocket/options.py (1)
  • InjectUserMessageOptions (418-425)
deepgram/clients/agent/v1/websocket/client.py (3)
deepgram/clients/agent/v1/websocket/options.py (2)
  • InjectUserMessageOptions (418-425)
  • FunctionCallResponse (432-439)
deepgram/clients/agent/v1/websocket/async_client.py (2)
  • inject_user_message (623-645)
  • send_function_call_response (647-669)
deepgram/utils/verboselogs/__init__.py (2)
  • spam (155-158)
  • notice (150-153)
deepgram/clients/agent/v1/websocket/async_client.py (3)
deepgram/clients/agent/v1/websocket/options.py (2)
  • InjectUserMessageOptions (418-425)
  • FunctionCallResponse (432-439)
deepgram/clients/agent/v1/websocket/client.py (2)
  • inject_user_message (619-641)
  • send_function_call_response (643-665)
deepgram/utils/verboselogs/__init__.py (2)
  • spam (155-158)
  • notice (150-153)
deepgram/clients/agent/v1/websocket/options.py (2)
deepgram/clients/common/v1/shared_response.py (1)
  • BaseResponse (16-44)
deepgram/clients/agent/enums.py (1)
  • AgentWebSocketEvents (10-37)
🪛 Flake8 (7.2.0)
tests/unit_test/test_unit_agent_inject_user_message.py

[error] 1-1: 'pytest' imported but unused

(F401)


[error] 3-3: 'unittest.mock.MagicMock' imported but unused

(F401)


[error] 5-5: 'deepgram.DeepgramClientOptions' imported but unused

(F401)


[error] 12-12: expected 2 blank lines, found 1

(E302)


[error] 33-33: comparison to True should be 'if cond is True:' or 'if cond:'

(E712)


[error] 43-43: comparison to False should be 'if cond is False:' or 'if not cond:'

(E712)


[error] 56-56: comparison to True should be 'if cond is True:' or 'if cond:'

(E712)

tests/daily_test/test_daily_agent_websocket.py

[error] 11-11: 'asyncio' imported but unused

(F401)


[error] 52-52: expected 2 blank lines, found 1

(E302)

🔇 Additional comments (14)
deepgram/clients/agent/enums.py (1)

35-37: Enum updated correctly – verify downstream usage is exhaustive

The new InjectUserMessage value is consistent with the dataclass in options.py.
Please sanity-check switch/if-elif blocks (or mappings) that enumerate AgentWebSocketEvents to make sure the new value is handled everywhere it should be.

deepgram/clients/__init__.py (1)

356-364: Top-level re-export aligned – no issues

The additional re-export keeps top-level parity with deepgram.client. Everything compiles and helps discoverability. 💯

deepgram/__init__.py (1)

339-339: LGTM! Import follows existing pattern.

The addition of InjectUserMessageOptions to the main module imports is consistent with other agent options and properly exposes the new functionality at the top level.

deepgram/clients/agent/client.py (2)

36-36: LGTM! Import follows versioning pattern.

The import of InjectUserMessageOptions as LatestInjectUserMessageOptions is consistent with the established versioning pattern used for other options in this file.


83-83: LGTM! Alias follows versioning pattern.

The alias assignment correctly points to the latest version, maintaining backward compatibility while exposing the new user message injection functionality.

deepgram/clients/agent/__init__.py (1)

37-37: LGTM! Import properly placed.

The addition of InjectUserMessageOptions to the import list follows the existing pattern and is appropriately placed among other agent options.

deepgram/clients/agent/v1/__init__.py (1)

41-41: LGTM! Import correctly placed.

The import of InjectUserMessageOptions from the websocket module is properly positioned and follows the established import pattern.

deepgram/clients/agent/v1/websocket/options.py (1)

414-426: LGTM! Well-designed dataclass implementation.

The InjectUserMessageOptions class is properly implemented with:

  • Correct inheritance from BaseResponse
  • Clear documentation explaining its purpose for text-based agent interaction
  • Appropriate field types with sensible defaults
  • Proper enum reference for the message type

The implementation follows the established pattern of other option classes in this file.

tests/unit_test/test_unit_agent_inject_user_message.py (1)

15-20: LGTM!

Well-structured test for JSON serialization of InjectUserMessageOptions.

deepgram/clients/agent/v1/websocket/client.py (2)

619-641: LGTM!

The inject_user_message method is well-implemented with proper validation, logging, and error handling.


643-665: LGTM!

The send_function_call_response method follows the same well-structured pattern as inject_user_message with proper validation and logging.

deepgram/clients/agent/v1/websocket/async_client.py (2)

623-645: LGTM!

The async inject_user_message method correctly implements the asynchronous version with proper await usage and maintains consistency with the synchronous implementation.


647-669: LGTM!

The async send_function_call_response method properly implements the asynchronous version with correct await usage and maintains consistency with both the synchronous version and the async inject_user_message method.

tests/daily_test/test_daily_agent_websocket.py (1)

53-130: Well-structured test with comprehensive event handling!

The test setup and event handlers provide excellent coverage of the agent websocket functionality, including automatic function call responses.

@jpvajda jpvajda requested a review from lukeocodes July 1, 2025 20:34
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
tests/unit_test/test_unit_agent_inject_user_message.py (2)

1-8: Clean up unused imports.

Remove the unused imports to improve code clarity and comply with linting standards.

-import pytest
 import json
-from unittest.mock import patch, MagicMock
+from unittest.mock import patch

 from deepgram import (
     DeepgramClient,
     InjectUserMessageOptions,
 )

10-10: Add required blank line before class declaration.

Python PEP 8 requires two blank lines before top-level class definitions.

 )

+
 class TestAgentInjectUserMessage:
🧹 Nitpick comments (2)
tests/unit_test/test_unit_agent_inject_user_message.py (2)

20-32: Use proper boolean comparison and improve test assertion.

Avoid explicit comparison to True and consider using more descriptive assertion.

     result = connection.inject_user_message(options)

-    assert result == True
+    assert result is True
     mock_send.assert_called_once_with(str(options))

34-41: Use proper boolean comparison.

Avoid explicit comparison to False for better Python style compliance.

     # Should return False for invalid type
     result = connection.inject_user_message("not an options object")
-    assert result == False
+    assert result is False
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e72d5bc and 2e19798.

📒 Files selected for processing (4)
  • .gitignore (1 hunks)
  • deepgram/clients/agent/v1/websocket/async_client.py (2 hunks)
  • deepgram/clients/agent/v1/websocket/client.py (2 hunks)
  • tests/unit_test/test_unit_agent_inject_user_message.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • .gitignore
  • deepgram/clients/agent/v1/websocket/client.py
  • deepgram/clients/agent/v1/websocket/async_client.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/clients/speak/v1/response.py:48-209
Timestamp: 2024-10-09T02:19:48.728Z
Learning: User dvonthenen prefers to defer certain suggestions, specifically regarding error handling and documentation enhancements in new data classes of `deepgram/clients/speak/v1/response.py`, and may revisit them later.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/clients/speak/v1/response.py:48-209
Timestamp: 2024-06-27T00:06:23.128Z
Learning: User dvonthenen prefers to defer certain suggestions, specifically regarding error handling and documentation enhancements in new data classes of `deepgram/clients/speak/v1/response.py`, and may revisit them later.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: examples/speak-stream/interactive/main.py:24-100
Timestamp: 2024-10-09T02:19:48.728Z
Learning: User dvonthenen prefers to ignore review comments for example files in the Deepgram Python SDK repository.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: examples/speak-stream/interactive/main.py:24-100
Timestamp: 2024-06-27T00:02:52.084Z
Learning: User dvonthenen prefers to ignore review comments for example files in the Deepgram Python SDK repository.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/websocket/__init__.py:8-8
Timestamp: 2024-07-01T19:21:39.778Z
Learning: Unused imports in `deepgram/clients/listen/v1/websocket/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/client.py:81-81
Timestamp: 2024-06-27T00:06:01.811Z
Learning: Imports for SpeakStreamClient and AsyncSpeakStreamClient in `deepgram/client.py` are necessary for export purposes and should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#424
File: deepgram/client.py:81-81
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Imports for SpeakStreamClient and AsyncSpeakStreamClient in `deepgram/client.py` are necessary for export purposes and should not be flagged as unused in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-07-11T14:10:24.647Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/async_client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The unused import `LiveOptions` in `deepgram/clients/listen/v1/websocket/async_client.py` is intentional and will be used in PR #432.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-07-11T14:10:17.231Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#431
File: deepgram/clients/listen/v1/websocket/client.py:30-30
Timestamp: 2024-10-09T02:19:46.087Z
Learning: The `LiveOptions` import in `deepgram/clients/listen/v1/websocket/client.py` is intentionally present for future use and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/rest/options.py:12-12
Timestamp: 2024-07-01T19:12:36.972Z
Learning: Unused imports in `deepgram/clients/listen/v1/rest/options.py` are retained to maintain backwards compatibility.
tests/unit_test/test_unit_agent_inject_user_message.py (12)
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-10-09T02:19:48.728Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#417
File: deepgram/clients/live/v1/client.py:14-14
Timestamp: 2024-06-12T18:02:10.651Z
Learning: Ignore suggestions to change import paths to local versions in test cases and examples as per user preference to use the actual `deepgram-sdk` package for testing.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-07-01T19:12:57.715Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/speak/__init__.py:16-19
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/speak/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-07-01T19:17:04.194Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/v1/__init__.py:36-43
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/v1/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:42-50
Timestamp: 2024-07-01T19:13:28.504Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-07-01T19:14:20.539Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:19-24
Timestamp: 2024-10-09T02:19:46.087Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained to maintain backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:10-13
Timestamp: 2024-10-09T02:19:46.086Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
Learnt from: dvonthenen
PR: deepgram/deepgram-python-sdk#426
File: deepgram/clients/listen/__init__.py:10-13
Timestamp: 2024-07-01T19:14:11.334Z
Learning: Unused imports in `deepgram/clients/listen/__init__.py` are retained for backward compatibility and should not be flagged for removal in reviews.
🪛 Flake8 (7.2.0)
tests/unit_test/test_unit_agent_inject_user_message.py

[error] 1-1: 'pytest' imported but unused

(F401)


[error] 3-3: 'unittest.mock.MagicMock' imported but unused

(F401)


[error] 10-10: expected 2 blank lines, found 1

(E302)


[error] 31-31: comparison to True should be 'if cond is True:' or 'if cond:'

(E712)


[error] 41-41: comparison to False should be 'if cond is False:' or 'if not cond:'

(E712)

🔇 Additional comments (1)
tests/unit_test/test_unit_agent_inject_user_message.py (1)

13-18: Test logic looks good.

The serialization test correctly validates that the InjectUserMessageOptions object converts to the expected JSON structure when stringified.

@jpvajda
Copy link
Contributor Author

jpvajda commented Jul 2, 2025

@lukeocodes all review comments are resolved.

Copy link
Contributor

@lukeocodes lukeocodes left a comment

Choose a reason for hiding this comment

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

why is this so complex wtf

approved!!

@jpvajda jpvajda changed the title [WIP] Adds support for IUM feat: Adds support for IUM Jul 3, 2025
@jpvajda
Copy link
Contributor Author

jpvajda commented Jul 3, 2025

I built a simple test app locally and this looks good. ✅

🎉 Excellent! All tests passed successfully!

The test output shows that your inject_user_message feature is working perfectly:

Test Results Summary:

Message Serialization (6/6 tests passed)

  • Correctly serializes all message types including special characters, empty messages, and Unicode
  • Proper JSON structure with type: "InjectUserMessage" and content field

Inject User Message Method (4/4 tests passed)

  • Method returns True when successful
  • Correctly calls the underlying send() method with properly serialized message
  • Works with various message lengths and content

Invalid Input Handling (5/5 tests passed)

  • Properly rejects invalid input types (strings, integers, None, lists, dicts)
  • Returns False for all invalid inputs
  • Shows proper error logging: "options must be of type InjectUserMessageOptions"

WebSocket Send Failure (1/1 test passed)

  • Correctly handles failure scenarios when websocket send fails
  • Returns False when underlying transport fails
  • Shows proper error logging: "inject_user_message failed"

Future Steps: The inject_user_message feature is confirmed to be working properly beyond your unit tests. You can now confidently use this feature knowing it handles all the edge cases properly.

The test demonstrated excellent error handling, proper serialization, and robust failure scenarios - exactly what you'd want to see in a production feature!

@jpvajda jpvajda merged commit 232ee05 into main Jul 7, 2025
5 checks passed
@jpvajda jpvajda deleted the feat/agent-ium branch July 7, 2025 21:54
@coderabbitai coderabbitai bot mentioned this pull request Jul 15, 2025
8 tasks
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.

2 participants