diff --git a/README.md b/README.md index 678a43c..a518b99 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,6 @@ For Gemini models exclusively, you can provide a wildcard at the end of the mode | gemini-2.5-pro-preview-05-06 | | gemini-2.5-flash | | gemini-2.0-pro-exp-02-05 | -| gemini-2.0-flash | | gemini-1.5-pro | | gemini-1.5-flash | @@ -393,7 +392,7 @@ When it comes to preference for selecting options, lgtm follows this preference | Option | Feature Group | Optionality | Notes/Conditions | |----------------------|----------------------|---------------------|---------------------------------------------------------------------------------| -| model | Main (review + guide) | 🟢 Optional | AI model to use. Defaults to `gemini-2.0-flash` if not set. | +| model | Main (review + guide) | 🟢 Optional | AI model to use. Defaults to `gemini-2.5-flash` if not set. | | model_url | Main (review + guide) | 🟡 Conditionally required | Only needed for custom/local models. | | exclude | Main (review + guide) | 🟢 Optional | File patterns to exclude from review. | | publish | Main (review + guide) | 🟢 Optional | If true, posts review as comments. Default: false. | @@ -419,7 +418,7 @@ When it comes to preference for selecting options, lgtm follows this preference These options apply to both reviews and guides generated by lgtm. -- **model**: Choose which AI model you want lgtm to use. If not set, defaults to `gemini-2.0-flash`. +- **model**: Choose which AI model you want lgtm to use. If not set, defaults to `gemini-2.5-flash`. - **model_url**: When not using one of the specific supported models from the providers mentioned above, you can pass a custom URL where the model is deployed (e.g., for local/hosted models). - **exclude**: Instruct lgtm to ignore certain files. This is important to reduce noise in reviews, but also to reduce the amount of tokens used for each review (and to avoid running into token limits). You can specify file patterns (e.g., `exclude = ["*.md", "package-lock.json"]`). - **publish**: If `true`, lgtm will post the review as comments on the PR page. Default is `false`. diff --git a/src/lgtm_ai/ai/schemas.py b/src/lgtm_ai/ai/schemas.py index cbc0505..79e521f 100644 --- a/src/lgtm_ai/ai/schemas.py +++ b/src/lgtm_ai/ai/schemas.py @@ -27,24 +27,11 @@ ] SupportedGeminiModel = Literal[ # pydantic-ai does not keep track of all Gemini models available, so we add the ones we want to support explicitly. - "gemini-1.5-flash", - "gemini-1.5-flash-8b", - "gemini-1.5-pro", - "gemini-1.0-pro", - "gemini-2.0-flash-exp", - "gemini-2.0-flash-thinking-exp-01-21", - "gemini-exp-1206", - "gemini-2.0-flash", - "gemini-2.0-flash-lite-preview-02-05", - "gemini-2.0-pro-exp-02-05", - "gemini-2.5-flash-preview-04-17", "gemini-2.5-pro", - "gemini-2.5-pro-exp-03-25", - "gemini-2.5-pro-preview-03-25", - "gemini-2.5-pro-preview-05-06", "gemini-2.5-flash", - "gemini-2.5-flash-preview-05-20", - "gemini-2.5-pro-preview-06-05", + "gemini-2.5-flash-preview-09-25", + "gemini-2.5-flash-lite", + "gemini-2.5-flash-lite-preview-09-25", ] SupportedAnthopicModel = Literal[ "claude-3-7-sonnet-latest", diff --git a/src/lgtm_ai/config/constants.py b/src/lgtm_ai/config/constants.py index 51688bc..35b6c57 100644 --- a/src/lgtm_ai/config/constants.py +++ b/src/lgtm_ai/config/constants.py @@ -1,5 +1,5 @@ from lgtm_ai.ai.schemas import SupportedAIModels -DEFAULT_AI_MODEL: SupportedAIModels = "gemini-2.0-flash" +DEFAULT_AI_MODEL: SupportedAIModels = "gemini-2.5-flash" DEFAULT_INPUT_TOKEN_LIMIT = 500000 DEFAULT_ISSUE_REGEX = r"(?:refs?|closes?|resolves?)[:\s]*((?:#\d+)|(?:#?[A-Z]+-\d+))|(?:fix|feat|docs|style|refactor|perf|test|build|ci)\((?:#(\d+)|#?([A-Z]+-\d+))\)!?:" diff --git a/tests/ai/test_utils.py b/tests/ai/test_utils.py index 5fd24fe..876bfca 100644 --- a/tests/ai/test_utils.py +++ b/tests/ai/test_utils.py @@ -18,7 +18,7 @@ ("model", "model_url", "ai_api_key", "expected_type", "expectation"), [ ("gpt-4", None, "fake_api_key", OpenAIChatModel, does_not_raise()), - ("gemini-1.5-flash", None, "fake_api_key", GoogleModel, does_not_raise()), + ("gemini-2.5-flash", None, "fake_api_key", GoogleModel, does_not_raise()), ("does-not-exist", None, "fake_api_key", None, pytest.raises(MissingModelUrl)), ("does-not-exist", "http://localhost:1234", "fake_api_key", OpenAIChatModel, does_not_raise()), # We allow custom models with a URL but no API key @@ -41,10 +41,9 @@ def test_get_ai_model(model: str, model_url: str | None, ai_api_key: str, expect ("model", "expected_model_name", "expectation"), [ # Normal matches - ("gemini-2.5-flash-*", "gemini-2.5-flash-preview-05-20", does_not_raise()), - ("gemini-2.5-pro-preview-*", "gemini-2.5-pro-preview-06-05", does_not_raise()), + ("gemini-2.5-flash-preview-*", "gemini-2.5-flash-preview-09-25", does_not_raise()), # Exact match - ("gemini-2.5-pro-preview-06-05", "gemini-2.5-pro-preview-06-05", does_not_raise()), + ("gemini-2.5-flash-preview-09-25", "gemini-2.5-flash-preview-09-25", does_not_raise()), # No wildcard results in no attempt to actually match ("gemini-2.5-pro-preview-", "gemini-2.5-pro-preview-06-05", pytest.raises(MissingModelUrl)), # Multiple matches that we cannot narrow down by date diff --git a/tests/git/fixtures.py b/tests/git/fixtures.py index c083d79..44af22c 100644 --- a/tests/git/fixtures.py +++ b/tests/git/fixtures.py @@ -221,7 +221,7 @@ +++ src/lgtm_ai/config/constants.py @@ -2,4 +2,4 @@ from lgtm_ai.ai.schemas import SupportedAIModels - DEFAULT_AI_MODEL: SupportedAIModels = "gemini-2.0-flash" + DEFAULT_AI_MODEL: SupportedAIModels = "gemini-2.5-flash" DEFAULT_INPUT_TOKEN_LIMIT = 500000 -DEFAULT_ISSUE_REGEX = r"(?:refs?|closes?)[:\s]*((?:#\d+)|(?:#?[A-Z]+-\d+))|(?:fix|feat|docs|style|refactor|perf|test|build|ci)\((?:#(\d+)|#?([A-Z]+-\d+))\)!?:" +DEFAULT_ISSUE_REGEX = r"(?:refs?|closes?|resolves?)[:\s]*((?:#\d+)|(?:#?[A-Z]+-\d+))|(?:fix|feat|docs|style|refactor|perf|test|build|ci)\((?:#(\d+)|#?([A-Z]+-\d+))\)!?:" diff --git a/tests/review/test_guide.py b/tests/review/test_guide.py index a97fc35..68062ae 100644 --- a/tests/review/test_guide.py +++ b/tests/review/test_guide.py @@ -27,7 +27,7 @@ def test_get_guide_from_url_valid() -> None: ): guide_generator = ReviewGuideGenerator( guide_agent=test_agent, - model=mock.Mock(spec=OpenAIChatModel, model_name="gemini-2.0-flash"), + model=mock.Mock(spec=OpenAIChatModel, model_name="gemini-2.5-flash"), git_client=MockGitClient(), config=ResolvedConfig(ai_api_key="", git_api_key=""), ) @@ -49,5 +49,5 @@ def test_get_guide_from_url_valid() -> None: checklist=[GuideChecklistItem(description="a")], references=[GuideReference(title="a", url="a")], ), - metadata=PublishMetadata(model_name="gemini-2.0-flash", usage=guide.metadata.usage), + metadata=PublishMetadata(model_name="gemini-2.5-flash", usage=guide.metadata.usage), )