@@ -60,7 +60,7 @@ struct ToolCall {
6060 *
6161 * @code{.cpp}
6262 * auto parsed = chat_out::parse(raw_output, fmt.format, fmt.reasoning_format,
63- * false, fmt.thinking_forced_open , fmt.parser);
63+ * false, fmt.generation_prompt , fmt.parser);
6464 *
6565 * // Build assistant message with separate fields
6666 * json assistant_msg = {{"role", "assistant"}, {"content", parsed.content}};
@@ -91,7 +91,7 @@ struct ParseResult {
9191 * @param format The chat format (from chat_in::FormatResult.format)
9292 * @param reasoning_format How to handle reasoning/thinking blocks
9393 * @param is_partial True if output is incomplete (streaming)
94- * @param thinking_forced_open Whether thinking tag was forced open
94+ * @param generation_prompt Generation prompt prefill text (e.g. "<think>")
9595 * @param parser_data Serialized PEG parser (from chat_in::FormatResult.parser).
9696 * Required for PEG format models; ignored for others.
9797 *
@@ -109,7 +109,7 @@ struct ParseResult {
109109 * auto fmt = chat_in::format(model, inputs);
110110 * // ... generate tokens ...
111111 * auto parsed = chat_out::parse(output_text, fmt.format, fmt.reasoning_format,
112- * false, fmt.thinking_forced_open , fmt.parser);
112+ * false, fmt.generation_prompt , fmt.parser);
113113 * if (!parsed.tool_calls.empty()) {
114114 * // Handle tool calls
115115 * }
@@ -129,7 +129,7 @@ struct ParseResult {
129129 *
130130 * // Parse: separates reasoning from content
131131 * auto parsed = chat_out::parse(raw_output, fmt.format,
132- * fmt.reasoning_format, false, fmt.thinking_forced_open , fmt.parser);
132+ * fmt.reasoning_format, false, fmt.generation_prompt , fmt.parser);
133133 *
134134 * // Store with separate fields for correct re-formatting on cold restart
135135 * json msg = {{"role", "assistant"}, {"content", parsed.content}};
@@ -144,7 +144,7 @@ inline ParseResult parse(
144144 common_chat_format format,
145145 common_reasoning_format reasoning_format = COMMON_REASONING_FORMAT_NONE,
146146 bool is_partial = false ,
147- bool thinking_forced_open = false ,
147+ const std::string& generation_prompt = " " ,
148148 const std::string& parser_data = " "
149149) {
150150 ParseResult result;
@@ -154,7 +154,7 @@ inline ParseResult parse(
154154 common_chat_parser_params syntax;
155155 syntax.format = format;
156156 syntax.reasoning_format = reasoning_format;
157- syntax.thinking_forced_open = thinking_forced_open ;
157+ syntax.generation_prompt = generation_prompt ;
158158
159159 // Load serialized PEG parser if provided (required for PEG format models)
160160 if (!parser_data.empty ()) {
@@ -222,7 +222,7 @@ inline ParseResult parse(
222222
223223 // Delegate to explicit-format overload
224224 return parse (output, params.format , COMMON_REASONING_FORMAT_NONE, is_partial,
225- params.thinking_forced_open );
225+ params.generation_prompt );
226226
227227 } catch (const std::exception& e) {
228228 LLOYAL_LOG_DEBUG (" [chat_out::parse] Auto-detect failed: %s" , e.what ());
0 commit comments