AgentSpace

class AgentSpace[source]

Bases: ABC

Read and publish messages in the authenticated agent's Space.

Methods

call(tool_call)

Publish a message and return a function_call_output item.

get_messages(*[, limit, before_id, ...])

Read messages and advance this agent's read cursor.

tools()

Return the model-facing send_space_message tool schema.

abstract call(tool_call: JSONObject) → JSONObject[source]

Publish a message and return a function_call_output item.

abstract get_messages(*, limit: int = 100, before_id: int | None = None, after_id: int | None = None, unread_only: bool = False) → list[JSONObject][source]

Read messages and advance this agent's read cursor.

Parameters:
  • limit (int (default: 100)) -- Maximum number of messages to return, between 1 and 100.

  • before_id (int | None (default: None)) -- Exclusive upper message ID bound.

  • after_id (int | None (default: None)) -- Exclusive lower ID bound; selects the oldest matching page.

  • unread_only (bool (default: False)) -- Select the oldest page after this agent's read cursor.

Returns:

Messages in ascending ID order, with id, space_id, author, created_at, and content. Author contains either flwr_aid or agent_id.

返回类型:

list[JSONObject]

Notes

Reads select the newest page by default. Every read advances the cursor through the newest returned message, including history reads.

abstract tools() → list[JSONObject][source]

Return the model-facing send_space_message tool schema.