Skip to content

change Gemini model #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/examples/cli_research.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main() -> None:
)
parser.add_argument(
"--reasoning-model",
default="gemini-2.5-pro-preview-05-06",
default="gemini-2.5-pro",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This model name is hardcoded. While this is an example script, it's a good practice to define such values as constants to improve readability and maintainability, especially if the value might be used elsewhere or change in the future.

help="Model for the final answer",
)
args = parser.parse_args()
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/InputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const InputForm: React.FC<InputFormProps> = ({
}) => {
const [internalInputValue, setInternalInputValue] = useState("");
const [effort, setEffort] = useState("medium");
const [model, setModel] = useState("gemini-2.5-flash-preview-04-17");
const [model, setModel] = useState("gemini-2.5-flash");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The default model is hardcoded here. This string must exactly match one of the SelectItem values below. Using a constant for the default model that is derived from a centralized list of models would make this more robust and prevent potential bugs caused by typos or inconsistencies.


const handleInternalSubmit = (e?: React.FormEvent) => {
if (e) e.preventDefault();
Expand Down Expand Up @@ -144,15 +144,15 @@ export const InputForm: React.FC<InputFormProps> = ({
</div>
</SelectItem>
<SelectItem
value="gemini-2.5-flash-preview-04-17"
value="gemini-2.5-flash"
className="hover:bg-neutral-600 focus:bg-neutral-600 cursor-pointer"
>
<div className="flex items-center">
<Zap className="h-4 w-4 mr-2 text-orange-400" /> 2.5 Flash
</div>
</SelectItem>
<SelectItem
value="gemini-2.5-pro-preview-05-06"
value="gemini-2.5-pro"
className="hover:bg-neutral-600 focus:bg-neutral-600 cursor-pointer"
>
Comment on lines 146 to 157

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding model names as string literals here and for the default model state on line 29 can lead to inconsistencies and makes maintenance difficult. If a model name changes, it needs to be updated in multiple places, which is error-prone.

Consider defining the available models as a data structure, like an array of objects, and then dynamically generating these SelectItem components by mapping over this array. The default state could also be derived from this single source of truth. This would centralize the model definitions, making them easier to update and ensuring consistency.

<div className="flex items-center">
Expand Down