Originally created by @mingshl in mingshl/opensearch-agent-server#18
Description
Add a synchronous POST /execute endpoint that returns a JSON response (not SSE). This is needed for the ML-Commons remote agent connector, which expects a request-response pattern rather than streaming.
Background
The ML-Commons plugin in OpenSearch can call remote agents via a connector. The connector expects a synchronous HTTP endpoint that returns a complete JSON response.
API Design
POST /execute
Content-Type: application/json
{
"input": "user query",
"context": [...]
}
Response:
{
"output": "agent response text",
"tools_used": [...],
"metadata": {...}
}
Implementation
References
- Current SSE endpoint:
src/server/run_routes.py
Description
Add a synchronous
POST /executeendpoint that returns a JSON response (not SSE). This is needed for the ML-Commons remote agent connector, which expects a request-response pattern rather than streaming.Background
The ML-Commons plugin in OpenSearch can call remote agents via a connector. The connector expects a synchronous HTTP endpoint that returns a complete JSON response.
API Design
Implementation
src/server/(e.g.,execute_routes.py)References
src/server/run_routes.py