Skip to content

Commit 3ea76f1

Browse files
committed
Remove ai parser
1 parent 6d3c554 commit 3ea76f1

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

src/redis_release/cli.py

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from openai import OpenAI
1111
from py_trees.display import render_dot_tree, unicode_tree
1212

13-
from .ai_parser import parse_message_with_ai
1413
from .bht.conversation_state import InboxMessage
1514
from .bht.conversation_tree import (
1615
create_conversation_root_node,
@@ -356,77 +355,6 @@ def slack_bot(
356355
)
357356

358357

359-
@app.command()
360-
def ai(
361-
message: str = typer.Option(
362-
..., "--message", "-m", help="Natural language release command"
363-
),
364-
config_file: Optional[str] = typer.Option(
365-
None, "--config", "-c", help="Path to config file (default: config.yaml)"
366-
),
367-
openai_api_key: Optional[str] = typer.Option(
368-
None,
369-
"--openai-api-key",
370-
help="OpenAI API key (if not provided, uses OPENAI_API_KEY env var)",
371-
),
372-
model: str = typer.Option(
373-
"gpt-4o-mini",
374-
"--model",
375-
help="OpenAI model to use (default: gpt-4o-mini)",
376-
),
377-
execute: bool = typer.Option(
378-
False,
379-
"--execute",
380-
help="Execute the release after parsing (default: just show the parsed args)",
381-
),
382-
tree_cutoff: int = typer.Option(
383-
5000, "--tree-cutoff", help="Max number of ticks to run the tree for"
384-
),
385-
) -> None:
386-
"""[EXPERIMENTAL] Parse natural language message into ReleaseArgs using AI.
387-
388-
This command uses OpenAI to parse a natural language description of a release
389-
into a structured ReleaseArgs object. By default, it only displays the parsed
390-
arguments. Use --execute to actually run the release.
391-
392-
Examples:
393-
redis-release ai --message "Release 8.4-m01-int1"
394-
redis-release ai --message "Release 8.4-m01-int1 for docker only"
395-
redis-release ai --message "Force rebuild all packages for 8.4-m01-int1"
396-
redis-release ai --message "Release 8.4-m01-int1 with docker as internal" --execute
397-
"""
398-
setup_logging()
399-
400-
try:
401-
# Parse the message using AI
402-
args = parse_message_with_ai(message, api_key=openai_api_key, model=model)
403-
404-
# Display the parsed arguments
405-
logger.info("[green]Successfully parsed release arguments:[/green]")
406-
print(json.dumps(args.model_dump(), indent=2, default=str))
407-
408-
if not execute:
409-
logger.info(
410-
"\n[yellow]Note:[/yellow] This is a dry run. Use --execute to actually run the release."
411-
)
412-
return
413-
414-
# Execute the release if requested
415-
logger.info("\n[cyan]Executing release...[/cyan]")
416-
config_path = config_file or "config.yaml"
417-
config = load_config(config_path)
418-
419-
with initialize_tree_and_state(config, args) as (tree, _):
420-
asyncio.run(async_tick_tock(tree, cutoff=tree_cutoff))
421-
422-
except ValueError as e:
423-
logger.error(f"[red]Error:[/red] {e}")
424-
raise typer.Exit(1)
425-
except Exception as e:
426-
logger.error(f"[red]Unexpected error:[/red] {e}", exc_info=True)
427-
raise typer.Exit(1)
428-
429-
430358
@app.command()
431359
def test_github_app(
432360
github_app_id: str = typer.Option(..., "--github-app-id", help="GitHub App ID"),

0 commit comments

Comments
 (0)