Instructions to use EzioDevio/gemma4-dev-agent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EzioDevio/gemma4-dev-agent with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("EzioDevio/gemma4-dev-agent", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download tests/test_ast_parser.py from EzioDevio/gemma4-dev-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/EzioDevio/gemma4-dev-agent/resolve/main/tests/test_ast_parser.py
- Command line
-
hf download hf://EzioDevio/gemma4-dev-agent/tests/test_ast_parser.py
-
curl -L -o test_ast_parser.py https://huggingface.co/EzioDevio/gemma4-dev-agent/resolve/main/tests/test_ast_parser.py
1.54 kB
| import pytest | |
| from pathlib import Path | |
| from src.tools.ast_parser import RepositoryASTParser, StructureVisitor | |
| def test_ast_parser_success(tmp_path): | |
| parser = RepositoryASTParser(repo_root=str(tmp_path)) | |
| test_file = tmp_path / "sample.py" | |
| code_content = """ | |
| import os | |
| from pathlib import Path | |
| class SampleClass: | |
| def sample_method(self, x): | |
| return x + 1 | |
| def sample_function(y): | |
| return y * 2 | |
| """ | |
| test_file.write_text(code_content, encoding="utf-8") | |
| res = parser.parse_file("sample.py") | |
| assert res["status"] == "success" | |
| assert "os" in res["imports"] | |
| assert "pathlib.Path" in res["imports"] | |
| assert len(res["classes"]) == 1 | |
| assert res["classes"][0]["name"] == "SampleClass" | |
| assert "sample_method" in res["classes"][0]["methods"] | |
| assert len(res["functions"]) == 2 | |
| func_names = [f["name"] for f in res["functions"]] | |
| assert "sample_method" in func_names | |
| assert "sample_function" in func_names | |
| def test_ast_parser_file_not_found(tmp_path): | |
| parser = RepositoryASTParser(repo_root=str(tmp_path)) | |
| res = parser.parse_file("nonexistent.py") | |
| assert res["status"] == "error" | |
| assert "not found" in res["message"] | |
| def test_ast_parser_syntax_error(tmp_path): | |
| parser = RepositoryASTParser(repo_root=str(tmp_path)) | |
| test_file = tmp_path / "broken.py" | |
| test_file.write_text("def broken_syntax( :", encoding="utf-8") | |
| res = parser.parse_file("broken.py") | |
| assert res["status"] == "error" | |
| assert "Failed to parse AST" in res["message"] | |