code-puppy 0.0.44__py3-none-any.whl → 0.0.45__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.
- code_puppy/agent.py +4 -2
- code_puppy/command_line/meta_command_handler.py +3 -1
- code_puppy/command_line/model_picker_completion.py +3 -11
- code_puppy/config.py +1 -1
- {code_puppy-0.0.44.dist-info → code_puppy-0.0.45.dist-info}/METADATA +1 -1
- {code_puppy-0.0.44.dist-info → code_puppy-0.0.45.dist-info}/RECORD +10 -10
- {code_puppy-0.0.44.data → code_puppy-0.0.45.data}/data/code_puppy/models.json +0 -0
- {code_puppy-0.0.44.dist-info → code_puppy-0.0.45.dist-info}/WHEEL +0 -0
- {code_puppy-0.0.44.dist-info → code_puppy-0.0.45.dist-info}/entry_points.txt +0 -0
- {code_puppy-0.0.44.dist-info → code_puppy-0.0.45.dist-info}/licenses/LICENSE +0 -0
    
        code_puppy/agent.py
    CHANGED
    
    | @@ -50,7 +50,8 @@ def session_memory(): | |
| 50 50 | 
             
            def reload_code_generation_agent():
         | 
| 51 51 | 
             
                """Force-reload the agent, usually after a model change."""
         | 
| 52 52 | 
             
                global _code_generation_agent, _LAST_MODEL_NAME
         | 
| 53 | 
            -
                 | 
| 53 | 
            +
                from code_puppy.config import get_model_name
         | 
| 54 | 
            +
                model_name = get_model_name()
         | 
| 54 55 | 
             
                console.print(f'[bold cyan]Loading Model: {model_name}[/bold cyan]')
         | 
| 55 56 | 
             
                models_path = Path(MODELS_JSON_PATH) if MODELS_JSON_PATH else Path(__file__).parent / "models.json"
         | 
| 56 57 | 
             
                model = ModelFactory.get_model(model_name, ModelFactory.load_config(models_path))
         | 
| @@ -79,7 +80,8 @@ def get_code_generation_agent(force_reload=False): | |
| 79 80 | 
             
                Forces a reload if the model has changed, or if force_reload is passed.
         | 
| 80 81 | 
             
                """
         | 
| 81 82 | 
             
                global _code_generation_agent, _LAST_MODEL_NAME
         | 
| 82 | 
            -
                 | 
| 83 | 
            +
                from code_puppy.config import get_model_name
         | 
| 84 | 
            +
                model_name = get_model_name()
         | 
| 83 85 | 
             
                if _code_generation_agent is None or _LAST_MODEL_NAME != model_name or force_reload:
         | 
| 84 86 | 
             
                    return reload_code_generation_agent()
         | 
| 85 87 | 
             
                return _code_generation_agent
         | 
| @@ -48,8 +48,10 @@ def handle_meta_command(command: str, console: Console) -> bool: | |
| 48 48 | 
             
                    # Try setting model and show confirmation
         | 
| 49 49 | 
             
                    new_input = update_model_in_input(command)
         | 
| 50 50 | 
             
                    if new_input is not None:
         | 
| 51 | 
            +
                        from code_puppy.agent import get_code_generation_agent
         | 
| 51 52 | 
             
                        model = get_active_model()
         | 
| 52 | 
            -
                         | 
| 53 | 
            +
                        get_code_generation_agent(force_reload=True)
         | 
| 54 | 
            +
                        console.print(f"[bold green]Active model set and loaded:[/bold green] [cyan]{model}[/cyan]")
         | 
| 53 55 | 
             
                        return True
         | 
| 54 56 | 
             
                    # If no model matched, show available models
         | 
| 55 57 | 
             
                    model_names = load_model_names()
         | 
| @@ -19,18 +19,10 @@ def load_model_names(): | |
| 19 19 |  | 
| 20 20 | 
             
            def get_active_model():
         | 
| 21 21 | 
             
                """
         | 
| 22 | 
            -
                Returns the active model  | 
| 23 | 
            -
                 | 
| 24 | 
            -
                2. MODEL_NAME environment variable (for temporary override/testing)
         | 
| 25 | 
            -
                3. None if unset
         | 
| 22 | 
            +
                Returns the active model from the config using get_model_name().
         | 
| 23 | 
            +
                This ensures consistency across the codebase by always using the config value.
         | 
| 26 24 | 
             
                """
         | 
| 27 | 
            -
                 | 
| 28 | 
            -
                if model:
         | 
| 29 | 
            -
                    return model
         | 
| 30 | 
            -
                env_model = os.environ.get('MODEL_NAME')
         | 
| 31 | 
            -
                if env_model:
         | 
| 32 | 
            -
                    return env_model
         | 
| 33 | 
            -
                return None
         | 
| 25 | 
            +
                return get_model_name()
         | 
| 34 26 |  | 
| 35 27 | 
             
            def set_active_model(model_name: str):
         | 
| 36 28 | 
             
                """
         | 
    
        code_puppy/config.py
    CHANGED
    
    | @@ -55,7 +55,7 @@ def get_owner_name(): | |
| 55 55 | 
             
            # --- MODEL STICKY EXTENSION STARTS HERE ---
         | 
| 56 56 | 
             
            def get_model_name():
         | 
| 57 57 | 
             
                """Returns the last used model name stored in config, or None if unset."""
         | 
| 58 | 
            -
                return get_value("model")
         | 
| 58 | 
            +
                return get_value("model") or "gpt-4o"
         | 
| 59 59 |  | 
| 60 60 | 
             
            def set_model_name(model: str):
         | 
| 61 61 | 
             
                """Sets the model name in the persistent config file."""
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            code_puppy/__init__.py,sha256=orgffM-uGp8g1XCqXGKWaFB4tCCz8TVgsLMPKCOGNx0,81
         | 
| 2 | 
            -
            code_puppy/agent.py,sha256= | 
| 2 | 
            +
            code_puppy/agent.py,sha256=avoOEorAYUyQYnYVVCezLz1QKDm0Qgx3i_C-BqgDiQQ,3198
         | 
| 3 3 | 
             
            code_puppy/agent_prompts.py,sha256=O8vzlEPct6qRNhKSRctJRwq3aDOhT_-vyVozS5DtmVA,6554
         | 
| 4 | 
            -
            code_puppy/config.py,sha256= | 
| 4 | 
            +
            code_puppy/config.py,sha256=vBC4JFKNNXUSJ8l4yHF-Vp4lPwMlHNRafb1yxjIpxAE,2202
         | 
| 5 5 | 
             
            code_puppy/main.py,sha256=bc27bk6rFge95H2BumTTzRLtOx43z5FnsmjIjQx_RpU,10052
         | 
| 6 6 | 
             
            code_puppy/model_factory.py,sha256=Pi46jRr7JaBtJfNpSFk-fK2DlBy0Dv6tG2RcXLf4ZVI,11560
         | 
| 7 7 | 
             
            code_puppy/models.json,sha256=7H-y97YK9BXhag5wJU19rtg24JtZWYx60RsBLBW3WiI,2162
         | 
| @@ -9,8 +9,8 @@ code_puppy/session_memory.py,sha256=vuLSw1Pfa-MXD4lD8hj2qt65OR_aL2WdoMuF6Jwnc1k, | |
| 9 9 | 
             
            code_puppy/version_checker.py,sha256=cK-eU7Y_yYjn7feIONqzzZUdiedozL0iiKXlGKjfq68,395
         | 
| 10 10 | 
             
            code_puppy/command_line/__init__.py,sha256=y7WeRemfYppk8KVbCGeAIiTuiOszIURCDjOMZv_YRmU,45
         | 
| 11 11 | 
             
            code_puppy/command_line/file_path_completion.py,sha256=HAlOu9XVYgJ7FbjdrhKBL0rFmCVFxSGGewdcfKTUsPw,2865
         | 
| 12 | 
            -
            code_puppy/command_line/meta_command_handler.py,sha256= | 
| 13 | 
            -
            code_puppy/command_line/model_picker_completion.py,sha256= | 
| 12 | 
            +
            code_puppy/command_line/meta_command_handler.py,sha256=w9aZoMZVhPQj2Vix3nqW_K9Psou6nU_Jb2dFwr37yKs,3453
         | 
| 13 | 
            +
            code_puppy/command_line/model_picker_completion.py,sha256=5VEa6OE9shsF0EafJXzBLpFXhFIkqevJi9RRD-eUvZA,3718
         | 
| 14 14 | 
             
            code_puppy/command_line/prompt_toolkit_completion.py,sha256=pOX3gd2-nn42ReM3_pp3g-NxvslZ9tBSd0S_IeyNelk,5156
         | 
| 15 15 | 
             
            code_puppy/command_line/utils.py,sha256=L1PnV9tNupEW1zeziyb5aGAq8DYP8sMiuQbFYLO5Nus,1236
         | 
| 16 16 | 
             
            code_puppy/tools/__init__.py,sha256=48BVpMt0HAMtz8G_z9SQhX6LnRqR83_AVfMQMf7bY0g,557
         | 
| @@ -20,9 +20,9 @@ code_puppy/tools/common.py,sha256=dbmyZTrTBQh_0WWpaYN6jEync62W2mMrzNS8UFK0co4,14 | |
| 20 20 | 
             
            code_puppy/tools/file_modifications.py,sha256=V8as4Pp_qBJSUFuFl5Y-jpiJKH0tUEQ8dNdkGHzpQM0,11645
         | 
| 21 21 | 
             
            code_puppy/tools/file_operations.py,sha256=9M-JntSSTElsLZ1EMLo9Xu2ifje-N0hjXbwARoBm2Tw,9722
         | 
| 22 22 | 
             
            code_puppy/tools/web_search.py,sha256=HhcwX0MMvMDPFO8gr8gzgesD5wPXOypjkxyLZeNwL5g,589
         | 
| 23 | 
            -
            code_puppy-0.0. | 
| 24 | 
            -
            code_puppy-0.0. | 
| 25 | 
            -
            code_puppy-0.0. | 
| 26 | 
            -
            code_puppy-0.0. | 
| 27 | 
            -
            code_puppy-0.0. | 
| 28 | 
            -
            code_puppy-0.0. | 
| 23 | 
            +
            code_puppy-0.0.45.data/data/code_puppy/models.json,sha256=7H-y97YK9BXhag5wJU19rtg24JtZWYx60RsBLBW3WiI,2162
         | 
| 24 | 
            +
            code_puppy-0.0.45.dist-info/METADATA,sha256=4Z0WVe0KJCQULd1GaPPLptRYEmk7MNGkJP5J_SByFKw,4716
         | 
| 25 | 
            +
            code_puppy-0.0.45.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
         | 
| 26 | 
            +
            code_puppy-0.0.45.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
         | 
| 27 | 
            +
            code_puppy-0.0.45.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
         | 
| 28 | 
            +
            code_puppy-0.0.45.dist-info/RECORD,,
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         |