Skip to content

API Reference parrot.tools.executors.qworker

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.executors.qworker

View source

Qworker-backed remote tool executor.

Two transports are supported, picked at construction:

  • transport="http" (default) — submits the envelope to a Qworker HTTP endpoint via Qclient.run() when the optional qworker / qclient package is installed, otherwise via an aiohttp client that follows the same conventions used elsewhere in the repo (parrot/integrations/telegram/auth.py and parrot/interfaces/flowtask.py).
  • transport="redis" — publishes the envelope to a Redis Stream (parrot:tool_tasks) and blocks reading from a result stream (parrot:tool_results). Mirrors the pattern in parrot/services/client.py.

The two paths are intentionally implemented in one class because they share the envelope, the timeout semantics, and the ToolResult parsing — only the wire details differ.

Alias AbstractToolExecutor

Re-exported from parrot.tools.executors.abstract.AbstractToolExecutor.

Class QworkerToolExecutor

Dispatch tool execution to the Qworker service.

Parameter Type Default Description
transport Transport 'http' "http" for the Qclient HTTP API, "redis" for Redis Streams. Defaults to "http".
endpoint Optional[str] None HTTP base URL for Qworker (e.g. http://qworker:9000). Required when transport="http" unless :data:parrot.conf.QWORKER_URL is set.
api_token Optional[str] None Optional bearer token. Falls back to :data:parrot.conf.QWORKER_API_TOKEN.
redis_url Optional[str] None Redis DSN for the streams transport. Falls back to :data:parrot.conf.REDIS_SERVICES_URL.
request_stream str 'parrot:tool_tasks' Redis stream name jobs are posted to. Defaults to parrot:tool_tasks.
result_stream str 'parrot:tool_results' Redis stream name results are read from. Defaults to parrot:tool_results.
qclient Any None Pre-built Qclient instance — useful for tests and for sharing a connection pool. When None, an instance is created lazily from endpoint + api_token.
verify_ssl Optional[bool] None Whether aiohttp should verify TLS certificates. Honours the NAVIGATOR_SSL_VERIFY env var by default.

Attributes:

Attribute Type Description
transport Transport

Method QworkerToolExecutor.execute

execute(envelope: ToolExecutionEnvelope) -> 'ToolResult'

Parameter Type Default Description
envelope ToolExecutionEnvelope

Returns: 'ToolResult'

Method QworkerToolExecutor.close

close() -> None

Alias ToolExecutionEnvelope

Re-exported from parrot.tools.executors.abstract.ToolExecutionEnvelope.

Alias ToolResult

Re-exported from parrot.tools.abstract.ToolResult.

Attribute Transport

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally