From fc955e6f123c862eb9aa3467e766846660b1351c Mon Sep 17 00:00:00 2001 From: d-claro Date: Fri, 3 Jul 2026 10:14:09 +0100 Subject: [PATCH 1/2] feat: add changelog to README --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5218377..4e1ca1c 100644 --- a/README.md +++ b/README.md @@ -99,4 +99,9 @@ Generates file: `knowledge_base/history.md` - Always activate the virtual environment before using the tool: `source venv/bin/activate` - Never delete a test case — change the state to `Blocked` if no longer applicable - Update `roadmap.md` whenever a step is completed -- The `venv/` folder should not be shared or pushed to Git \ No newline at end of file +- The `venv/` folder should not be shared or pushed to Git + + +## Changelog + +- 2026-06-30 — Initial project setup \ No newline at end of file From 2b09df821db783aecab10b1918e349324745578f Mon Sep 17 00:00:00 2001 From: d-claro Date: Mon, 6 Jul 2026 11:30:36 +0100 Subject: [PATCH 2/2] feat: add AI integration with Ollama and ask command --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- agent/cli.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e1ca1c..243ec10 100644 --- a/README.md +++ b/README.md @@ -104,4 +104,50 @@ Generates file: `knowledge_base/history.md` ## Changelog -- 2026-06-30 — Initial project setup \ No newline at end of file +- 2026-06-30 — Initial project setup + +## Requirements + +> Already listed above, but for AI integration add: +- [Ollama](https://ollama.com) installed and running +- Llama 3.2 model pulled locally + +## AI Integration Setup + +**1. Install Ollama:** +```bash +curl -fsSL https://ollama.com/install.sh | sh +``` + +**2. Start the Ollama server:** +```bash +ollama serve +``` + +**3. Pull the Llama 3.2 model:** +```bash +ollama pull llama3.2 +``` + +**4. Install the Python Ollama library:** +```bash +pip install ollama +``` + +> Note: The `ollama serve` terminal must remain active while using the `ask` command. + +## AI Command + +### šŸ¤– Ask the AI agent a question +```bash +python agent/cli.py ask "Your question here" +``` + +The agent reads the entire Knowledge Base (test cases, roadmap, guidelines) before answering, ensuring responses are always contextualised to your project. + +**Examples:** +```bash +python agent/cli.py ask "What should I test next?" +python agent/cli.py ask "What test cases do we have for the Login module?" +python agent/cli.py ask "What are the team guidelines for automation?" +``` \ No newline at end of file diff --git a/agent/cli.py b/agent/cli.py index a862809..47b8415 100644 --- a/agent/cli.py +++ b/agent/cli.py @@ -227,5 +227,49 @@ def export_tests_history(): click.echo(f"\nāœ… Test cases history exported to knowledge_base/test_cases_history.md\n") +# Command: ask a question to the AI agent +@cli.command() +@click.argument("question") +def ask(question): + """Ask a question to the AI agent based on the Knowledge Base.""" + import ollama + + # Load knowledge base context + with open(TEST_CASES_PATH, "r") as f: + test_cases = json.load(f) + + roadmap_path = os.path.join(BASE_DIR, "knowledge_base", "roadmap", "roadmap.md") + with open(roadmap_path, "r") as f: + roadmap = f.read() + + guidelines_path = os.path.join(BASE_DIR, "knowledge_base", "guidelines", "guidelines.md") + with open(guidelines_path, "r") as f: + guidelines = f.read() + + # Build context + context = f""" +You are a QA assistant. Answer based only on the following project information: + +TEAM ROADMAP: +{roadmap} + +QA GUIDELINES: +{guidelines} + +TEST CASES: +{json.dumps(test_cases, indent=2)} + +Answer the following question: {question} +""" + + click.echo("\nšŸ¤– Thinking...\n") + + response = ollama.chat( + model="llama3.2", + messages=[{"role": "user", "content": context}] + ) + + click.echo(f"{response['message']['content']}\n") + if __name__ == "__main__": cli() \ No newline at end of file