Skip to content

Move schema type code aliases to the code generator #73

@ncoghlan

Description

@ncoghlan

Several of the types published for type hinting purposes are runtime aliases of their underlying API schema types:

>>> from lmstudio import UserMessage, FileHandle, TextData
>>> UserMessage
<class 'lmstudio._sdk_models.ChatMessageDataUser'>
>>> FileHandle
<class 'lmstudio._sdk_models.ChatMessagePartFileData'>
>>> TextData
<class 'lmstudio._sdk_models.ChatMessagePartTextData'>

This mismatch can be confusing when trying to determine which names to import, since they don't match what is reported when displaying API results.

If these aliases are instead implemented as part of generating the API data types from the exported schema, the reported name at runtime will line up with the name that needs to be imported from the public API for type hinting purposes.

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