Buckets:
| """ | |
| Pytest configuration and fixtures for GatheRing tests. | |
| """ | |
| import pytest | |
| import tempfile | |
| import shutil | |
| from pathlib import Path | |
| from gathering.core.implementations import ( | |
| BasicAgent, | |
| BasicMemory, | |
| MockLLMProvider, | |
| BasicPersonalityBlock, | |
| CalculatorTool, | |
| FileSystemTool, | |
| ) | |
| def temp_dir(): | |
| """Create a temporary directory for test files.""" | |
| temp_path = tempfile.mkdtemp() | |
| yield Path(temp_path) | |
| shutil.rmtree(temp_path) | |
| def basic_agent_config(): | |
| """Basic agent configuration for testing.""" | |
| return {"name": "TestAgent", "llm_provider": "openai", "model": "gpt-4", "api_key": "test_key"} | |
| def agent_with_tools_config(): | |
| """Agent configuration with tools.""" | |
| return { | |
| "name": "ToolAgent", | |
| "llm_provider": "openai", | |
| "model": "gpt-4", | |
| "api_key": "test_key", | |
| "tools": ["calculator", "filesystem"], | |
| } | |
| def mock_llm_provider(): | |
| """Create a mock LLM provider.""" | |
| return MockLLMProvider.create("openai", {"api_key": "test_key", "model": "gpt-4"}) | |
| def calculator_tool(): | |
| """Create a calculator tool.""" | |
| return CalculatorTool.from_config({"name": "calculator", "type": "calculator"}) | |
| def filesystem_tool(temp_dir): | |
| """Create a filesystem tool with temp directory.""" | |
| return FileSystemTool.from_config( | |
| {"name": "filesystem", "type": "filesystem", "permissions": ["read", "write"], "base_path": str(temp_dir)} | |
| ) | |
Xet Storage Details
- Size:
- 1.55 kB
- Xet hash:
- 08cd4e426915b039963eee4eb95feccb21cafdaeee08e388b5b41efe12c64132
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.