Skip to content
getgeolens.com

Dataset Chat Stream Endpoint

POST
/ai/chat/dataset/stream/
curl --request POST \
--url https://example.com/ai/chat/dataset/stream/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dataset_id": "example", "history": [ { "content": "example", "role": "user" } ], "language": "example", "message": "example" }'

Dataset-scoped AI chat: ask questions about a single dataset’s data.

Read-only by construction — can_edit=False selects the query_data-only tool set, and a dataset-framed system prompt replaces the map-editing one. Reuses the whole map-chat streaming pipeline (SQL generation, sandbox validation, RBAC table allowlist, token budgeting) with one synthetic server-built layer.

Media type application/json
DatasetChatRequest

Dataset-scoped chat: no map, no client-supplied layer state.

The server resolves ALL dataset context (table name, columns, samples) authoritatively from the DB — the client only names the dataset.

object
dataset_id
required
Dataset Id
string
history
History
Array<object>
<= 20 items
ChatHistoryMessage

A single message in the conversation history.

object
content
required
Content
string
role
required
Role
string
Allowed values: user assistant
language
Any of:
string
message
required
Message
string
>= 1 characters <= 2000 characters

Server-Sent Events stream

Media type text/event-stream

UTF-8 server-sent event frames. Each data field contains one JSON event payload described by x-geolens-event-schema.

string
Example
event: token
data: {"type":"token","text":"Updated "}
event: actions
data: {"type":"actions","actions":[]}
event: done
data: {"type":"done","explanation":"Updated the map"}

Bad request — invalid query parameters or payload

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}