Skip to content

Centralize generate() and analyze() on base TextClient — fix missing audio param in 8/9 providers #143

Description

@Kamilbenkirane

Bug

analyze() is missing the audio parameter in 8 out of 9 text provider implementations. The audio keyword argument gets silently swallowed by **parameters: Unpack[TextParameters] — no error, audio input is just ignored.

Location Has audio?
TextStreamNamespace.analyze() ✅ YES
TextSyncNamespace.analyze() ✅ YES
TextSyncStreamNamespace.analyze() ✅ YES
GoogleTextClient.analyze() ✅ YES
AnthropicTextClient.analyze() NO
OpenAITextClient.analyze() NO
XAITextClient.analyze() NO
GroqTextClient.analyze() NO
MistralTextClient.analyze() NO
CohereTextClient.analyze() NO
MoonshotTextClient.analyze() NO
OllamaTextClient.analyze() NO
OpenResponsesTextClient.analyze() NO
DeepSeekTextClient No analyze() at all

Additional inconsistency: Anthropic's analyze() takes prompt: str (required) while every other provider and namespace uses prompt: str | None = None (optional).

Root Cause

generate() and analyze() are copy-pasted across every provider client instead of being defined once on the base TextClient. Each provider re-declares near-identical method bodies (construct TextInput, call self._predict), leading to parameter drift.

Proposed Fix

Centralize generate() and analyze() on the base TextClient class with the full parameter set (image, video, audio, messages). Delete the 10+ duplicate implementations from provider clients. The provider-specific _initRequest / _parse_content hooks handle all the actual provider differences — the operation methods themselves are identical.

Affected Files

  • src/celeste/modalities/text/client.py — add generate() and analyze() to TextClient
  • src/celeste/modalities/text/providers/*/client.py — remove duplicate generate() and analyze() from all 10 providers

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions