Skip to content

Commit

Permalink
patch ultima
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoaquim committed Jan 2, 2024
1 parent 75ffb06 commit 30bca93
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions openbb_platform/providers/ultima/openbb_ultima/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
"""Ultima provider module."""
import warnings
from typing import Union

from openbb_core.provider.abstract.provider import Provider
from openbb_ultima.models.company_news import UltimaCompanyNewsFetcher
from openbb_ultima.models.sector_news import UltimaSectorNewsFetcher

ultima_provider = Provider(
name="ultima",
website="https://www.ultimainsights.ai/openbb",
description="""Ultima harnesses the power of LLMs to deliver news before it hits the frontpage of Bloomberg.""",
credentials=["api_key"],
fetcher_dict={
"CompanyNews": UltimaCompanyNewsFetcher,
"SectorNews": UltimaSectorNewsFetcher,
},
)

ultima_provider: Union[Provider, None] = None

try:
from openbb_ultima.models.company_news import UltimaCompanyNewsFetcher
from openbb_ultima.models.sector_news import UltimaSectorNewsFetcher

ultima_provider = Provider(
name="ultima",
website="https://www.ultimainsights.ai/openbb",
description="""Ultima harnesses the power of LLMs to deliver news before it hits the frontpage of Bloomberg.""",
credentials=["api_key"],
fetcher_dict={
"CompanyNews": UltimaCompanyNewsFetcher,
"SectorNews": UltimaSectorNewsFetcher,
},
)
except ImportError:
warnings.warn(
"openbb-ultima is not installed. Please install openbb-ultima to use the Ultima provider."
)

0 comments on commit 30bca93

Please sign in to comment.