Spaces:
Sleeping
Sleeping
Heewon Oh
feat: initial release of VELA Framework v1.0.0 - Korean financial market research agent
9cef3a3 | """VELA Framework - ๊ฐ๋จํ ์ฌ์ฉ ์์ | |
| ํ๊ฒฝ ์ค์ ํ ์คํ: | |
| cp .env.example .env | |
| # .env์ API ํค ์ค์ | |
| python examples/simple_analysis.py | |
| """ | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| from vela import ResearchAgent | |
| from vela.schemas import ResearchOptions | |
| def main(): | |
| # 1. ์์ด์ ํธ ์ด๊ธฐํ (MLX ๋ฐฑ์๋ ์ฌ์ฉ) | |
| agent = ResearchAgent(llm_backend="mlx") | |
| # 2. ๋ฆฌ์์น ์ต์ ์ค์ | |
| options = ResearchOptions( | |
| max_iterations=3, # ๋น ๋ฅธ ๋ฐ๋ชจ๋ฅผ ์ํด 3ํ | |
| extract_content=True, # ์นํ์ด์ง ๋ณธ๋ฌธ ์ถ์ถ | |
| enable_verification=False, # ๊ฒ์ฆ ๋นํ์ฑํ (Perplexity ํค ๋ถํ์) | |
| ) | |
| # 3. ๋ฆฌ์์น ์คํ | |
| result = agent.research( | |
| query="SKํ์ด๋์ค HBM ์์ฅ ์ ๋ง", | |
| options=options, | |
| ) | |
| # 4. ๊ฒฐ๊ณผ ํ์ธ | |
| print(f"=== ๋ฆฌ์์น ๊ฒฐ๊ณผ ===") | |
| print(f"์ฟผ๋ฆฌ: {result.query}") | |
| print(f"์ ๋ขฐ๋: {result.confidence:.0%}") | |
| print(f"์์ค ์: {len(result.sources)}๊ฐ") | |
| print(f"์์ ์๊ฐ: {result.metadata.elapsed_seconds:.1f}์ด") | |
| print() | |
| # ํต์ฌ ๋ฐ๊ฒฌ | |
| print("=== ํต์ฌ ๋ฐ๊ฒฌ ===") | |
| for i, finding in enumerate(result.key_findings or [], 1): | |
| print(f" {i}. {finding}") | |
| print() | |
| # ๊ฒฐ๋ก (์๋ถ๋ถ) | |
| print("=== ๊ฒฐ๋ก (์์ฝ) ===") | |
| if result.conclusion: | |
| print(result.conclusion[:500]) | |
| print() | |
| # ์์ค ๋ชฉ๋ก | |
| print("=== ์์ค ===") | |
| for src in result.sources[:5]: | |
| print(f" [{src.source_type}] {src.title[:60]}") | |
| # 5. JSON์ผ๋ก ์ ์ฅ (์ ํ) | |
| from pathlib import Path | |
| output_dir = Path("output") | |
| output_dir.mkdir(exist_ok=True) | |
| saved = ResearchAgent.save_with_metadata( | |
| result=result, | |
| output_path=output_dir / "example_result.json", | |
| ) | |
| print(f"\n์ ์ฅ ์๋ฃ: {saved['result']}") | |
| if __name__ == "__main__": | |
| main() | |