Skip to content

Conversation

@songgot
Copy link
Contributor

@songgot songgot commented Aug 26, 2025

This commit introduces the ML LXM Service API, a new C API designed to facilitate interactions with large-scale models such as Large Language Models (LLMs)

@songgot songgot force-pushed the dev_internal branch 5 times, most recently from 0dd8e4b to 324bf4a Compare August 29, 2025 03:21
@songgot songgot force-pushed the dev_internal branch 3 times, most recently from 86a8dd5 to 9a94a33 Compare September 1, 2025 01:55
This commit introduces the ML LXM Service API, a new C API designed to
facilitate interactions with large-scale models such as Large Language
Models (LLMs)

Signed-off-by: hyunil park <[email protected]>
Copy link

@hj210 hj210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API has a solid foundation and demonstrates clear design goals
and consistent implementation. It is particularly well-aligned with
its specific purpose of interacting with LLMs/LVMs.
With some small refactoring, it could become cleaner and more maintainable code.

* @return ML_ERROR_NONE on success.
* @note The callback parameter is mandatory and will be set during session creation.
*/
int ml_lxm_session_create (const char *config_path, const char *instructions, ml_service_event_cb callback, void *user_data, ml_lxm_session_h * session);
Copy link

@hj210 hj210 Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has a long parameter list. It would be better to reduce the number of parameters by using a structure type if possible.
For example,

typedef struct {
    const char *config_path;
    const char *instructions;
    ml_service_event_cb callback;
    void *user_data;
} ml_lxm_session_config_t;

int ml_lxm_session_create(const ml_lxm_session_config_t *config, 
                         ml_lxm_session_h *session) {
    if (!config || !session || !config->config_path || !config->callback)
        return ML_ERROR_INVALID_PARAMETER;
    
    return ml_lxm_session_create(config->config_path, config->instructions,
                                config->callback, config->user_data, session);
}

(This sample code is suggested by Cline)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants