Skip to content
getgeolens.com

Chat Endpoint

POST
/ai/chat/
curl --request POST \
--url https://example.com/api/ai/chat/ \
--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: send a message and get back edit actions.

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

Successful Response

Media type application/json
ChatResponse
object
explanation
required
Explanation
string
actions
required
Actions
Array<object>
ChatAction
object
type
required
Type
string
Allowed values: set_filter set_style set_data_driven_style set_label toggle_visibility add_layer remove_layer show_query_result set_opacity
layer_id
Any of:
string
expression
Any of:
Array
paint
Any of:
object
key
additional properties
any
style_config
Any of:
object
key
additional properties
any
label_config
Any of:
object
key
additional properties
any
dataset_id
Any of:
string
visible
Any of:
boolean
opacity
Any of:
number
<= 1
geojson
Any of:
GeoJSONFeatureCollection

A GeoJSON FeatureCollection.

object
type
Type
string
default: FeatureCollection
features
Features
Array<object>
default:
GeoJSONFeature

A single GeoJSON Feature.

object
type
Type
string
default: Feature
Allowed value: Feature
id
required
Id
integer
geometry
Any of:
GeoJSONGeometry

A GeoJSON geometry object (RFC 7946).

object
type
required
Type
string
coordinates
required
Coordinates
Array
properties
required
Properties
object
key
additional properties
any
key
additional properties
any
bbox
Any of:
Array<number>
Example
{
"actions": [
{
"type": "set_filter",
"geojson": {
"type": "FeatureCollection",
"features": []
}
}
]
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}