Group Chat
Base URL: https://app.neuroflash.com/api/digital-twin-service
Ask multiple digital twins the same question and get aggregated opinions with individual responses.
Chat With Twin Group
POST
/v1/workspaces/{workspace_id}/twin-group-chat-completionsPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_id | string | Yes |
Request Body
FieldTypeRequiredDescription
twinIdsarray<string>YesList of twin IDs to query (max 20)messagesarray<object>YesConversation history (at least one message required, last message must be from user)
rolestringYesRole: 'user' or 'assistant'contentstringYesMessage contentattachmentsobjectNoList of file IDs to attach to this message (user messages only)responseFormatobjectNoStructured output format for individual twin responses. If null, uses default schema with 'answer' and 'reason' fields.temperatureobjectNoSampling temperature for response generationrunRarobjectNoEnable Rephrase and Respond for question robustnessuseWebSearchobjectNoWeb search mode: 'never', 'auto', or 'always'useVerbalizedSamplingobjectNoGenerate 5 probability-weighted response options per twin. Mutually exclusive with custom responseFormat.Response
FieldTypeDescription
summarystringLLM-generated summary of all twin responsestwinResponsesobjectDictionary mapping twin IDs to their responsesExample
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/{workspace_id}/twin-group-chat-completions" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"twinIds": [],
"messages": [],
"responseFormat": {},
"temperature": {},
"runRar": {},
"useWebSearch": {},
"useVerbalizedSampling": {}
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/{workspace_id}/twin-group-chat-completions",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"twinIds": [],
"messages": [],
"responseFormat": {},
"temperature": {},
"runRar": {},
"useWebSearch": {},
"useVerbalizedSampling": {}
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/${workspaceId}/twin-group-chat-completions`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"twinIds": [],
"messages": [],
"responseFormat": {},
"temperature": {},
"runRar": {},
"useWebSearch": {},
"useVerbalizedSampling": {}
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"twinIds": []any{},
"messages": []any{},
"responseFormat": map[string]any{},
"temperature": map[string]any{},
"runRar": map[string]any{},
"useWebSearch": map[string]any{},
"useVerbalizedSampling": map[string]any{},
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/"+workspaceID+"/twin-group-chat-completions", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"summary": "string",
"twinResponses": {}
}