AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.engine.sync_dispatch Namespace Reference

Functions

dict[str, Any]|None _resolve_card (str tool_name, Any result, dict[str, Any]|None card)
Any _result_content (str tool_name, Any result, dict[str, Any]|None card)
str _track (*, str tool_name, str|None command, dict[str, Any] args, Any result, dict[str, Any]|None card, int duration_ms, bool exit_ok)
None _emit_tracked (str name, str record_id)
None track_cli_result (str tool_name, dict[str, Any] args, Any result, *, dict[str, Any]|None card=None, str|None command=None, str|None label=None)
dict[str, Any] dispatch_with_tracking (str name, dict[str, Any] args, dict[str, Any] ctx, *, str|None command=None)
dict[str, Any] _finish_tracked_dispatch (str name, dict[str, Any] args, dict[str, Any] ctx, Any result, *, str|None command=None)
dict[str, Any] dispatch_model_free (str name, dict[str, Any] args, dict[str, Any] ctx, *, str|None command=None)
dict[str, Any] run_dispatch (str name, dict[str, Any] args, dict[str, Any] ctx, *, str|None command=None, str|None ensure_model=None, float timeout=1800)
None sync_cli_result (dict[str, Any] ctx, str tool_name, dict[str, Any] args, Any result, *, dict[str, Any]|None card=None, str|None command=None)
dict[str, str] session_ctx_from_state ()
dict[str, str] require_session_ctx (*, str label)
None require_active_session (dict[str, Any] ctx, *, str label="this command")
bool push_tool_pair (**Any kwargs)

Variables

dict[str, Any] dispatch_with_sync = dispatch_with_tracking

Function Documentation

◆ _emit_tracked()

None _emit_tracked ( str name,
str record_id )
protected

◆ _finish_tracked_dispatch()

dict[str, Any] _finish_tracked_dispatch ( str name,
dict[str, Any] args,
dict[str, Any] ctx,
Any result,
* ,
str | None command = None )
protected

Definition at line 133 of file sync_dispatch.py.

References _emit_tracked(), _resolve_card(), and _track().

Referenced by dispatch_model_free(), and run_dispatch().

◆ _resolve_card()

dict[str, Any] | None _resolve_card ( str tool_name,
Any result,
dict[str, Any] | None card )
protected

◆ _result_content()

Any _result_content ( str tool_name,
Any result,
dict[str, Any] | None card )
protected

Definition at line 36 of file sync_dispatch.py.

Referenced by _track().

◆ _track()

str _track ( * ,
str tool_name,
str | None command,
dict[str, Any] args,
Any result,
dict[str, Any] | None card,
int duration_ms,
bool exit_ok )
protected

◆ dispatch_model_free()

dict[str, Any] dispatch_model_free ( str name,
dict[str, Any] args,
dict[str, Any] ctx,
* ,
str | None command = None )
Run catalog/session tools that never touch GPU weights.

Definition at line 159 of file sync_dispatch.py.

References _finish_tracked_dispatch().

Referenced by run_dispatch().

◆ dispatch_with_tracking()

dict[str, Any] dispatch_with_tracking ( str name,
dict[str, Any] args,
dict[str, Any] ctx,
* ,
str | None command = None )

Definition at line 99 of file sync_dispatch.py.

References _emit_tracked(), _resolve_card(), and _track().

◆ push_tool_pair()

bool push_tool_pair ( **Any kwargs)
Legacy :  track locally instead of pushing to cloud.

Definition at line 315 of file sync_dispatch.py.

References track_cli_result().

◆ require_active_session()

None require_active_session ( dict[str, Any] ctx,
* ,
str label = "this command" )
No-op for compute :  kept so old imports don't break.

Definition at line 310 of file sync_dispatch.py.

◆ require_session_ctx()

dict[str, str] require_session_ctx ( * ,
str label )
Only required for aquin chat agent API :  not for compute.

Definition at line 288 of file sync_dispatch.py.

References session_ctx_from_state().

◆ run_dispatch()

dict[str, Any] run_dispatch ( str name,
dict[str, Any] args,
dict[str, Any] ctx,
* ,
str | None command = None,
str | None ensure_model = None,
float timeout = 1800 )
Run a tool through the persistent model daemon when it is available, else load
in-process and run locally. Either way the result is tracked locally so the
user sees the [tracked] line with their own context.

Definition at line 185 of file sync_dispatch.py.

References _finish_tracked_dispatch(), and dispatch_model_free().

◆ session_ctx_from_state()

dict[str, str] session_ctx_from_state ( )
Auth + base URL from engine state (optional session id if present).

Definition at line 273 of file sync_dispatch.py.

Referenced by require_session_ctx().

◆ sync_cli_result()

None sync_cli_result ( dict[str, Any] ctx,
str tool_name,
dict[str, Any] args,
Any result,
* ,
dict[str, Any] | None card = None,
str | None command = None )
Track a catalog/sync CLI result. ``ctx`` is accepted for API compat (session sync is optional).

Definition at line 255 of file sync_dispatch.py.

References track_cli_result().

◆ track_cli_result()

None track_cli_result ( str tool_name,
dict[str, Any] args,
Any result,
* ,
dict[str, Any] | None card = None,
str | None command = None,
str | None label = None )
Track a standalone CLI command result locally.

Definition at line 73 of file sync_dispatch.py.

References _emit_tracked(), _resolve_card(), and _track().

Referenced by push_tool_pair(), and sync_cli_result().

Variable Documentation

◆ dispatch_with_sync

dict[str, Any] aquin.engine.sync_dispatch.dispatch_with_sync = dispatch_with_tracking

Definition at line 252 of file sync_dispatch.py.