diff --git a/openbb_sdk/builtin_extensions/economy/economy_router.py b/openbb_sdk/builtin_extensions/economy/economy_router.py index fcc5edae821..b3874c8d5f9 100644 --- a/openbb_sdk/builtin_extensions/economy/economy_router.py +++ b/openbb_sdk/builtin_extensions/economy/economy_router.py @@ -4,7 +4,12 @@ from typing import List, Literal, Union from openbb_sdk_core.app.model.command_context import CommandContext from openbb_sdk_core.app.model.command_output import CommandOutput from openbb_sdk_core.app.model.results.empty import Empty -from openbb_sdk_core.app.provider_interface import ProviderChoices +from openbb_sdk_core.app.provider_interface import ( + ProviderChoices, + StandardParams, + ExtraParams, +) +from openbb_sdk_core.app.query import Query from openbb_sdk_core.app.router import Router datetype = Union[datetime.datetime, str] @@ -53,20 +58,15 @@ def corecpi( # pylint: disable=too-many-arguments -@router.command +@router.command(query="CPI") def cpi( cc: CommandContext, provider_choices: ProviderChoices, - countries: list_str, - start_date: datetype, - end_date: datetype, - units: Literal["growth_previous", "growth_same", "index_2015"] = "growth_same", - frequency: Literal["annual", "monthly", "quarterly"] = "monthly", - harmonized: bool = False, - smart_select: bool = True, + standard_params: StandardParams, + extra_params: ExtraParams, ) -> CommandOutput[Empty]: # type: ignore """CPI.""" - return CommandOutput(results=Empty()) + return CommandOutput(results=Query(**locals()).execute()) @router.command diff --git a/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/hub/hub_manager.py b/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/hub/hub_manager.py index 9f312154f07..dd9ac7d3c4a 100644 --- a/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/hub/hub_manager.py +++ b/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/hub/hub_manager.py @@ -207,6 +207,7 @@ class HubManager: credentials = Credentials( fmp_api_key=settings.features_keys.API_KEY_FINANCIALMODELINGPREP, polygon_api_key=settings.features_keys.API_POLYGON_KEY, + fred_api_key=settings.features_keys.API_FRED_KEY, ) return credentials @@ -216,6 +217,7 @@ class HubManager: features_keys = FeaturesKeys( API_KEY_FINANCIALMODELINGPREP=credentials.fmp_api_key, API_POLYGON_KEY=credentials.polygon_api_key, + API_FRED_KEY=credentials.fred_api_key, ) hub_user_settings = HubUserSettings(features_keys=features_keys) return hub_user_settings diff --git a/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/model/credentials.py b/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/model/credentials.py index 2d7dd973ab8..50921f9d3ef 100644 --- a/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/model/credentials.py +++ b/openbb_sdk/openbb_sdk_core/openbb_sdk_core/app/model/credentials.py @@ -7,6 +7,7 @@ class Credentials(BaseModel): fmp_api_key: Optional[str] = None polygon_api_key: Optional[str] = None benzinga_api_key: Optional[str] = None + fred_api_key: Optional[str] = None class Config: validate_assignment = True