Skip to content

Reducing coupling between OpenAIChatGenerator and core integrations #9769

@anakin87

Description

@anakin87

Status

Currently, 6 core integrations inherit from the OpenAIChatGenerator, since their APIs are OpenAI-compatible.

This brings some benefits: for example, when we introduced image support in OpenAI, all 6 integrations (+ Azure) automatically gained that feature.

However, this approach also causes problems:

Proposal

To better handle this, I suggest:

  • Introduce a minimal OpenAIBasicChatGenerator, for internal usage only, not documented or promoted
  • This would implement just the generic superset of features we typically need in integrations.
  • (if possible, design it in a modular way, so specific behaviors can easily be overridden when necessary).
  • Place it in core-integrations, making it easier to release it and to test (potentially with integrations depending on it).

In the meantime, a mitigation would be to nightly run also integration tests with Haystack for integrations inheriting from the OpenAIChatGenerator.
This does not solve the problem, but would allow us to catch bugs earlier.


I would be happy to discuss these ideas or explore better alternatives.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions