codent 0.3.4__tar.gz → 0.3.5__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.
- {codent-0.3.4 → codent-0.3.5}/PKG-INFO +1 -1
- {codent-0.3.4 → codent-0.3.5}/codent.egg-info/PKG-INFO +1 -1
- {codent-0.3.4 → codent-0.3.5}/core/context_utils.py +3 -0
- {codent-0.3.4 → codent-0.3.5}/core/init_cmd.py +67 -1
- {codent-0.3.4 → codent-0.3.5}/pyproject.toml +1 -1
- {codent-0.3.4 → codent-0.3.5}/codent.egg-info/SOURCES.txt +0 -0
- {codent-0.3.4 → codent-0.3.5}/codent.egg-info/dependency_links.txt +0 -0
- {codent-0.3.4 → codent-0.3.5}/codent.egg-info/entry_points.txt +0 -0
- {codent-0.3.4 → codent-0.3.5}/codent.egg-info/requires.txt +0 -0
- {codent-0.3.4 → codent-0.3.5}/codent.egg-info/top_level.txt +0 -0
- {codent-0.3.4 → codent-0.3.5}/cont.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/cont_ui/__init__.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/cont_ui/frontend.html +0 -0
- {codent-0.3.4 → codent-0.3.5}/cont_ui/server.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/cont_watcher.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/__init__.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/adaptive_prompt.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/advanced_overnight.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/anomaly_tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/app.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/auto_eval.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/automations.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/benchmark.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/bridge_server.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/browser.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/browser_agent.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/budget_committee.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/cc_auditor.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/cleaning_tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/cli.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/curriculum_runner.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/daemon.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/data_tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/decomposer.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/domain_tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/endpoint_discovery.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/env_snapshot.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/episodic.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/escalation.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/events.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/feedback_training.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/file_context.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/fitness.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/formatters.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/genesis.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/golden_test_runner.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/guardian.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/hive_recall.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/identity.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/intent_detection.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/intent_gate.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/learning_loop.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/lmstudio.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/local_llm.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/memory_eviction.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/memory_gate.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/memory_store.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/ml_tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/model.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/model_routing.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/network_audit.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/ocr.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/overfit_test.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/overnight_training.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/path_resolution.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/postprocess.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/prefetch.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/prompt_patches.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/prompts.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/provider_router.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/quick_overfit_test.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/recipe_factory.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/recipe_feedback.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/recipe_learner.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/recipes.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/relation_discovery.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/relay.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/repl.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/router.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/rpc.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/run_logger.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/runtime.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/safety.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/scheduler.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/scratchpad.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/self_improve.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/spreading_activation.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/sql_guard.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/sticky_config.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/structured_output.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/system_executor.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/system_map.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/task_classifier.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/task_utils.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/teacher.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/tool_budget.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/tool_helpers.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/tool_schemas.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/trace.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/types.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/utils.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/verification.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/verify_minions.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/vocabulary.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/voice.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/web.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/core/yis_deep_training.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/setup.cfg +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_auto_eval.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_browser.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_browser_agent.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_commands_and_teach.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_cont.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_corpus_parser.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_episodic.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_eviction.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_formatters.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_golden.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_health_report_valid_json.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_integrity_and_memory_gate.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_known_bugs.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_model_agnostic.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_new_tools.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_provider_router.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_recipes.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_teacher.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_verification.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/tests/test_web_fetch.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/vendor/__init__.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/vendor/bin/__init__.py +0 -0
- {codent-0.3.4 → codent-0.3.5}/vendor/bin/ollama +0 -0
- {codent-0.3.4 → codent-0.3.5}/vendor/wheels/__init__.py +0 -0
|
@@ -109,13 +109,79 @@ def _model_exists(ollama_bin: str, model_name: str) -> bool:
|
|
|
109
109
|
return False
|
|
110
110
|
|
|
111
111
|
|
|
112
|
+
_QWEN3_CODER_TEMPLATE = '''{{- if .Messages }}
|
|
113
|
+
{{- if or .System .Tools }}<|im_start|>system
|
|
114
|
+
{{- if .System }}
|
|
115
|
+
{{ .System }}
|
|
116
|
+
{{- end }}
|
|
117
|
+
{{- if .Tools }}
|
|
118
|
+
|
|
119
|
+
# Tools
|
|
120
|
+
|
|
121
|
+
You may call one or more functions to assist with the user query.
|
|
122
|
+
|
|
123
|
+
You are provided with function signatures within <tools></tools> XML tags:
|
|
124
|
+
<tools>
|
|
125
|
+
{{- range .Tools }}
|
|
126
|
+
{"type": "function", "function": {{ .Function }}}
|
|
127
|
+
{{- end }}
|
|
128
|
+
</tools>
|
|
129
|
+
|
|
130
|
+
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
|
|
131
|
+
<tool_call>
|
|
132
|
+
{"name": <function-name>, "arguments": <args-json-object>}
|
|
133
|
+
</tool_call>
|
|
134
|
+
{{- end }}<|im_end|>
|
|
135
|
+
{{ end }}
|
|
136
|
+
{{- range $i, $_ := .Messages }}
|
|
137
|
+
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
|
|
138
|
+
{{- if eq .Role "user" }}<|im_start|>user
|
|
139
|
+
{{ .Content }}<|im_end|>
|
|
140
|
+
{{ else if eq .Role "assistant" }}<|im_start|>assistant
|
|
141
|
+
{{ if .Content }}{{ .Content }}
|
|
142
|
+
{{- else if .ToolCalls }}<tool_call>
|
|
143
|
+
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
|
|
144
|
+
{{ end }}</tool_call>
|
|
145
|
+
{{- end }}{{ if not $last }}<|im_end|>
|
|
146
|
+
{{ end }}
|
|
147
|
+
{{- else if eq .Role "tool" }}<|im_start|>user
|
|
148
|
+
<tool_response>
|
|
149
|
+
{{ .Content }}
|
|
150
|
+
</tool_response><|im_end|>
|
|
151
|
+
{{ end }}
|
|
152
|
+
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
|
|
153
|
+
{{ end }}
|
|
154
|
+
{{- end }}
|
|
155
|
+
{{- else }}
|
|
156
|
+
{{- if .System }}<|im_start|>system
|
|
157
|
+
{{ .System }}<|im_end|>
|
|
158
|
+
{{ end }}{{ if .Prompt }}<|im_start|>user
|
|
159
|
+
{{ .Prompt }}<|im_end|>
|
|
160
|
+
{{ end }}<|im_start|>assistant
|
|
161
|
+
{{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}'''
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def _build_modelfile(gguf_path: Path) -> str:
|
|
165
|
+
"""Qwen3-Coder tool-calling template + parameters."""
|
|
166
|
+
return (
|
|
167
|
+
f"FROM {gguf_path}\n\n"
|
|
168
|
+
f'TEMPLATE """{_QWEN3_CODER_TEMPLATE}"""\n\n'
|
|
169
|
+
'PARAMETER num_ctx 10000\n'
|
|
170
|
+
'PARAMETER temperature 0.1\n'
|
|
171
|
+
'PARAMETER stop "<|im_start|>"\n'
|
|
172
|
+
'PARAMETER stop "<|im_end|>"\n'
|
|
173
|
+
'PARAMETER stop "<|endoftext|>"\n\n'
|
|
174
|
+
'SYSTEM """You are a helpful coding assistant."""\n'
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
112
178
|
def _create_model_from_gguf(ollama_bin: str, gguf_path: Path,
|
|
113
179
|
model_name: str = "cont-local") -> bool:
|
|
114
180
|
"""Generate Modelfile + run `ollama create`."""
|
|
115
181
|
print(f"[*] {model_name} modeli {gguf_path.name} GGUF'undan oluşturuluyor...")
|
|
116
182
|
modelfile = Path.home() / ".cache" / "cont" / "Modelfile.cont"
|
|
117
183
|
modelfile.parent.mkdir(parents=True, exist_ok=True)
|
|
118
|
-
modelfile.write_text(
|
|
184
|
+
modelfile.write_text(_build_modelfile(gguf_path), encoding="utf-8")
|
|
119
185
|
|
|
120
186
|
try:
|
|
121
187
|
subprocess.run(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|