Aller directement au contenu principal

openhands.server.session.agent_session

AgentSession Objects

class AgentSession()

Represents a session with an Agent

Attributes:

  • controller - The AgentController instance for controlling the agent.

__init__

def __init__(sid: str, file_store: FileStore)

Initializes a new instance of the Session class

Arguments:

  • sid: The session ID
  • file_store: Instance of the FileStore

start

async def start(runtime_name: str,
config: AppConfig,
agent: Agent,
max_iterations: int,
max_budget_per_task: float | None = None,
agent_to_llm_config: dict[str, LLMConfig] | None = None,
agent_configs: dict[str, AgentConfig] | None = None,
status_message_callback: Optional[Callable] = None)

Starts the Agent session

Arguments:

  • runtime_name: The name of the runtime associated with the session
  • config:
  • agent:
  • max_iterations:
  • max_budget_per_task:
  • agent_to_llm_config:
  • agent_configs:

close

async def close()

Closes the Agent session