From 09b0d8feae2691d6796a3e565ed4f06c62c74c4b Mon Sep 17 00:00:00 2001 From: Abhishek Jindal Date: Thu, 7 Nov 2024 14:42:09 -0800 Subject: [PATCH] add set runtime option for C API in GenAI (#22748) ### Description Add Set runtime option for C API in GenIA ### Motivation and Context --- docs/genai/api/c.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/genai/api/c.md b/docs/genai/api/c.md index 06da3647ea..c08c1936f1 100644 --- a/docs/genai/api/c.md +++ b/docs/genai/api/c.md @@ -414,6 +414,25 @@ A pointer to the token sequence OGA_EXPORT const int32_t* OGA_API_CALL OgaGenerator_GetSequenceData(const OgaGenerator* generator, size_t index); ``` +### Set Runtime Option + +An API to set Runtime options, more parameters will be added to this generic API to support Runtime options. An example to use this API for terminating the current session would be to call the SetRuntimeOption with key as "terminate_session" and value as "1": OgaGenerator_SetRuntimeOption(generator, "terminate_session", "1") + +More details on the current runtime options can be found [here](https://github.com/microsoft/onnxruntime-genai/blob/main/documents/Runtime_option.md). + +#### Parameters + +* Input: generator The generator on which the Runtime option needs to be set +* Input: key The key for setting the runtime option +* Input: value The value for the key provided + +#### Returns +`void` + +```c +OGA_EXPORT void OGA_API_CALL OgaGenerator_SetRuntimeOption(OgaGenerator* generator, const char* key, const char* value); +``` + ## Enums and structs ```c