-
Notifications
You must be signed in to change notification settings - Fork 27
[API] Add ML LXM Service API(internal) for large model interactons #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0dd8e4b to
324bf4a
Compare
86a8dd5 to
9a94a33
Compare
9a94a33 to
3306bc8
Compare
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]>
3306bc8 to
f0c6e84
Compare
hj210
left a comment
There was a problem hiding this 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); |
There was a problem hiding this comment.
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)
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)