Skip to content

Better method names? #14

@raghubetina

Description

@raghubetina

Since our focus is on beginners, would different method names be better?

  • #add_system, #add_user, #add_assistant instead of #system, #user, #assistant? The latter are concise but can be confused for an assignment rather than pushing new messages into an array (I've made this mistake myself, trying something like c.user = "hi" instead of c.user("hi")).

  • Or, just one: #add_message, or maybe #add to make it easier to type:

    chat.add("Content goes here", role: "system") # role defaults to "user"

    Having just one method to add a message, rather than three role-based ones, would align with the goals written here: Change multiturn image example ai-chat#12

  • Rather than #assistant!, maybe:

    • Not #send because it is reserved. Not #send! because it is too close to the reserved one.
    • #generate
    • #complete
    • #submit
    • #ai
    • #call
    • #post
    • #next
    • #execute
    • A ! version of one of the above?

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