code-puppy 0.0.38__tar.gz → 0.0.39__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.38 → code_puppy-0.0.39}/PKG-INFO +1 -1
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/model_factory.py +53 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/models.json +10 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/pyproject.toml +1 -1
- {code_puppy-0.0.38 → code_puppy-0.0.39}/.gitignore +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/LICENSE +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/README.md +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/agent.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/agent_prompts.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/command_line/meta_command_handler.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/config.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/main.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/session_memory.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/code_map.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/tools/web_search.py +0 -0
- {code_puppy-0.0.38 → code_puppy-0.0.39}/code_puppy/version_checker.py +0 -0
| @@ -10,6 +10,7 @@ from pydantic_ai.providers.google_gla import GoogleGLAProvider | |
| 10 10 | 
             
            from pydantic_ai.providers.openai import OpenAIProvider
         | 
| 11 11 | 
             
            from pydantic_ai.providers.anthropic import AnthropicProvider
         | 
| 12 12 | 
             
            from anthropic import AsyncAnthropic
         | 
| 13 | 
            +
            from openai import AsyncAzureOpenAI # For Azure OpenAI client
         | 
| 13 14 | 
             
            import httpx
         | 
| 14 15 | 
             
            from httpx import Response
         | 
| 15 16 | 
             
            import threading
         | 
| @@ -205,6 +206,58 @@ class ModelFactory: | |
| 205 206 | 
             
                        provider = AnthropicProvider(anthropic_client=anthropic_client)
         | 
| 206 207 | 
             
                        return AnthropicModel(model_name=model_config["name"], provider=provider)
         | 
| 207 208 |  | 
| 209 | 
            +
                    elif model_type == "azure_openai":
         | 
| 210 | 
            +
                        azure_endpoint_config = model_config.get("azure_endpoint")
         | 
| 211 | 
            +
                        if not azure_endpoint_config:
         | 
| 212 | 
            +
                            raise ValueError(
         | 
| 213 | 
            +
                                "Azure OpenAI model type requires 'azure_endpoint' in its configuration."
         | 
| 214 | 
            +
                            )
         | 
| 215 | 
            +
                        azure_endpoint = azure_endpoint_config
         | 
| 216 | 
            +
                        if azure_endpoint_config.startswith("$"):
         | 
| 217 | 
            +
                            azure_endpoint = os.environ.get(azure_endpoint_config[1:])
         | 
| 218 | 
            +
                        if not azure_endpoint:
         | 
| 219 | 
            +
                            raise ValueError(
         | 
| 220 | 
            +
                                f"Azure OpenAI endpoint environment variable '{azure_endpoint_config[1:] if azure_endpoint_config.startswith('$') else ''}' not found or is empty."
         | 
| 221 | 
            +
                            )
         | 
| 222 | 
            +
             | 
| 223 | 
            +
                        api_version_config = model_config.get("api_version")
         | 
| 224 | 
            +
                        if not api_version_config:
         | 
| 225 | 
            +
                            raise ValueError(
         | 
| 226 | 
            +
                                "Azure OpenAI model type requires 'api_version' in its configuration."
         | 
| 227 | 
            +
                            )
         | 
| 228 | 
            +
                        api_version = api_version_config
         | 
| 229 | 
            +
                        if api_version_config.startswith("$"):
         | 
| 230 | 
            +
                            api_version = os.environ.get(api_version_config[1:])
         | 
| 231 | 
            +
                        if not api_version:
         | 
| 232 | 
            +
                            raise ValueError(
         | 
| 233 | 
            +
                                f"Azure OpenAI API version environment variable '{api_version_config[1:] if api_version_config.startswith('$') else ''}' not found or is empty."
         | 
| 234 | 
            +
                            )
         | 
| 235 | 
            +
                        
         | 
| 236 | 
            +
                        api_key_config = model_config.get("api_key")
         | 
| 237 | 
            +
                        if not api_key_config:
         | 
| 238 | 
            +
                            raise ValueError(
         | 
| 239 | 
            +
                                "Azure OpenAI model type requires 'api_key' in its configuration."
         | 
| 240 | 
            +
                            )
         | 
| 241 | 
            +
                        api_key = api_key_config
         | 
| 242 | 
            +
                        if api_key_config.startswith("$"):
         | 
| 243 | 
            +
                            api_key = os.environ.get(api_key_config[1:])
         | 
| 244 | 
            +
                        if not api_key:
         | 
| 245 | 
            +
                            raise ValueError(
         | 
| 246 | 
            +
                                f"Azure OpenAI API key environment variable '{api_key_config[1:] if api_key_config.startswith('$') else ''}' not found or is empty."
         | 
| 247 | 
            +
                            )
         | 
| 248 | 
            +
             | 
| 249 | 
            +
                        # Configure max_retries for the Azure client, defaulting if not specified in config
         | 
| 250 | 
            +
                        azure_max_retries = model_config.get("max_retries", 2)
         | 
| 251 | 
            +
             | 
| 252 | 
            +
                        azure_client = AsyncAzureOpenAI(
         | 
| 253 | 
            +
                            azure_endpoint=azure_endpoint,
         | 
| 254 | 
            +
                            api_version=api_version,
         | 
| 255 | 
            +
                            api_key=api_key,
         | 
| 256 | 
            +
                            max_retries=azure_max_retries
         | 
| 257 | 
            +
                        )
         | 
| 258 | 
            +
                        provider = OpenAIProvider(openai_client=azure_client)
         | 
| 259 | 
            +
                        return OpenAIModel(model_name=model_config["name"], provider=provider)
         | 
| 260 | 
            +
             | 
| 208 261 | 
             
                    elif model_type == "custom_openai":
         | 
| 209 262 | 
             
                        url, headers, ca_certs_path, api_key = get_custom_config(model_config)
         | 
| 210 263 | 
             
                        client = httpx.AsyncClient(headers=headers, verify=ca_certs_path)
         | 
| @@ -111,5 +111,15 @@ | |
| 111 111 | 
             
                  "url": "https://api.x.ai/v1",
         | 
| 112 112 | 
             
                  "api_key": "$XAI_API_KEY"
         | 
| 113 113 | 
             
                }
         | 
| 114 | 
            +
              },
         | 
| 115 | 
            +
              "azure-gpt-4.1": {
         | 
| 116 | 
            +
                "type": "azure_openai",
         | 
| 117 | 
            +
                "name": "gpt-4.1",
         | 
| 118 | 
            +
                "max_requests_per_minute": 100,
         | 
| 119 | 
            +
                "max_retries": 3,
         | 
| 120 | 
            +
                "retry_base_delay": 5,
         | 
| 121 | 
            +
                "api_version": "2024-12-01-preview",
         | 
| 122 | 
            +
                "api_key": "FNlewRQP0F7iT9NMM2Xc9AnUzD64oRETCY6QBfnFFNI5GTDOe6xCJQQJ99BFACHYHv6XJ3w3AAAAACOG4WLH",
         | 
| 123 | 
            +
                "azure_endpoint": "$AZURE_OPENAI_ENDPOINT"
         | 
| 114 124 | 
             
              }
         | 
| 115 125 | 
             
            }
         | 
| 
            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.38 → code_puppy-0.0.39}/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
         | 
| 
            File without changes
         |