Messages
Envoyer un message
Réservez un turn idempotent. Conservez le turn_id et interrogez son statut, ou utilisez le WebSocket pour recevoir les événements en temps réel.
POST
/
api
/
partners
/
v1
/
conversations
/
{conversation_id}
/
messages
Envoyer un message
curl --request POST \
--url https://gpt-de-babi.perfproai.com/api/partners/v1/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_message_id": "msg_001",
"message": "Où renouveler mon passeport à Abidjan ?"
}
'import requests
url = "https://gpt-de-babi.perfproai.com/api/partners/v1/conversations/{conversation_id}/messages"
payload = {
"client_message_id": "msg_001",
"message": "Où renouveler mon passeport à Abidjan ?"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_message_id: 'msg_001',
message: 'Où renouveler mon passeport à Abidjan ?'
})
};
fetch('https://gpt-de-babi.perfproai.com/api/partners/v1/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message": {
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"answer": "<string>",
"response_type": "<string>",
"cards": [
{}
],
"visualizations": [
{}
],
"sources": [
{
"title": "<string>",
"url": "<string>"
}
],
"suggested_actions": [
{}
],
"metadata": {
"latency_ms": 123
}
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message": {
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"answer": "<string>",
"response_type": "<string>",
"cards": [
{}
],
"visualizations": [
{}
],
"sources": [
{
"title": "<string>",
"url": "<string>"
}
],
"suggested_actions": [
{}
],
"metadata": {
"latency_ms": 123
}
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
Token utilisateur à courte durée de vie retourné par /tokens.
Path Parameters
Body
application/json
Response
Le turn idempotent était déjà terminé
⌘I
Envoyer un message
curl --request POST \
--url https://gpt-de-babi.perfproai.com/api/partners/v1/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_message_id": "msg_001",
"message": "Où renouveler mon passeport à Abidjan ?"
}
'import requests
url = "https://gpt-de-babi.perfproai.com/api/partners/v1/conversations/{conversation_id}/messages"
payload = {
"client_message_id": "msg_001",
"message": "Où renouveler mon passeport à Abidjan ?"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_message_id: 'msg_001',
message: 'Où renouveler mon passeport à Abidjan ?'
})
};
fetch('https://gpt-de-babi.perfproai.com/api/partners/v1/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message": {
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"answer": "<string>",
"response_type": "<string>",
"cards": [
{}
],
"visualizations": [
{}
],
"sources": [
{
"title": "<string>",
"url": "<string>"
}
],
"suggested_actions": [
{}
],
"metadata": {
"latency_ms": 123
}
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"message": {
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"answer": "<string>",
"response_type": "<string>",
"cards": [
{}
],
"visualizations": [
{}
],
"sources": [
{
"title": "<string>",
"url": "<string>"
}
],
"suggested_actions": [
{}
],
"metadata": {
"latency_ms": 123
}
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}