-
Notifications
You must be signed in to change notification settings - Fork 14
Issue #7 completed #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| """ | ||
| Test script to verify all dependencies are properly installed | ||
| """ | ||
|
|
||
| import sys | ||
|
|
||
| print(f"Python version: {sys.version}") | ||
|
|
||
| # Test core dependencies | ||
| try: | ||
| import openai | ||
|
|
||
| print("✅ OpenAI package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ OpenAI import failed: {e}") | ||
|
|
||
| try: | ||
| from agents.researcher import ResearchAgent | ||
|
|
||
| print("✅ OpenAI Agents package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ OpenAI Agents import failed: {e}") | ||
|
|
||
| try: | ||
| import fastapi | ||
|
|
||
| print("✅ FastAPI package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ FastAPI import failed: {e}") | ||
|
|
||
| try: | ||
| from pydantic import BaseModel | ||
|
|
||
| print("✅ Pydantic package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Pydantic import failed: {e}") | ||
|
|
||
| try: | ||
| from supabase import create_client | ||
|
|
||
| print("✅ Supabase package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Supabase import failed: {e}") | ||
|
|
||
| try: | ||
| import aiohttp | ||
|
|
||
| print("✅ Aiohttp package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Aiohttp import failed: {e}") | ||
|
|
||
| try: | ||
| from dotenv import load_dotenv | ||
|
|
||
| print("✅ Python-dotenv package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Python-dotenv import failed: {e}") | ||
|
|
||
| try: | ||
| import structlog | ||
|
|
||
| print("✅ Structlog package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Structlog import failed: {e}") | ||
|
|
||
| print("\n🎉 Environment test completed!") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| """ | ||
| Test OpenAI API connection | ||
| """ | ||
| import os | ||
| from dotenv import load_dotenv | ||
| import openai | ||
|
|
||
| # Load environment variables | ||
| load_dotenv() | ||
|
|
||
| # Set up OpenAI client | ||
| client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY")) | ||
|
|
||
| def test_openai_connection(): | ||
| """Test basic OpenAI API connection""" | ||
| if not os.getenv("OPENAI_API_KEY") or os.getenv("OPENAI_API_KEY") == "your_openai_api_key_here": | ||
| print("⚠️ OpenAI API key not set. Skipping connection test.") | ||
| return | ||
|
|
||
| try: | ||
| # Test with a simple completion | ||
| response = client.chat.completions.create( | ||
| model="gpt-4.1-nano", | ||
| messages=[ | ||
| {"role": "user", "content": "Say 'Hello from Sport Scribe AI!'"} | ||
| ], | ||
| max_tokens=50 | ||
| ) | ||
|
|
||
| print("✅ OpenAI API connection successful!") | ||
| print(f"Response: {response.choices[0].message.content}") | ||
|
|
||
| except Exception as e: | ||
| print(f"❌ OpenAI API connection failed: {e}") | ||
|
|
||
| if __name__ == "__main__": | ||
| test_openai_connection() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| """Test script to verify all dependencies are properly installed.""" | ||
|
|
||
| import sys | ||
|
|
||
| print(f"Python version: {sys.version}") | ||
|
|
||
| # Test core dependencies | ||
| try: | ||
| print("✅ OpenAI package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ OpenAI import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ OpenAI Agents package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ OpenAI Agents import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ FastAPI package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ FastAPI import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ Pydantic package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Pydantic import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ Supabase package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Supabase import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ Aiohttp package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Aiohttp import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ Python-dotenv package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Python-dotenv import failed: {e}") | ||
|
|
||
| try: | ||
| print("✅ Structlog package imported successfully") | ||
| except ImportError as e: | ||
| print(f"❌ Structlog import failed: {e}") | ||
|
|
||
| print("\n🎉 Environment test completed!") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| """Test OpenAI API connection.""" | ||
|
|
||
| import os | ||
|
|
||
| import openai | ||
| from dotenv import load_dotenv | ||
|
|
||
| # Load environment variables | ||
| load_dotenv() | ||
|
|
||
| # Set up OpenAI client | ||
| client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY")) | ||
|
|
||
|
|
||
| def test_openai_connection() -> None: | ||
| """Test basic OpenAI API connection.""" | ||
| if not os.getenv("OPENAI_API_KEY") or os.getenv("OPENAI_API_KEY") == "your_openai_api_key_here": | ||
| print("⚠️ OpenAI API key not set. Skipping connection test.") | ||
| return | ||
|
|
||
| try: | ||
| # Test with a simple completion | ||
| response = client.chat.completions.create( | ||
| model="gpt-4.1-nano", | ||
| messages=[{"role": "user", "content": "Say 'Hello from Sport Scribe AI!'"}], | ||
| max_tokens=50, | ||
| ) | ||
|
|
||
| print("✅ OpenAI API connection successful!") | ||
| print(f"Response: {response.choices[0].message.content}") | ||
|
|
||
| except Exception as e: | ||
| print(f"❌ OpenAI API connection failed: {e}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| test_openai_connection() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| """Sample code to test quality tools.""" | ||
|
|
||
| import asyncio | ||
|
|
||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Clarify the purpose: this isn't a proper test file. The file is located in the
🤖 Prompt for AI Agents |
||
|
|
||
| class FootballDataProcessor: | ||
| """Process football data for AI analysis.""" | ||
|
|
||
| def __init__(self, league: str) -> None: | ||
| """Initialize processor with league.""" | ||
| self.league = league | ||
| self.processed_games: list[dict[str, str]] = [] | ||
|
|
||
| def process_game_data( | ||
| self, home_team: str, away_team: str, score: str | None = None | ||
| ) -> dict[str, str]: | ||
| """Process individual game data. | ||
|
|
||
| Args: | ||
| home_team: Name of home team | ||
| away_team: Name of away team | ||
| score: Optional match score | ||
|
|
||
| Returns: | ||
| Processed game data dictionary | ||
| """ | ||
| game_data = { | ||
| "home_team": home_team.strip(), | ||
| "away_team": away_team.strip(), | ||
| "league": self.league, | ||
| } | ||
|
|
||
| if score: | ||
| game_data["score"] = score.strip() | ||
|
|
||
| return game_data | ||
|
|
||
| async def fetch_recent_games(self, limit: int = 10) -> list[dict[str, str]]: | ||
| """Fetch recent games asynchronously. | ||
|
|
||
| Args: | ||
| limit: Maximum number of games to fetch | ||
|
|
||
| Returns: | ||
| list of recent games | ||
| """ | ||
| # Simulate async API call | ||
| await asyncio.sleep(0.1) | ||
|
|
||
| return [ | ||
| self.process_game_data("Arsenal", "Chelsea", "2-1"), | ||
| self.process_game_data("Liverpool", "Manchester City", "1-3"), | ||
| ][:limit] | ||
|
|
||
|
|
||
| def main() -> None: | ||
| """Main function to test the processor.""" | ||
| processor = FootballDataProcessor("Premier League") | ||
|
|
||
| # Test synchronous processing | ||
| game = processor.process_game_data("Arsenal", "Chelsea", "2-1") | ||
| print(f"Processed game: {game}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the OpenAI model name.
The model name "gpt-4.1-nano" doesn't appear to be a valid OpenAI model. Please verify this is correct or update to a valid model name like "gpt-4-turbo" or "gpt-3.5-turbo".
🌐 Web query:
💡 Result:
As of mid-2025, the current available OpenAI chat completion models—including API and platform access (such as ChatGPT)—span several generations. The major families and notable individual models are:
1. GPT-4o Series
2. GPT-4.1 and GPT-4.5
3. O-Series Reasoning Models
4. GPT-3.5 Turbo
5. Specialized Models
Notes on Access and Use
Summary Table of Current OpenAI Chat Completion Models (2024–2025)
For a full, always-updated listing and details on current API-available models, consult OpenAI or Azure documentation for your workspace or account[5][7].
In summary: As of 2024, OpenAI’s primary chat completion models are GPT-4o (full and mini), GPT-4.1, GPT-4.5, o-series (o3, o4-mini, o1, etc.), and GPT-3.5 Turbo, with audio and reasoning-specialized models available for advanced use cases[2][4][5][6][8].
Citations:
Use a valid OpenAI model name
The value
“gpt-4.1-nano”is not a recognized model. Please update it to one of the currently supported chat-completion models. For example:gpt-4.1gpt-4.5gpt-4o-minigpt-3.5-turboLocations to update:
Example change:
📝 Committable suggestion
🤖 Prompt for AI Agents