Skip to content

Commit 8a2e5ba

Browse files
committed
llm context reasoning
1 parent 7bcd7a2 commit 8a2e5ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/inferencesh/models/llm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ def image_to_base64_data_uri(file_path):
248248

249249
def build_messages(
250250
input_data: LLMInput,
251-
transform_user_message: Optional[Callable[[str], str]] = None
251+
transform_user_message: Optional[Callable[[str], str]] = None,
252+
include_reasoning: bool = False
252253
) -> List[Dict[str, Any]]:
253254
"""Build messages for LLaMA.cpp chat completion.
254255
@@ -374,7 +375,7 @@ def merge_tool_calls(messages: List[ContextMessage]) -> List[Dict[str, Any]]:
374375
# If not provided, use empty string to satisfy schema
375376
msg_dict["tool_call_id"] = ""
376377

377-
if msg.reasoning:
378+
if msg.reasoning and include_reasoning:
378379
msg_dict["reasoning"] = msg.reasoning
379380
msg_dict["reasoning_details"] = {
380381
"type": "reasoning.text",

0 commit comments

Comments
 (0)