Skip to content

Support OpenAI-compatible ChatMessage type #2180

Description

@andreasjansson

For language models, it'd be good to support an input type that's consistent with the OpenAI API.

I imagine something like this:

from cog import Input
from cog.types import ChatMessage

def run(
    messages: list[ChatMessage] = Input(),
) -> str:
    print(messages)
    return f"HELLO {messages[0]['role']}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpythonPull requests that update Python code

    Type

    No type
    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