order providers

This commit is contained in:
montezdesousa
2024-02-14 12:28:45 +00:00
parent efc0f2427f
commit 3130e86ce9
3 changed files with 8 additions and 6 deletions

View File

@@ -126,9 +126,11 @@ class RegistryMap:
model_field.json_schema_extra = {}
if p not in model_field.json_schema_extra:
model_field.json_schema_extra[p] = set()
model_field.json_schema_extra[p] = []
model_field.json_schema_extra[p].add(provider)
providers = model_field.json_schema_extra[p]
if provider not in providers:
providers.append(provider)
def _get_models(self, map_: MapType) -> List[str]:
"""Get available models."""

View File

@@ -140,7 +140,7 @@ class ROUTER_crypto_price(Container):
},
extra_params=kwargs,
extra_info={
"symbol": {"multiple_items_allowed": {"yfinance", "fmp", "polygon"}}
"symbol": {"multiple_items_allowed": ["fmp", "polygon", "yfinance"]}
},
)
)

View File

@@ -185,12 +185,12 @@ class ROUTER_equity_price(Container):
extra_params=kwargs,
extra_info={
"symbol": {
"multiple_items_allowed": {
"multiple_items_allowed": [
"fmp",
"polygon",
"yfinance",
"tiingo",
}
"yfinance",
]
}
},
)