refactor(tools): move native tools out of NAT - #355
Conversation
Signed-off-by: Devdeep Ray <devdeepr@nvidia.com>
Signed-off-by: Devdeep Ray <devdeepr@nvidia.com>
Signed-off-by: Devdeep Ray <devdeepr@nvidia.com>
|
Reviewed at Blocker
Suggestions
Validation: all 29 focused tests passed and Ruff passed. The additional partial-stream probe exposed the blocker above. |
Signed-off-by: Devdeep Ray <devdeepr@nvidia.com>
|
Addressed in
I intentionally retained Validation: 32 focused tests passed; repository Ruff, targeted Pyright, and the |
Summary
xr-ai-toolspackage and move toolkit-independent native tool code out ofxr-ai-natagents.pyandagent_runner.pywith a smalltool_calling.pyconvenience layer that adapts schemas and handles one model-selected callLiveVisionTooland an independentStreamingVisionToolbuilt on genericAsyncToolStreamingVisionConfigsurface now replaced byStreamingVisionToolWhy
The native tool layer added in #348 and #349 is toolkit-independent and should not live under the NAT package while NAT is being retired. The tools package should not also define an agent runtime: real agents need the native schemas and a consistent way to dispatch their model-produced tool calls, while retaining ownership of prompts, model calls, history, iteration, and concurrency.
Impact
Consumers of the moved surface now import
xr_ai_toolsand depend onxr-ai-tools; unmatched legacy NAT functions remain underxr_ai_nat.tool_definitions(...)adapts native tools toxr-ai-modelsToolDefvalues, andhandle_tool_call(...)invokes exactly oneToolCalland returns a tool-role message plus thereturn_directhint. There is no bundledAgent,AgentRunner, prompt, model loop, or conversation state.Vision is separated by lifecycle:
LiveVisionToolreturns a completeVisionResponse, whileStreamingVisionToolyields typedVisionChunkvalues and has no voice or output-transport dependency. The sample adapts that stream toVoiceSessionlocally.Validation
xr-ai-toolsandxr-ai-natsource and wheel builds: passedtool_calling.pypresentThe repository-wide suite could not complete in this checkout because two unrelated modules fail collection (
stt_serverandopenxr_serviceare not importable from the configured test paths); a follow-up run excluding them also encountered pre-existing async-fixture/plugin failures in integration tests.