From 7b695012732f42c315e82201ed25c2642a7bbed1 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 9 Jan 2026 13:34:11 +0000 Subject: [PATCH] Remove remote prompt loading, update to use local prompts only --- README.md | 2 +- env_example | 1 - src/autometabuilder/main.py | 19 ++++--------------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 47a1076..c89dbc4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ AutoMetabuilder is an AI-powered tool designed to integrate with the metabuilder - **GitHub Integration**: Automatically fetches context from GitHub Issues and Pull Requests. - **SDLC Automation**: Can create branches and pull requests based on the AI's decisions. -- **Customizable Prompts**: Loads workflow instructions from a remote YAML prompt. +- **Customizable Prompts**: Loads workflow instructions from a local YAML prompt. ## Configuration diff --git a/env_example b/env_example index 6ff76ee..777c13e 100644 --- a/env_example +++ b/env_example @@ -1,6 +1,5 @@ GITHUB_TOKEN=token123 GITHUB_REPOSITORY=owner/repo -RAW_PROMPT_URL=https://raw.githubusercontent.com/johndoe6345789/metabuilder/main/getonwithit.prompt.yml PROMPT_PATH=prompt.yml GITHUB_MODELS_ENDPOINT=https://models.github.ai/inference APP_LANG=en # Supported: en, es, fr, nl, pirate diff --git a/src/autometabuilder/main.py b/src/autometabuilder/main.py index dd36ee7..7897e61 100644 --- a/src/autometabuilder/main.py +++ b/src/autometabuilder/main.py @@ -3,7 +3,6 @@ Main entry point for AutoMetabuilder. """ import os import json -import requests import yaml from dotenv import load_dotenv from openai import OpenAI @@ -13,27 +12,17 @@ from .github_integration import GitHubIntegration, get_repo_name_from_env load_dotenv() DEFAULT_PROMPT_PATH = "prompt.yml" -DEFAULT_RAW_PROMPT_URL = ( - "https://raw.githubusercontent.com/johndoe6345789/" - "metabuilder/main/getonwithit.prompt.yml" -) DEFAULT_ENDPOINT = "https://models.github.ai/inference" -def load_prompt_yaml(token: str) -> dict: - """Load prompt configuration from local file or remote URL.""" - # Try local file first +def load_prompt_yaml() -> dict: + """Load prompt configuration from local file.""" local_path = os.environ.get("PROMPT_PATH", DEFAULT_PROMPT_PATH) if os.path.exists(local_path): with open(local_path, "r", encoding="utf-8") as f: return yaml.safe_load(f) - # Fallback to remote URL - url = os.environ.get("RAW_PROMPT_URL", DEFAULT_RAW_PROMPT_URL) - headers = {"Authorization": f"Bearer {token}"} - r = requests.get(url, headers=headers, timeout=30) - r.raise_for_status() - return yaml.safe_load(r.text) + raise FileNotFoundError(f"Prompt file not found at {local_path}") def get_sdlc_context(gh: GitHubIntegration, msgs: dict) -> str: @@ -103,7 +92,7 @@ def main(): api_key=token, ) - prompt = load_prompt_yaml(token) + prompt = load_prompt_yaml() # Load tools for SDLC operations from JSON file tools_path = os.path.join(os.path.dirname(__file__), "tools.json")