| 1 | from __future__ import annotations |
| 2 | |
| 3 | from app.models import ( |
| 4 | FetchStrategy, |
| 5 | ReliabilityLevel, |
| 6 | ResearchSourceProvider, |
| 7 | SourceAccessStatus, |
| 8 | SourceRateLimitPolicy, |
| 9 | SourceType, |
| 10 | ) |
| 11 | |
| 12 | |
| 13 | def default_source_providers() -> list[ResearchSourceProvider]: |
| 14 | return [ |
| 15 | ResearchSourceProvider( |
| 16 | source_id="official-company-website", |
| 17 | source_type=SourceType.COMPANY_WEBSITE, |
| 18 | source_name="Company website", |
| 19 | fetch_strategy=FetchStrategy.HTTP, |
| 20 | reliability_level=ReliabilityLevel.LEVEL_B, |
| 21 | automatic_access=SourceAccessStatus.MANUAL_ONLY, |
| 22 | rate_limit_policy=SourceRateLimitPolicy(requests_per_minute=2, min_delay_seconds=30), |
| 23 | ), |
| 24 | ResearchSourceProvider( |
| 25 | source_id="investor-relations", |
| 26 | source_type=SourceType.INVESTOR_RELATIONS, |
| 27 | source_name="Investor relations", |
| 28 | fetch_strategy=FetchStrategy.HTTP, |
| 29 | reliability_level=ReliabilityLevel.LEVEL_B, |
| 30 | automatic_access=SourceAccessStatus.MANUAL_ONLY, |
| 31 | rate_limit_policy=SourceRateLimitPolicy(requests_per_minute=3, min_delay_seconds=20), |
| 32 | ), |
| 33 | ResearchSourceProvider( |
| 34 | source_id="exchange-announcements", |
| 35 | source_type=SourceType.EXCHANGE_ANNOUNCEMENT, |
| 36 | source_name="Exchange announcements", |
| 37 | fetch_strategy=FetchStrategy.HTTP, |
| 38 | reliability_level=ReliabilityLevel.LEVEL_A, |
| 39 | automatic_access=SourceAccessStatus.MANUAL_ONLY, |
| 40 | rate_limit_policy=SourceRateLimitPolicy(requests_per_minute=6, min_delay_seconds=10), |
| 41 | ), |
| 42 | ResearchSourceProvider( |
| 43 | source_id="regulatory-filings", |
| 44 | source_type=SourceType.REGULATORY_FILING, |
| 45 | source_name="Regulatory filings", |
| 46 | fetch_strategy=FetchStrategy.HTTP, |
| 47 | reliability_level=ReliabilityLevel.LEVEL_A, |
| 48 | automatic_access=SourceAccessStatus.MANUAL_ONLY, |
| 49 | ), |
| 50 | ResearchSourceProvider( |
| 51 | source_id="government-procurement", |
| 52 | source_type=SourceType.GOVERNMENT_PROCUREMENT, |
| 53 | source_name="Government procurement", |
| 54 | fetch_strategy=FetchStrategy.HTTP, |
| 55 | reliability_level=ReliabilityLevel.LEVEL_A, |
| 56 | automatic_access=SourceAccessStatus.MANUAL_ONLY, |
| 57 | ), |
| 58 | ResearchSourceProvider( |
| 59 | source_id="rss", |
| 60 | source_type=SourceType.RSS, |
| 61 | source_name="Permitted RSS feed", |
| 62 | fetch_strategy=FetchStrategy.HTTP, |
| 63 | reliability_level=ReliabilityLevel.LEVEL_C, |
| 64 | automatic_access=SourceAccessStatus.AVAILABLE, |
| 65 | ), |
| 66 | ResearchSourceProvider( |
| 67 | source_id="news", |
| 68 | source_type=SourceType.NEWS, |
| 69 | source_name="Permitted financial news", |
| 70 | fetch_strategy=FetchStrategy.HTTP, |
| 71 | reliability_level=ReliabilityLevel.LEVEL_C, |
| 72 | automatic_access=SourceAccessStatus.MANUAL_ONLY, |
| 73 | ), |
| 74 | ResearchSourceProvider( |
| 75 | source_id="search-discovery-disabled", |
| 76 | source_type=SourceType.SEARCH_DISCOVERY, |
| 77 | source_name="Search discovery provider", |
| 78 | fetch_strategy=FetchStrategy.MANUAL, |
| 79 | reliability_level=ReliabilityLevel.LEVEL_E, |
| 80 | automatic_access=SourceAccessStatus.UNAVAILABLE, |
| 81 | ), |
| 82 | ] |