Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

[C-API] Optional user_data parameter for callbacks #276

Open
Macoron opened this issue May 6, 2023 · 0 comments
Open

[C-API] Optional user_data parameter for callbacks #276

Macoron opened this issue May 6, 2023 · 0 comments

Comments

@Macoron
Copy link

Macoron commented May 6, 2023

Pass an extra argument in callbacks, like llmodel_prompt_callback, llmodel_response_callback, etc. It would be really handy to pass void* parameter to callbacks, that can be filled by user custom data.

For example, because I use static callbacks in C# IL2CPP, I need to track called object somehow. I can use that extra optional parameter in callback to return from static context to object context. Here is example from whisper.cpp implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant