Skip to content

Refactor: need clarification for TODO (shared base for Chat and Completion) #342

@greninja

Description

@greninja

I just need a clarification as I am planning to open a PR for this. There’s a TODO in the codebase about unifying “Chats and Completions” (rigging/completion.py L34–35)

The TODO doesn’t say whether that means the Chat and Completion classes (what you get back from .run()) or the ChatPipeline and CompletionPipeline classes (what you call .run() on). Which pair should we unify under a shared base (Chat and Completion, or ChatPipeline and CompletionPipeline)

There’s duplication in both places: the Chat/Completion models share fields like uuid, timestamp, metadata, stop_reason, usage etc. The pipeline classes share generator, params, metadata, and methods like with_(), catch(), and clone().

I’m happy to implement this in a follow-up PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions