Skip to content
Merged
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 .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pip==24.0
pip install -e ".[dev]"


Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
hooks:
- id: pip-compile
name: compile requirements.txt
entry: bash -c 'pip-compile --output-file=requirements.txt pyproject.toml > /dev/null'
entry: bash -c 'pip-compile --no-annotate --no-header --output-file=requirements.txt pyproject.toml > /dev/null'
language: system
pass_filenames: false
files: requirements.txt|pyproject.toml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Or you can check this [example](./.github/workflows/example.yml)
| `ai-provider` | AI provider to use: 'openai', 'gemini', or 'deepseek' | Auto-detected based on provided keys |
| `model` | AI model to use | `gpt-4` for OpenAI, `gemini-2.0-flash` for Gemini, `deepseek-chat` for Deepseek |
| `skip-label` | Label to mark processed issues | `titled` |
| `description-len-min-skip` | Minimum description length required to process an issue. Issues with descriptions shorter than this value will be skipped | `40` |
| `prompt` | Custom prompt for the AI model | [None](#Prompt and Style) |
| `style` | Predefined prompt. To view available prompts, refer to the `styles` folder `https://github.com/horw/issue-title-ai/tree/main/styles` | "summary" |
| `verbose` | When enabled, prints detailed information, including input, response, and token usage | false |
Expand Down
85 changes: 0 additions & 85 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,125 +1,40 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements.txt pyproject.toml
#
annotated-types==0.7.0
# via pydantic
anyio==4.9.0
# via
# httpx
# openai
cachetools==5.5.2
# via google-auth
certifi==2025.1.31
# via
# httpcore
# httpx
# requests
cffi==1.17.1
# via
# cryptography
# pynacl
charset-normalizer==3.4.1
# via requests
cryptography==44.0.2
# via pyjwt
deprecated==1.2.18
# via pygithub
distro==1.9.0
# via openai
google-ai-generativelanguage==0.4.0
# via google-generativeai
google-api-core[grpc]==2.24.2
# via
# google-ai-generativelanguage
# google-generativeai
google-auth==2.39.0
# via
# google-api-core
# google-generativeai
google-generativeai==0.3.1
# via issue-title-ai (pyproject.toml)
googleapis-common-protos==1.70.0
# via
# google-api-core
# grpcio-status
grpcio==1.72.0rc1
# via
# google-api-core
# grpcio-status
grpcio-status==1.63.0rc1
# via google-api-core
h11==0.14.0
# via httpcore
httpcore==1.0.8
# via httpx
httpx==0.28.1
# via openai
idna==3.10
# via
# anyio
# httpx
# requests
jiter==0.9.0
# via openai
openai==1.75.0
# via issue-title-ai (pyproject.toml)
proto-plus==1.26.1
# via
# google-ai-generativelanguage
# google-api-core
protobuf==4.25.6
# via
# google-ai-generativelanguage
# google-api-core
# google-generativeai
# googleapis-common-protos
# grpcio-status
# proto-plus
pyasn1==0.6.1
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.4.2
# via google-auth
pycparser==2.22
# via cffi
pydantic==2.11.3
# via openai
pydantic-core==2.33.1
# via pydantic
pygithub==1.58.2
# via issue-title-ai (pyproject.toml)
pyjwt[crypto]==2.10.1
# via pygithub
pynacl==1.5.0
# via pygithub
requests==2.32.3
# via
# google-api-core
# pygithub
rsa==4.9.1
# via google-auth
sniffio==1.3.1
# via
# anyio
# openai
tqdm==4.67.1
# via
# google-generativeai
# openai
typing-extensions==4.13.2
# via
# anyio
# openai
# pydantic
# pydantic-core
# typing-inspection
typing-inspection==0.4.0
# via pydantic
urllib3==2.4.0
# via requests
wrapt==1.17.2
# via deprecated
6 changes: 4 additions & 2 deletions src/core/issue_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ def __init__(self, ai_client, github_client, prompt, skip_label, required_labels
self.skip_label = skip_label
self.required_labels = required_labels

def process_issue(self, issue, auto_update=False, strip_characters="", quiet=False):
def process_issue(
self, issue, auto_update=False, strip_characters="", quiet=False, description_min_skip=40
):
issue_number = issue.number
original_title = issue.title
issue_body = issue.body or ""

if len(issue_body) < 40:
if len(issue_body) < description_min_skip:
print(f"Issue body too short, skipping: {issue_number}, length: {len(issue_body)}")
return {
"issue_number": issue_number,
Expand Down
2 changes: 2 additions & 0 deletions src/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def __init__(self):
self.prompt = self._retrieve_prompt()
self.skip_label = os.environ.get("INPUT_SKIP-LABEL", "titled")

self.description_min_skip = int(os.getenv("INPUT_DESCRIPTION_LEN_MIN_SKIP", 40))

# Check if this is an issue event trigger
self.event_name = os.environ.get("GITHUB_EVENT_NAME")
self.event_path = os.environ.get("GITHUB_EVENT_PATH")
Expand Down
2 changes: 2 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def open_issue_event(config, repo_obj, ai_client, github_client):
auto_update=config.auto_update,
strip_characters=config.strip_characters,
quiet=config.quiet,
description_min_skip=config.description_min_skip,
)
return [result]
except Exception as e:
Expand Down Expand Up @@ -65,6 +66,7 @@ def scan_issue_event(config, repo_obj, ai_client, github_client):
auto_update=config.auto_update,
strip_characters=config.strip_characters,
quiet=config.quiet,
description_min_skip=config.description_min_skip,
)
results.append(result)

Expand Down
1 change: 1 addition & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def mock_config():
config.required_labels = []
config.apply_to_closed = False
config.event_data = None
config.description_min_skip = 40
return config


Expand Down
Loading