Skip to content

Commit be9e8eb

Browse files
dexhunterCopilot
andauthored
fix(backend): correct regex for openai model routing (#75)
* fix(backend): correct regex for openai model routing The previous regex was too restrictive and did not correctly route model aliases like 'o3' or 'o3-2025-04-16' to the OpenAI backend. This change updates the regex to correctly handle these cases. * Update aide/backend/__init__.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aide/backend/__init__.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update aide/backend/__init__.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f17ea5b commit be9e8eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aide/backend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def determine_provider(model: str) -> str:
1111
# Check if model matches OpenAI patterns first
12-
if re.match(r"^(gpt-|o\d-|codex-mini-latest$)", model):
12+
if re.match(r"^(gpt-.*|o\d+(-.*)?|codex-mini-latest)$", model):
1313
return "openai"
1414
elif model.startswith("claude-"):
1515
return "anthropic"

0 commit comments

Comments
 (0)