Skip to main content

Build Vertex Stream

Build a vertex instead of the entire graph.

This function is responsible for building a single vertex instead of the entire graph. It takes the flow_id and vertex_id as required parameters, and an optional session_id. It also depends on the ChatService and SessionService services.

If session_id is not provided, it retrieves the graph from the cache using the chat_service. If session_id is provided, it loads the session data using the session_service.

Once the graph is obtained, it retrieves the specified vertex using the vertex_id. If the vertex does not support streaming, an error is raised. If the vertex has a built result, it sends the result as a chunk. If the vertex is not frozen or not built, it streams the vertex data. If the vertex has a result, it sends the result as a chunk. If none of the above conditions are met, an error is raised.

If any exception occurs during the process, an error message is sent. Finally, the stream is closed.

Returns: A StreamingResponse object with the streamed vertex data in text/event-stream format.

Raises: HTTPException: If an error occurs while building the vertex.

Path Parameters
flow_id uuid REQUIRED
vertex_id Vertex Id REQUIRED
Responses
200

Successful Response

422

Validation Error

Schema OPTIONAL
detail object[] OPTIONAL
loc undefined[]
msg Message
type Error Type

Hi, how can I help you?