Skip to content

Enhancement: Provide top-level Message type to simplify SDK usage #158

@ibrahimgb

Description

@ibrahimgb

Enhancement proposal: Export Message type at top-level

Currently, if a user wants to type a chat message for the Mistral API, they either have to import it from a deep path:

import type { Messages }from"@mistralai/mistralai/models/components/chatcompletionrequest";

Or redefine the type manually.

I propose re-exporting it at the package root:

export type { Messages as Message }from"./models/components/chatcompletionrequest.js";

This allows:

import type { Message }from"@mistralai/mistralai";

Benefits:

  • Simpler, cleaner imports for users
  • Reduces risk of inconsistencies if types are manually copied/written

Note: this is not only limited to messages, but it can be expanded if needed to other types.

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