summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortehcoderer <me@tehcoderer.com>2024-05-30 10:57:01 -0400
committertehcoderer <me@tehcoderer.com>2024-05-30 10:57:01 -0400
commit846f63e1327af2269bab66d3427d6f0a11d079cf (patch)
tree75af1b29f2e929d8dd9ad3b7f9f4eecc007c8b0b
parentcb9b4457c89a9db85ff49d5056abc98c2f463f7b (diff)
yayaya it worky
-rw-r--r--openbb_platform/core/openbb_core/api/router/commands.py4
-rw-r--r--openbb_platform/core/openbb_core/app/static/package_builder.py4
-rw-r--r--openbb_platform/extensions/crypto/openbb_crypto/price/price_router.py5
3 files changed, 10 insertions, 3 deletions
diff --git a/openbb_platform/core/openbb_core/api/router/commands.py b/openbb_platform/core/openbb_core/api/router/commands.py
index 16b1380adf6..41094ddb3ab 100644
--- a/openbb_platform/core/openbb_core/api/router/commands.py
+++ b/openbb_platform/core/openbb_core/api/router/commands.py
@@ -201,8 +201,12 @@ def build_api_wrapper(
execute = partial(command_runner.run, path, user_settings)
output = await execute(*args, **kwargs)
+ if route.openapi_extra.get("is_stream", False):
+ return output.results
+
if isinstance(output, OBBject):
return validate_output(output)
+
return output
return wrapper
diff --git a/openbb_platform/core/openbb_core/app/static/package_builder.py b/openbb_platform/core/openbb_core/app/static/package_builder.py
index c0d3dbadce9..1f3e20f2920 100644
--- a/openbb_platform/core/openbb_core/app/static/package_builder.py
+++ b/openbb_platform/core/openbb_core/app/static/package_builder.py
@@ -342,8 +342,8 @@ class ImportDefinition:
if route:
if route.deprecated:
hint_type_list.append(type(route.summary.metadata))
- if not route.openapi_extra.get("is_stream", False):
- function_hint_type_list = cls.get_function_hint_type_list(func=route.endpoint) # type: ignore
+
+ function_hint_type_list = cls.get_function_hint_type_list(func=route.endpoint) # type: ignore
hint_type_list.extend(function_hint_type_list)
hint_type_list = list(set(hint_type_list))
diff --git a/openbb_platform/extensions/crypto/openbb_crypto/price/price_router.py b/openbb_platform/extensions/crypto/openbb_crypto/price/price_router.py
index 0eccc948fa6..a64b2db8936 100644
--- a/openbb_platform/extensions/crypto/openbb_crypto/price/price_router.py
+++ b/openbb_platform/extensions/crypto/openbb_crypto/price/price_router.py
@@ -69,4 +69,7 @@ async def live(symbol: str = "ethbtc", lifetime: int = 10, tld: str = "us") -> O
params={"symbol": symbol, "lifetime": lifetime, "tld": tld},
credentials=None,
)
- return StreamingResponse(generator, media_type="application/x-ndjson")
+ return OBBject(
+ results=StreamingResponse(generator, media_type="application/x-ndjson"),
+ provider="binance",
+ )