Skip to content

Commit

Permalink
Bump to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Oct 29, 2024
1 parent 8e0b4ea commit ea85f70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: jlowin/ai-labeler@v0.2.1
- uses: jlowin/ai-labeler@v0.3.0
with:
include-repo-labels: true
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -59,7 +59,7 @@ By default, the AI labeler will use all labels found in your repository, as well
To disable this behavior, set `include-repo-labels` to `false`. In this case, the AI will only use labels defined in your config file. See the fine-tuning section below for more details.

```yaml
- uses: jlowin/ai-labeler@v0.2.1
- uses: jlowin/ai-labeler@v0.3.0
with:
include-repo-labels: false # Only use labels defined in config
```
Expand All @@ -74,7 +74,7 @@ You must specify an LLM provider and provide an API key. You can use either Open
By default, the AI labeler uses OpenAI's `gpt-4o-mini` model. This is an excellent and affordable choice for most users. However, 4o-mini can get confused by complex per-label instructions. You can specify a different model if you'd like:

```yaml
- uses: jlowin/ai-labeler@v0.2.1
- uses: jlowin/ai-labeler@v0.3.0
with:
controlflow-llm-model: openai/gpt-4o-mini
```
Expand All @@ -90,7 +90,7 @@ Note that you must provide an appropriate API key for your selected LLM provider
#### OpenAI

```yaml
- uses: jlowin/ai-labeler@v0.2.1
- uses: jlowin/ai-labeler@v0.3.0
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -103,7 +103,7 @@ Set your OpenAI API key as a repository secret named `OPENAI_API_KEY`. Since the
#### Anthropic

```yaml
- uses: jlowin/ai-labeler@v0.2.1
- uses: jlowin/ai-labeler@v0.3.0
with:
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
Expand All @@ -118,7 +118,7 @@ Set your Anthropic API key as a repository secret named `ANTHROPIC_API_KEY`. To
By default, the action looks for additional configuration in `.github/ai-labeler.yml`. You can specify a different location:

```yaml
- uses: jlowin/ai-labeler@v0.2.1
- uses: jlowin/ai-labeler@v0.3.0
with:
config-path: .github/my-custom-config.yml
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ai-labeler"
version = "0.2.1"
version = "0.3.0"
description = "GitHub Action that uses LLMs to label issues and PRs"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
8 changes: 6 additions & 2 deletions src/ai_labeler/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class Decision(BaseModel):
handlers=[],
)

print(decision.model_dump_json(indent=2))
selected_labels = [labels[i].name for i in decision.label_indices]

return [labels[i].name for i in decision.label_indices]
print(f"Available labels: {dict(enumerate(labels))}")
print(f"Reasoning: {decision.reasoning}")
print(f"Selected labels: {selected_labels}")

return selected_labels

0 comments on commit ea85f70

Please sign in to comment.