pdd-cli 0.0.24__py3-none-any.whl → 0.0.25__py3-none-any.whl

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.

Potentially problematic release.


This version of pdd-cli might be problematic. Click here for more details.

Files changed (43) hide show
  1. pdd/__init__.py +7 -1
  2. pdd/bug_main.py +5 -1
  3. pdd/bug_to_unit_test.py +16 -5
  4. pdd/change.py +2 -1
  5. pdd/change_main.py +407 -189
  6. pdd/cli.py +853 -301
  7. pdd/code_generator.py +2 -1
  8. pdd/conflicts_in_prompts.py +2 -1
  9. pdd/construct_paths.py +377 -222
  10. pdd/context_generator.py +2 -1
  11. pdd/continue_generation.py +3 -2
  12. pdd/crash_main.py +55 -20
  13. pdd/detect_change.py +2 -1
  14. pdd/fix_code_loop.py +465 -160
  15. pdd/fix_code_module_errors.py +7 -4
  16. pdd/fix_error_loop.py +9 -9
  17. pdd/fix_errors_from_unit_tests.py +207 -365
  18. pdd/fix_main.py +31 -4
  19. pdd/fix_verification_errors.py +60 -34
  20. pdd/fix_verification_errors_loop.py +842 -768
  21. pdd/fix_verification_main.py +412 -0
  22. pdd/generate_output_paths.py +427 -189
  23. pdd/generate_test.py +3 -2
  24. pdd/increase_tests.py +2 -2
  25. pdd/llm_invoke.py +14 -3
  26. pdd/preprocess.py +3 -3
  27. pdd/process_csv_change.py +466 -154
  28. pdd/prompts/extract_prompt_update_LLM.prompt +11 -5
  29. pdd/prompts/extract_unit_code_fix_LLM.prompt +2 -2
  30. pdd/prompts/fix_code_module_errors_LLM.prompt +29 -0
  31. pdd/prompts/fix_errors_from_unit_tests_LLM.prompt +5 -5
  32. pdd/prompts/generate_test_LLM.prompt +9 -3
  33. pdd/prompts/update_prompt_LLM.prompt +3 -3
  34. pdd/split.py +6 -5
  35. pdd/split_main.py +13 -4
  36. pdd/trace_main.py +7 -0
  37. pdd/xml_tagger.py +2 -1
  38. {pdd_cli-0.0.24.dist-info → pdd_cli-0.0.25.dist-info}/METADATA +4 -4
  39. {pdd_cli-0.0.24.dist-info → pdd_cli-0.0.25.dist-info}/RECORD +43 -42
  40. {pdd_cli-0.0.24.dist-info → pdd_cli-0.0.25.dist-info}/WHEEL +1 -1
  41. {pdd_cli-0.0.24.dist-info → pdd_cli-0.0.25.dist-info}/entry_points.txt +0 -0
  42. {pdd_cli-0.0.24.dist-info → pdd_cli-0.0.25.dist-info}/licenses/LICENSE +0 -0
  43. {pdd_cli-0.0.24.dist-info → pdd_cli-0.0.25.dist-info}/top_level.txt +0 -0
pdd/llm_invoke.py CHANGED
@@ -25,6 +25,7 @@ import json
25
25
 
26
26
  from pydantic import BaseModel, Field
27
27
  from rich import print as rprint
28
+ from rich.errors import MarkupError
28
29
 
29
30
  # Langchain core and community imports
30
31
  from langchain_core.prompts import PromptTemplate, ChatPromptTemplate
@@ -347,12 +348,22 @@ def llm_invoke(prompt, input_json, strength, temperature, verbose=False, output_
347
348
  rprint(f"Strength used: {strength}")
348
349
  rprint(f"Temperature used: {temperature}")
349
350
  try:
350
- rprint(f"Input JSON: {str(input_json)}") # Use str() instead of json.dumps()
351
+ # Try printing with rich formatting first
352
+ rprint(f"Input JSON: {str(input_json)}")
353
+ except MarkupError:
354
+ # Fallback to standard print if rich markup fails
355
+ print(f"Input JSON: {str(input_json)}")
351
356
  except Exception:
352
- rprint(f"Input JSON: {input_json}")
357
+ print(f"Input JSON: {input_json}")
353
358
  if output_pydantic:
354
359
  rprint(f"Output Pydantic format: {output_pydantic}")
355
- rprint(f"Result: {result_output}")
360
+ try:
361
+ # Try printing with rich formatting first
362
+ rprint(f"Result: {result_output}")
363
+ except MarkupError as me:
364
+ # Fallback to standard print if rich markup fails
365
+ print(f"[bold yellow]Warning:[/bold yellow] Failed to render result with rich markup: {me}")
366
+ print(f"Raw Result: {str(result_output)}") # Use standard print
356
367
 
357
368
  return {'result': result_output, 'cost': cost, 'model_name': model.model}
358
369
 
pdd/preprocess.py CHANGED
@@ -133,9 +133,9 @@ def process_web_tags(text: str) -> str:
133
133
  console.print("[bold yellow]Warning:[/bold yellow] FIRECRAWL_API_KEY not found in environment")
134
134
  return f"[Error: FIRECRAWL_API_KEY not set. Cannot scrape {url}]"
135
135
  app = FirecrawlApp(api_key=api_key)
136
- response = app.scrape_url(url=url, params={'formats': ['markdown']})
137
- if 'markdown' in response:
138
- return response['markdown']
136
+ response = app.scrape_url(url, formats=['markdown'])
137
+ if hasattr(response, 'markdown'):
138
+ return response.markdown
139
139
  else:
140
140
  console.print(f"[bold yellow]Warning:[/bold yellow] No markdown content returned for {url}")
141
141
  return f"[No content available for {url}]"