runtime.go

Overview

The runtime.go file defines the RuntimeAPIRouter, a component responsible for routing HTTP requests related to the Runtime API endpoints. This router maps incoming HTTP requests for running AI agents to their respective handler functions implemented in the RuntimeAPIController. It provides two primary endpoints:

The router encapsulates the runtime controller and exposes the routes with HTTP methods and URL patterns. It integrates into the overall REST API routing infrastructure, ensuring that runtime-related API calls are correctly dispatched to controller logic.

This file is part of the broader Router Setup and REST API and Web Launchers modules, which organize API endpoints and HTTP routing.


Detailed Components

Type: RuntimeAPIRouter

type RuntimeAPIRouter struct {
	runtimeController *controllers.RuntimeAPIController
}

Function: NewRuntimeAPIRouter

func NewRuntimeAPIRouter(controller *controllers.RuntimeAPIController) *RuntimeAPIRouter

Method: Routes

func (r *RuntimeAPIRouter) Routes() Routes

Implementation Details


Interaction with Other Components


Visual Diagram: RuntimeAPIRouter Structure

classDiagram
class RuntimeAPIRouter {
-runtimeController: RuntimeAPIController
+Routes() Routes
}
class RuntimeAPIController {
+RunHandler()
+RunSSEHandler()
}
RuntimeAPIRouter "1" *-- "1" RuntimeAPIController

Summary of Routing Logic in runtime.go


Relevant Links and References


This file plays a critical role in exposing the Runtime API endpoints for invoking AI agent execution, enabling external clients to interact with the system programmatically through HTTP.