Skip to content

A curated collection of practical AI projects implementing OCR systems, RAG, AI agents, and other AI use cases.

Files doc update for better readability

Avikumar Talaviya2cefc526c6c6
diff --git a/Financial analyst using agno and GPT-OSS coder/financial_agents.py b/Financial analyst using agno and GPT-OSS coder/financial_agents.py
index c4f97ee..8f5a130 100644
--- a/Financial analyst using agno and GPT-OSS coder/financial_agents.py
+++ b/Financial analyst using agno and GPT-OSS coder/financial_agents.py
@@ -28,7 +28,7 @@ except ImportError:
logger = logging.getLogger(__name__)
-# Pydantic models
+# Pydantic models for stock analysis and query parsing
class StockQuery(BaseModel):
"""Structured stock query model"""
symbol: str = Field(..., description="Stock ticker symbol")
@@ -53,6 +53,8 @@ class AnalysisResult(BaseModel):
news: List[MarketNews]
recommendations: str
+# ---------------------------------------------------****-----------------------------------------------------
+# GPT-OSS Interface for model inference
class GPTOSSInterface:
"""Interface to GPT-OSS model via Ollama"""
@@ -88,7 +90,8 @@ class GPTOSSInterface:
except Exception as e:
logger.error(f"Error querying GPT-OSS: {e}")
return f"Error: {str(e)}"
-
+# ---------------------------------------------------****-----------------------------------------------------
+# set all the financial tools
class FinancialTools:
"""Financial analysis tools for agents"""
@@ -165,6 +168,8 @@ class FinancialTools:
return {}
+# ---------------------------------------------------****-----------------------------------------------------
+# Query Parser Agent
class QueryParserAgent:
"""Agent for parsing natural language queries"""
@@ -267,7 +272,9 @@ class QueryParserAgent:
analysis_type=analysis_type,
time_period=time_period
)
-
+
+# ---------------------------------------------------****-----------------------------------------------------
+# Code generation agent for financial analysis
class CodeGeneratorAgent:
"""Agent for generating Python analysis code"""
@@ -446,6 +453,8 @@ except Exception as e:
print("Please check the stock symbol and try again.")
""".strip()
+# ---------------------------------------------------****-----------------------------------------------------
+# market analysis agent
class MarketAnalystAgent:
"""Agent for market analysis and insights"""
@@ -507,6 +516,8 @@ class MarketAnalystAgent:
return insights
+# ---------------------------------------------------****-----------------------------------------------------
+# FINAL CLASS FOR THE INTERACTION OF ALL AGENTS WITH THE SERVER AND USER QUERY
class FinancialAnalysisTeam:
"""Orchestrate the financial analysis team using Agno"""
diff --git a/Financial analyst using agno and GPT-OSS coder/main.py b/Financial analyst using agno and GPT-OSS coder/main.py
index f6fd4bb..d4a474f 100644
--- a/Financial analyst using agno and GPT-OSS coder/main.py
+++ b/Financial analyst using agno and GPT-OSS coder/main.py
@@ -44,6 +44,7 @@ except ImportError:
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("mcp-financial-agno")
+# set upa mcp server
class MCPFinancialServer:
"""MCP Server for Financial Analysis using Agno Framework"""
@@ -175,12 +176,12 @@ class MCPFinancialServer:
formatted_result = f"""# πŸ“ˆ Comprehensive Financial Analysis
-## 🎯 Query Analysis
-**Symbol:** {result.query.symbol}
-**Analysis Type:** {result.query.analysis_type.title()}
-**Time Period:** {result.query.time_period.upper()}
-**Additional Symbols:** {', '.join(result.query.additional_symbols) if result.query.additional_symbols else 'None'}
-**Technical Indicators:** {', '.join(result.query.indicators) if result.query.indicators else 'None'}
+ ## 🎯 Query Analysis
+ **Symbol:** {result.query.symbol}
+ **Analysis Type:** {result.query.analysis_type.title()}
+ **Time Period:** {result.query.time_period.upper()}
+ **Additional Symbols:** {', '.join(result.query.additional_symbols) if result.query.additional_symbols else 'None'}
+ **Technical Indicators:** {', '.join(result.query.indicators) if result.query.indicators else 'None'}
## πŸ’‘ Market Insights (GPT-OSS Analysis)
{result.insights}
@@ -249,9 +250,7 @@ Metadata: {json.dumps(metadata or {}, indent=2)}
'features': 'Firecrawl news integration',
**metadata
}, f, indent=2)
-
return [TextContent(type="text", text=f"βœ… Code saved successfully!\n\nπŸ“ **Location**: {code_file}\nπŸ“„ **Filename**: {filename}\nπŸ—‚οΈ **Directory**: {output_dir}\n\n{f'πŸ“‹ **Metadata**: Saved to {filename.replace(\".py\", \"_metadata.json\")}' if metadata else ''}")]
-
except Exception as e:
logger.error(f"Error saving code: {e}")
return [TextContent(type="text", text=f"❌ Error saving code: {str(e)}")]