diff --git a/cli/src/infragpt/llm/providers/openai_provider.py b/cli/src/infragpt/llm/providers/openai_provider.py index 9fb92be..da19701 100644 --- a/cli/src/infragpt/llm/providers/openai_provider.py +++ b/cli/src/infragpt/llm/providers/openai_provider.py @@ -36,7 +36,7 @@ def validate_api_key(self) -> bool: } # Newer models like o4-mini use max_completion_tokens - if self.model.startswith("o4") or self.model.startswith("o1"): + if self.model.startswith("o4") or self.model.startswith("o1") or self.model.startswith("gpt-5"): params["max_completion_tokens"] = 10 else: params["max_tokens"] = 10 @@ -113,7 +113,7 @@ def _build_request(self, messages: List[Dict[str, Any]], tools: Optional[List[Di } # Handle temperature - o4 models only support default temperature of 1.0 - if self.model.startswith("o4") or self.model.startswith("o1"): + if self.model.startswith("o4") or self.model.startswith("o1") or self.model.startswith("gpt-5"): # Don't set temperature for o4/o1 models (uses default 1.0) pass else: @@ -121,7 +121,7 @@ def _build_request(self, messages: List[Dict[str, Any]], tools: Optional[List[Di if kwargs.get("max_tokens"): # Use appropriate parameter based on model - if self.model.startswith("o4") or self.model.startswith("o1"): + if self.model.startswith("o4") or self.model.startswith("o1") or self.model.startswith("gpt-5"): request["max_completion_tokens"] = kwargs["max_tokens"] else: request["max_tokens"] = kwargs["max_tokens"] diff --git a/cli/src/infragpt/main.py b/cli/src/infragpt/main.py index 43e649a..b508676 100644 --- a/cli/src/infragpt/main.py +++ b/cli/src/infragpt/main.py @@ -82,11 +82,11 @@ def get_credentials_v2(model_string: Optional[str] = None, api_key: Optional[str anthropic_key = os.getenv("ANTHROPIC_API_KEY") if openai_key and not model_string: - model_string = "openai:gpt-4o" + model_string = "openai:gpt-5" api_key = openai_key provider_name = "openai" elif anthropic_key and not model_string: - model_string = "anthropic:claude-3-5-sonnet-20241022" + model_string = "anthropic:claude-sonnet-4-20250514" api_key = anthropic_key provider_name = "anthropic"