Skip to content

[Feature] Generic Streaming Adapters #8885

@RevanthGundala

Description

@RevanthGundala

What feature would you like to see?

Currently, the streaming_listener.py file hardcodes 3 different adapters. If users want to support more streaming adapters, it currently requires hardcoding the adapter in the file and creating the configuration for the adapter in the file.

To make it generic:

  1. Add a streaming protocol/interface to adapters - Define methods like:
    - get_field_start_identifier(field_name) -> str
    - get_field_end_identifier(field_name) -> Pattern
    - get_start_indicator() -> str
    - extract_final_tokens(buffer, field_name) -> str
  2. Move adapter-specific logic into adapter classes - Instead of the StreamListener knowing about each adapter's format,
    each adapter would provide its own streaming configuration
  3. Use the adapter instance directly - Replace the adapter_identifiers dict with calls to the adapter instance:
    start_identifier = settings.adapter.get_field_start_identifier(self.signature_field_name)
    end_identifier = settings.adapter.get_field_end_identifier(self.signature_field_name)

Would you like to contribute?

  • Yes, I'd like to help implement this.
  • No, I just want to request it.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions