Skip to content

API Reference parrot.utils.helpers

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

parrot.utils.helpers

View source

Class RequestContext

RequestContext.

This class is a context manager for handling request-specific data. It is designed to be used with the async with statement to ensure proper setup and teardown of resources.

Parameter Type Default Description
request web.Request None
app Optional[Any] None
llm Optional[Any] None
user_id Union[str, int] None
session_id str None
**kwargs {}

Attributes:

Attribute Type Description
request The incoming web request.
app An optional application context.
llm An optional language model instance.
kwargs Additional keyword arguments for customization.
a2ui_component Optional[str]

Function current_context

Return the RequestContext bound to the current asyncio task, if any.

current_context() -> Optional[RequestContext]

Returns: Optional[RequestContext] — The active RequestContext if called within an AbstractBot.session() block, or None if no session is active for the current asyncio task.

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