MCPcopy
hub / github.com/microsoft/agent-lightning / queue_task

Method queue_task

agentlightning/server.py:349–359  ·  view source on GitHub ↗

Add a task to the queue for a client to process.

(
        self,
        sample: Any,
        mode: Literal["train", "val", "test"] | None = None,
        resources_id: str | None = None,
        metadata: Dict[str, Any] | None = None,
    )

Source from the content-addressed store, hash-verified

347 await self._uvicorn_server.serve()
348
349 async def queue_task(
350 self,
351 sample: Any,
352 mode: Literal["train", "val", "test"] | None = None,
353 resources_id: str | None = None,
354 metadata: Dict[str, Any] | None = None,
355 ) -> str:
356 """Add a task to the queue for a client to process."""
357 if not self._store:
358 raise RuntimeError("Store not initialized. The server may not be running.")
359 return await self._store.add_task(sample, mode=mode, resources_id=resources_id, metadata=metadata)
360
361 async def update_resources(self, resources: NamedResources) -> str:
362 """Publish a new resource bundle and return its generated identifier."""

Callers 5

example_apoFunction · 0.95
_async_set_upMethod · 0.80
test_full_lifecycle_syncFunction · 0.80

Calls 1

add_taskMethod · 0.80

Tested by 3

test_full_lifecycle_syncFunction · 0.64