From 7e57ca31881ea14185d10e283ea1999db132c97a Mon Sep 17 00:00:00 2001 From: Matthieu Monsch Date: Sun, 14 Sep 2025 11:51:12 -0700 Subject: [PATCH 1/3] refactor: rename OpenAI bot factories --- src/git_draft/bots/openai_api/assistants.py | 2 +- src/git_draft/bots/openai_api/completions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git_draft/bots/openai_api/assistants.py b/src/git_draft/bots/openai_api/assistants.py index 624bef6..24d3ecf 100644 --- a/src/git_draft/bots/openai_api/assistants.py +++ b/src/git_draft/bots/openai_api/assistants.py @@ -20,7 +20,7 @@ _logger = logging.getLogger(__name__) -def threads_bot( +def new_threads_bot( api_key: str | None = None, base_url: str | None = None, model: str = "gpt-4o", diff --git a/src/git_draft/bots/openai_api/completions.py b/src/git_draft/bots/openai_api/completions.py index c5d962d..9863026 100644 --- a/src/git_draft/bots/openai_api/completions.py +++ b/src/git_draft/bots/openai_api/completions.py @@ -11,7 +11,7 @@ from .common import ToolHandler, ToolsFactory, new_client -def completions_bot( +def new_completions_bot( api_key: str | None = None, base_url: str | None = None, model: str = "gpt-4o", From 1b61d199e08bd258fd21ecd026d9c48e2a1bc499 Mon Sep 17 00:00:00 2001 From: Matthieu Monsch Date: Sun, 14 Sep 2025 11:55:22 -0700 Subject: [PATCH 2/3] fixup! 7e57ca3 --- src/git_draft/bots/openai_api/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/git_draft/bots/openai_api/__init__.py b/src/git_draft/bots/openai_api/__init__.py index 6536e09..f14cc97 100644 --- a/src/git_draft/bots/openai_api/__init__.py +++ b/src/git_draft/bots/openai_api/__init__.py @@ -12,11 +12,11 @@ * https://github.com/openai/openai-python/blob/main/src/openai/resources/beta/threads/runs/runs.py """ -from .assistants import threads_bot -from .completions import completions_bot +from .assistants import new_threads_bot +from .completions import new_completions_bot __all__ = [ - "completions_bot", - "threads_bot", + "new_completions_bot", + "new_threads_bot", ] From 005d8af2d30894262645c2306d3ff9f6fe3efd8c Mon Sep 17 00:00:00 2001 From: Matthieu Monsch Date: Sun, 14 Sep 2025 11:57:58 -0700 Subject: [PATCH 3/3] fixup! 1b61d19 --- src/git_draft/bots/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git_draft/bots/__init__.py b/src/git_draft/bots/__init__.py index d341866..8154ea2 100644 --- a/src/git_draft/bots/__init__.py +++ b/src/git_draft/bots/__init__.py @@ -52,7 +52,7 @@ def _default_bot() -> Bot: ) try: - from .openai_api import threads_bot + from .openai_api import new_threads_bot except ImportError: raise RuntimeError( @@ -65,4 +65,4 @@ def _default_bot() -> Bot: ) ) else: - return threads_bot() + return new_threads_bot()