code-puppy 0.0.56__tar.gz → 0.0.58__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.
- {code_puppy-0.0.56 → code_puppy-0.0.58}/PKG-INFO +1 -1
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/model_factory.py +12 -4
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/common.py +1 -1
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/file_modifications.py +13 -10
- {code_puppy-0.0.56 → code_puppy-0.0.58}/pyproject.toml +1 -1
- {code_puppy-0.0.56 → code_puppy-0.0.58}/.gitignore +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/LICENSE +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/README.md +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/agent.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/agent_prompts.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/meta_command_handler.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/config.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/main.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/models.json +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/session_memory.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/code_map.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/tools/web_search.py +0 -0
- {code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/version_checker.py +0 -0
|
@@ -181,12 +181,16 @@ class ModelFactory:
|
|
|
181
181
|
if model_type == "gemini":
|
|
182
182
|
provider = GoogleGLAProvider(api_key=os.environ.get("GEMINI_API_KEY", ""))
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
model = GeminiModel(model_name=model_config["name"], provider=provider)
|
|
185
|
+
setattr(model, "provider", provider)
|
|
186
|
+
return model
|
|
185
187
|
|
|
186
188
|
elif model_type == "openai":
|
|
187
189
|
provider = OpenAIProvider(api_key=os.environ.get("OPENAI_API_KEY", ""))
|
|
188
190
|
|
|
189
|
-
|
|
191
|
+
model = OpenAIModel(model_name=model_config["name"], provider=provider)
|
|
192
|
+
setattr(model, "provider", provider)
|
|
193
|
+
return model
|
|
190
194
|
|
|
191
195
|
elif model_type == "anthropic":
|
|
192
196
|
api_key = os.environ.get("ANTHROPIC_API_KEY", None)
|
|
@@ -259,7 +263,9 @@ class ModelFactory:
|
|
|
259
263
|
max_retries=azure_max_retries,
|
|
260
264
|
)
|
|
261
265
|
provider = OpenAIProvider(openai_client=azure_client)
|
|
262
|
-
|
|
266
|
+
model = OpenAIModel(model_name=model_config["name"], provider=provider)
|
|
267
|
+
setattr(model, "provider", provider)
|
|
268
|
+
return model
|
|
263
269
|
|
|
264
270
|
elif model_type == "custom_openai":
|
|
265
271
|
url, headers, ca_certs_path, api_key = get_custom_config(model_config)
|
|
@@ -272,7 +278,9 @@ class ModelFactory:
|
|
|
272
278
|
provider_args["api_key"] = api_key
|
|
273
279
|
provider = OpenAIProvider(**provider_args)
|
|
274
280
|
|
|
275
|
-
|
|
281
|
+
model = OpenAIModel(model_name=model_config["name"], provider=provider)
|
|
282
|
+
setattr(model, "provider", provider)
|
|
283
|
+
return model
|
|
276
284
|
|
|
277
285
|
else:
|
|
278
286
|
raise ValueError(f"Unsupported model type: {model_type}")
|
|
@@ -301,16 +301,19 @@ def register_file_modifications_tools(agent):
|
|
|
301
301
|
"changed": False,
|
|
302
302
|
}
|
|
303
303
|
return write_to_file(context, file_path, content, overwrite)
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
304
|
+
try:
|
|
305
|
+
write_to_file(context, file_path, diff, overwrite=False)
|
|
306
|
+
except Exception as e:
|
|
307
|
+
console.print(
|
|
308
|
+
"[bold red] Unable to route file modification tool call to sub-tool [/bold red]"
|
|
309
|
+
)
|
|
310
|
+
console.print(str(e))
|
|
311
|
+
return {
|
|
312
|
+
"success": False,
|
|
313
|
+
"path": file_path,
|
|
314
|
+
"message": "Wasn't able to route file modification to the right sub-tool!",
|
|
315
|
+
"changed": False,
|
|
316
|
+
}
|
|
314
317
|
|
|
315
318
|
@agent.tool
|
|
316
319
|
def delete_file(context: RunContext, file_path: str) -> Dict[str, Any]:
|
|
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
|
{code_puppy-0.0.56 → code_puppy-0.0.58}/code_puppy/command_line/prompt_toolkit_completion.py
RENAMED
|
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
|