nvidia-nat 1.3.0a20251107__py3-none-any.whl → 1.3.0a20251109__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nat/front_ends/fastapi/fastapi_front_end_plugin_worker.py +4 -3
- nat/tool/server_tools.py +15 -2
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/METADATA +1 -1
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/RECORD +9 -9
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/WHEEL +0 -0
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/entry_points.txt +0 -0
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/licenses/LICENSE.md +0 -0
- {nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/top_level.txt +0 -0
|
@@ -544,7 +544,8 @@ class FastApiFrontEndPluginWorker(FastApiFrontEndPluginWorkerBase):
|
|
|
544
544
|
GenerateStreamResponseType = workflow.streaming_output_schema
|
|
545
545
|
GenerateSingleResponseType = workflow.single_output_schema
|
|
546
546
|
|
|
547
|
-
|
|
547
|
+
# Skip async generation for custom routes (those with function_name)
|
|
548
|
+
if self._dask_available and not hasattr(endpoint, 'function_name'):
|
|
548
549
|
# Append job_id and expiry_seconds to the input schema, this effectively makes these reserved keywords
|
|
549
550
|
# Consider prefixing these with "nat_" to avoid conflicts
|
|
550
551
|
|
|
@@ -921,7 +922,7 @@ class FastApiFrontEndPluginWorker(FastApiFrontEndPluginWorkerBase):
|
|
|
921
922
|
responses={500: response_500},
|
|
922
923
|
)
|
|
923
924
|
|
|
924
|
-
if self._dask_available:
|
|
925
|
+
if self._dask_available and not hasattr(endpoint, 'function_name'):
|
|
925
926
|
app.add_api_route(
|
|
926
927
|
path=f"{endpoint.path}/async",
|
|
927
928
|
endpoint=post_async_generation(request_type=AsyncGenerateRequest),
|
|
@@ -935,7 +936,7 @@ class FastApiFrontEndPluginWorker(FastApiFrontEndPluginWorkerBase):
|
|
|
935
936
|
else:
|
|
936
937
|
raise ValueError(f"Unsupported method {endpoint.method}")
|
|
937
938
|
|
|
938
|
-
if self._dask_available:
|
|
939
|
+
if self._dask_available and not hasattr(endpoint, 'function_name'):
|
|
939
940
|
app.add_api_route(
|
|
940
941
|
path=f"{endpoint.path}/async/job/{{job_id}}",
|
|
941
942
|
endpoint=get_async_job_status,
|
nat/tool/server_tools.py
CHANGED
|
@@ -32,14 +32,23 @@ class RequestAttributesTool(FunctionBaseConfig, name="current_request_attributes
|
|
|
32
32
|
@register_function(config_type=RequestAttributesTool)
|
|
33
33
|
async def current_request_attributes(config: RequestAttributesTool, builder: Builder):
|
|
34
34
|
|
|
35
|
+
from pydantic import RootModel
|
|
36
|
+
from pydantic.types import JsonValue
|
|
35
37
|
from starlette.datastructures import Headers
|
|
36
38
|
from starlette.datastructures import QueryParams
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
class RequestBody(RootModel[JsonValue]):
|
|
41
|
+
"""
|
|
42
|
+
Data model that accepts a request body of any valid JSON type.
|
|
43
|
+
"""
|
|
44
|
+
root: JsonValue
|
|
45
|
+
|
|
46
|
+
async def _get_request_attributes(request_body: RequestBody) -> str:
|
|
39
47
|
|
|
40
48
|
from nat.builder.context import Context
|
|
41
49
|
nat_context = Context.get()
|
|
42
50
|
|
|
51
|
+
# Access request attributes from context
|
|
43
52
|
method: str | None = nat_context.metadata.method
|
|
44
53
|
url_path: str | None = nat_context.metadata.url_path
|
|
45
54
|
url_scheme: str | None = nat_context.metadata.url_scheme
|
|
@@ -51,6 +60,9 @@ async def current_request_attributes(config: RequestAttributesTool, builder: Bui
|
|
|
51
60
|
cookies: dict[str, str] | None = nat_context.metadata.cookies
|
|
52
61
|
conversation_id: str | None = nat_context.conversation_id
|
|
53
62
|
|
|
63
|
+
# Access the request body data - can be any valid JSON type
|
|
64
|
+
request_body_data: JsonValue = request_body.root
|
|
65
|
+
|
|
54
66
|
return (f"Method: {method}, "
|
|
55
67
|
f"URL Path: {url_path}, "
|
|
56
68
|
f"URL Scheme: {url_scheme}, "
|
|
@@ -60,7 +72,8 @@ async def current_request_attributes(config: RequestAttributesTool, builder: Bui
|
|
|
60
72
|
f"Client Host: {client_host}, "
|
|
61
73
|
f"Client Port: {client_port}, "
|
|
62
74
|
f"Cookies: {cookies}, "
|
|
63
|
-
f"Conversation Id: {conversation_id}"
|
|
75
|
+
f"Conversation Id: {conversation_id}, "
|
|
76
|
+
f"Request Body: {request_body_data}")
|
|
64
77
|
|
|
65
78
|
yield FunctionInfo.from_fn(_get_request_attributes,
|
|
66
79
|
description="Returns the acquired user defined request attributes.")
|
|
@@ -242,7 +242,7 @@ nat/front_ends/fastapi/dask_client_mixin.py,sha256=N_tw4yxA7EKIFTKp5_C2ZksIZucWx
|
|
|
242
242
|
nat/front_ends/fastapi/fastapi_front_end_config.py,sha256=O_iRpGS3Vpht7ZNr1bYpvoldDEb9Z6f7tFPazVP5i9U,12383
|
|
243
243
|
nat/front_ends/fastapi/fastapi_front_end_controller.py,sha256=ei-34KCMpyaeAgeAN4gVvSGFjewjjRhHZPN0FqAfhDY,2548
|
|
244
244
|
nat/front_ends/fastapi/fastapi_front_end_plugin.py,sha256=5akdWipe8onOTdSqrbGq9KO71y0_BNQQJ3JAFj6LmFY,11575
|
|
245
|
-
nat/front_ends/fastapi/fastapi_front_end_plugin_worker.py,sha256=
|
|
245
|
+
nat/front_ends/fastapi/fastapi_front_end_plugin_worker.py,sha256=QMERZEifVTDMWttSQqPZu3k8EEPJflPrIR6tkHTkZYg,60594
|
|
246
246
|
nat/front_ends/fastapi/intermediate_steps_subscriber.py,sha256=kbyWlBVpyvyQQjeUnFG9nsR4RaqqNkx567ZSVwwl2RU,3104
|
|
247
247
|
nat/front_ends/fastapi/job_store.py,sha256=cWIBnIgRdkGL7qbBunEKzTYzdPp3l3QCDHMP-qTZJpc,22743
|
|
248
248
|
nat/front_ends/fastapi/main.py,sha256=s8gXCy61rJjK1aywMRpgPvzlkMGsCS-kI_0EIy4JjBM,2445
|
|
@@ -420,7 +420,7 @@ nat/tool/github_tools.py,sha256=Pn6p6ebLClNUy6MJIWf-Pl5NguMUT-IJ-bhmpJmvBrg,2190
|
|
|
420
420
|
nat/tool/nvidia_rag.py,sha256=cEHSc3CZwpd71YcOQngya-Ca_B6ZOb87Dmsoza0VhFY,4163
|
|
421
421
|
nat/tool/register.py,sha256=F1mQs9gI3Ee0EESFyBiTFZeqscY173ENQlfKcWZup0c,1208
|
|
422
422
|
nat/tool/retriever.py,sha256=FP5JL1vCQNrqaKz4F1up-osjxEPhxPFOyaScrgByc34,3877
|
|
423
|
-
nat/tool/server_tools.py,sha256=
|
|
423
|
+
nat/tool/server_tools.py,sha256=sxsgaF5ZjKIc3cSLldt1MDhY3kptrDnkP3kVYvVexfY,3679
|
|
424
424
|
nat/tool/code_execution/README.md,sha256=sl3YX4As95HX61XqTXOGnUcHBV1lla-OeuTnLI4qgng,4019
|
|
425
425
|
nat/tool/code_execution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
426
426
|
nat/tool/code_execution/code_sandbox.py,sha256=evu0n9oTc_MrrQuYbo1TP0sjnjLniRgCsOubO5G5WT4,10090
|
|
@@ -470,10 +470,10 @@ nat/utils/reactive/base/observer_base.py,sha256=6BiQfx26EMumotJ3KoVcdmFBYR_fnAss
|
|
|
470
470
|
nat/utils/reactive/base/subject_base.py,sha256=UQOxlkZTIeeyYmG5qLtDpNf_63Y7p-doEeUA08_R8ME,2521
|
|
471
471
|
nat/utils/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
472
472
|
nat/utils/settings/global_settings.py,sha256=9JaO6pxKT_Pjw6rxJRsRlFCXdVKCl_xUKU2QHZQWWNM,7294
|
|
473
|
-
nvidia_nat-1.3.
|
|
474
|
-
nvidia_nat-1.3.
|
|
475
|
-
nvidia_nat-1.3.
|
|
476
|
-
nvidia_nat-1.3.
|
|
477
|
-
nvidia_nat-1.3.
|
|
478
|
-
nvidia_nat-1.3.
|
|
479
|
-
nvidia_nat-1.3.
|
|
473
|
+
nvidia_nat-1.3.0a20251109.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
|
|
474
|
+
nvidia_nat-1.3.0a20251109.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
475
|
+
nvidia_nat-1.3.0a20251109.dist-info/METADATA,sha256=dW2tOUra6_LHsIxKCQ2wNwIwHiZh5wJK9k3EBn0JqdU,10317
|
|
476
|
+
nvidia_nat-1.3.0a20251109.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
477
|
+
nvidia_nat-1.3.0a20251109.dist-info/entry_points.txt,sha256=4jCqjyETMpyoWbCBf4GalZU8I_wbstpzwQNezdAVbbo,698
|
|
478
|
+
nvidia_nat-1.3.0a20251109.dist-info/top_level.txt,sha256=lgJWLkigiVZuZ_O1nxVnD_ziYBwgpE2OStdaCduMEGc,8
|
|
479
|
+
nvidia_nat-1.3.0a20251109.dist-info/RECORD,,
|
|
File without changes
|
{nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{nvidia_nat-1.3.0a20251107.dist-info → nvidia_nat-1.3.0a20251109.dist-info}/licenses/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|