encord-agents
to define the logic for the “Editor Agent [custom API]” section of the diagram. You are responsible for programmatically determining what happens when your custom API receives a project_hash
, data_hash
, and potentially a frame
number.
We help with two different ways of building such Custom APIs:
Google run functions
which is Google’s way of building cloud functions.encord-agents
library takes a lot of inspiration from [FastAPI]fastapi. Specifically, we have adopted the idea of [dependency injections]fastapi-dependency-injection from that library. While our injection scheme is not as sophisticated, it should feel familiar.EditorAgentPayload
, which is crucial for defining and implementing editor agents, whether you utilize the library’s built-in functionalities or create your own custom implementation.
Schema:
FrameData
. It’s important to note the objectHashes
field, which is defined as string[]
. This indicates that the field can either be absent from the payload or, if present, will contain an array of strings representing object hashes.
Testing Your Agent with a Test Payload:
When registering your editor agent within the platform at the Editor Agents interface, you have the capability to test its functionality using a sample payload.
To facilitate secure testing, the platform employs the following mechanisms:
X-Encord-Editor-Agent
. Agents receiving this header are expected to respond appropriately for testing purposes.AuthorisationError
handler. If your agent encounters any authorization issues, such as attempting to access a project it does not have permission for, the platform generates appropriate error responses.
Specifically, in the case of an authorization failure with the Encord platform, the body of the error response includes a message
field with the following structure:
message
is then displayed within the platform’s user interface, offering intuitive guidance to users regarding any access-related problems with the agent.