Skip to content

[Fix] Align assistant_message structure in camel with OpenAI Chat API specification #3356

@LuoPengcheng12138

Description

@LuoPengcheng12138

It seems that the structure of assistant_message in camel is inconsistent with the OpenAI API documentation (https://platform.openai.com/docs/api-reference/chat/create):

In camel/messages/base.py, the construction code of assistant_message is as follows:

@classmethod
def make_assistant_message(
    cls,
    role_name: str,
    content: str,
    meta_dict: Optional[Dict[str, str]] = None,
    video_bytes: Optional[bytes] = None,
    image_list: Optional[List[Union[Image.Image, str]]] = None,
    image_detail: Union[
        OpenAIVisionDetailType, str
    ] = OpenAIVisionDetailType.AUTO,
    video_detail: Union[
        OpenAIVisionDetailType, str
    ] = OpenAIVisionDetailType.LOW,
) -> "BaseMessage":

While the parameters specified in the API documentation are as follows:

Image

Related to #3346

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