Skip to content

Issue #3516464 by yautja_cetanu: Enhance AI module to support streaming and...

Issue #3516464 by yautja_cetanu: Enhance AI module to support streaming and tool calls in provider-agnostic way

_ Enhance AI module to support streaming and tool calls in a provider-agnostic way_

This merge request improves the AI module's architecture to better handle streaming responses and tool calls across different AI providers. The changes provide a standardized interface that works consistently with all providers while maintaining backward compatibility.

Changes

  • Added getTools() and supportsTools() methods to StreamedChatMessageIteratorInterface
  • Updated the base StreamedChatMessageIterator class with ChatTools support that gracefully handles providers without tool support
  • Enhanced ChatOutput to properly check for tool support before accessing tools
  • Made defensive improvements to ensure backward compatibility with providers that don't implement tool support

Benefits

  • Consistent interface for all providers
  • Better separation between core functionality and provider-specific implementations
  • More robust error handling for providers without tool support
  • Easier implementation for new AI providers
  • No breaking changes - maintains backward compatibility

These architectural improvements will make it easier to add support for new AI providers and create a more consistent experience when working with tools and streaming responses across different providers.

Closes #3516464

Merge request reports

Loading