alpiecode 0.7.1__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {alpiecode-0.7.1 → alpiecode-0.7.2}/PKG-INFO +1 -1
- {alpiecode-0.7.1 → alpiecode-0.7.2}/pyproject.toml +1 -1
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/alpiecode.egg-info/PKG-INFO +1 -1
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/local_model.py +10 -2
- {alpiecode-0.7.1 → alpiecode-0.7.2}/README.md +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/setup.cfg +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/alpiecode.egg-info/SOURCES.txt +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/alpiecode.egg-info/dependency_links.txt +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/alpiecode.egg-info/entry_points.txt +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/alpiecode.egg-info/requires.txt +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/alpiecode.egg-info/top_level.txt +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/__init__.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/agent.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/cli.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/compaction.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/config.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/github.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/guardian.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/media.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/memory.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/tools.py +0 -0
- {alpiecode-0.7.1 → alpiecode-0.7.2}/src/codeagent/updater.py +0 -0
|
@@ -7,6 +7,7 @@ Provides an OpenAI-compatible `create_chat_completion` interface.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import os
|
|
10
|
+
import re
|
|
10
11
|
import sys
|
|
11
12
|
from pathlib import Path
|
|
12
13
|
from typing import Any, Dict, List, Optional
|
|
@@ -395,8 +396,6 @@ class LocalModel:
|
|
|
395
396
|
|
|
396
397
|
enable_thinking = kwargs.get("enable_thinking", True)
|
|
397
398
|
|
|
398
|
-
# When thinking is disabled, inject assistant prefill to skip reasoning tokens
|
|
399
|
-
# This eliminates ~6s of thinking token generation per turn
|
|
400
399
|
if not enable_thinking:
|
|
401
400
|
msgs = list(messages) + [{"role": "assistant", "content": "<think>\n\n</think>\n\n"}]
|
|
402
401
|
else:
|
|
@@ -412,6 +411,15 @@ class LocalModel:
|
|
|
412
411
|
params["tool_choice"] = kwargs.get("tool_choice", "auto")
|
|
413
412
|
|
|
414
413
|
result_dict = llm.create_chat_completion(**params)
|
|
414
|
+
|
|
415
|
+
# Fix prefill response content so chat history remains valid across multi-turn sessions
|
|
416
|
+
if not enable_thinking and result_dict.get("choices"):
|
|
417
|
+
msg_dict = result_dict["choices"][0].get("message", {})
|
|
418
|
+
raw_content = msg_dict.get("content") or ""
|
|
419
|
+
# Strip redundant opening/closing think tags output by model after prefill
|
|
420
|
+
cleaned = re.sub(r"^\s*(?:</think>|<think>)*\s*", "", raw_content)
|
|
421
|
+
msg_dict["content"] = f"<think>\n\n</think>\n\n{cleaned}"
|
|
422
|
+
|
|
415
423
|
return _DictWrapper(result_dict)
|
|
416
424
|
|
|
417
425
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|