Advanced Session creation with presets. Allows injecting system prompts, multi-turn history messages, and Tools architecture definitions during initialization.
void* LiteRtLm_CreateConversationWithConfig(
void* engine_ptr,
const char* json_preface_str,
int bEnableConstrainedDecoding
);
| Parameter | Responsibility |
|---|---|
json_preface_str |
JSON formatted preset string. Contains "messages" array and "tools" definitions. Must comply with a subset of the OpenAI API format standard.
|
bEnableConstrainedDecoding |
Constrained decoding switch. When set to 1, the engine will automatically enable JSON strong constraints based on tools definitions, ensuring that the AI must output tool calls in the specified format.
|
{
"messages": [
{"role": "system", "content": "You are a helpful companion."},
{"role": "user", "content": "Hello!"}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"parameters": { "type": "object", "properties": {...} }
}
}
]
}