Stream Chat with Knowledge Graph (AI SDK Compatible)
POST
/api/v1/projects/{projectId}/chat/stream
const url = 'https://api.yggy.tech/api/v1/projects/example/chat/stream';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"input":[{"id":"example","role":"user","parts":["example"],"metadata":{"commandId":"search"}}],"options":{"tier":"fast","conversationId":"example","userId":"example","chatId":"example","projectId":"example","graphContext":{"nodes":[{"id":"example","label":"example","type":"example"}],"edges":[{"source":"example","target":"example","label":"example"}]},"roomContext":{"roomId":"example","roomTitle":"example","boardId":"example","boardTitle":"example","title":"example"},"seedMode":"first-run"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.yggy.tech/api/v1/projects/example/chat/stream \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "input": [ { "id": "example", "role": "user", "parts": [ "example" ], "metadata": { "commandId": "search" } } ], "options": { "tier": "fast", "conversationId": "example", "userId": "example", "chatId": "example", "projectId": "example", "graphContext": { "nodes": [ { "id": "example", "label": "example", "type": "example" } ], "edges": [ { "source": "example", "target": "example", "label": "example" } ] }, "roomContext": { "roomId": "example", "roomTitle": "example", "boardId": "example", "boardTitle": "example", "title": "example" }, "seedMode": "first-run" } }'Stream chat responses from the knowledge graph agent.
This endpoint returns Server-Sent Events (SSE) compatible with the Vercel AI SDK useChat hook.
Use this endpoint for real-time streaming responses in the frontend.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” projectId
required
string
Request Body
Section titled “Request Body ” Media type application/json
object
input
required
Any of:
string
Array<object>
object
id
required
string
role
required
string
parts
Array
metadata
object
commandId
string
options
object
tier
string
conversationId
string
userId
string
chatId
string
projectId
string
graphContext
object
nodes
Array<object>
object
id
required
string
label
required
string
type
required
string
edges
Array<object>
object
source
required
string
target
required
string
label
string
roomContext
object
roomId
required
string
roomTitle
string
boardId
string
boardTitle
string
title
string
seedMode
string
Responses
Section titled “ Responses ”SSE stream of chat chunks
Media type text/event-stream
Unauthorized
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
string
Example
{ "success": false}Project access denied
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
string
Example
{ "success": false}Internal server error
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
string
Example
{ "success": false}