Skip to content
getgeolens.com

Chat Stream Endpoint

POST
/ai/chat/stream/
curl --request POST \
--url https://example.com/api/ai/chat/stream/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "message": "example", "map_id": "example", "layers": [ { "id": "example", "name": "example", "dataset_id": "example", "dataset_table_name": "example", "geometry_type": "example", "layer_type": "example", "column_info": [ {} ], "dataset_title": "example", "feature_count": 1, "sample_values": {}, "visible": true, "filter": {}, "label_config": {}, "style_config": {}, "paint": {} } ], "language": "example", "history": [ { "role": "user", "content": "example" } ] }'

Chat-based map editing with server-sent event streaming.

Media type application/json
ChatRequest
object
message
required
Message
string
>= 1 characters <= 2000 characters
map_id
required
Map Id
string
layers
required
Layers
Array<object>
ChatMapLayer

Layer state sent from frontend for chat context.

object
id
required
Id
string
name
required
Name
string
dataset_id
required
Dataset Id
string
dataset_table_name
required
Dataset Table Name
string
geometry_type
Any of:
string
layer_type
Any of:
string
column_info
Any of:
Array<object>
object
key
additional properties
any
dataset_title
Any of:
string
feature_count
Any of:
integer
sample_values
Any of:
object
key
additional properties
any
visible
Visible
boolean
default: true
filter
Any of:
Array
label_config
Any of:
object
key
additional properties
any
style_config
Any of:
object
key
additional properties
any
paint
Any of:
object
key
additional properties
any
language
Any of:
string
history
History
Array<object>
<= 20 items
ChatHistoryMessage

A single message in the conversation history.

object
role
required
Role
string
Allowed values: user assistant
content
required
Content
string

Server-Sent Events stream

Example generated
example

Bad request — invalid query parameters or payload

Unauthorized — missing or invalid credentials

Forbidden — caller lacks access to this resource

Not found

Validation error

Internal server error