Αναφορά API / AI utilities
AI utilities
Τα endpoints της ομάδας AI utilities του Voiceland AI API, με παραμέτρους, σχήματα και παραδείγματα curl.
Τελευταία ενημέρωση:
Οι περιγραφές των endpoints και των πεδίων εμφανίζονται στα αγγλικά, όπως ακριβώς τις δημοσιεύει το API. Είναι επιλογή μας, ώστε να διαβάζετε εδώ ό,τι θα δείτε και στις αποκρίσεις.
POST /v1/chat#
Ask a question over a transcript. Answers a question about a transcript. freeform returns an answer; structured also returns matched + a summary.
Σώμα αιτήματος
application/json Σχήμα: ChatRequest
| Πεδίο | Τύπος | Απαιτείται | Περιγραφή |
|---|---|---|---|
history |
array of ChatMessage |
Optional prior turns for multi-turn context. | |
max_tokens |
integer | Optional cap on the response length. | |
mode |
string | Ναι | freeform (default) returns an answer; structured also returns matched + a summary. |
model |
string | Optional model override from the account catalog. | |
question |
string | Ναι | The question to answer about the transcript. |
transcript |
string | Ναι | The conversation text to reason over. |
Αποκρίσεις
| Κωδικός | Περιγραφή |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Παράδειγμα αιτήματος
curl -X POST "https://api.voiceland.ai/v1/chat" \
-H "Authorization: Bearer VL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "structured",
"question": "What order number?",
"transcript": "caller: cancel order 4471\nagent: done."
}'
Η επιτυχής απόκριση επιστρέφει ένα StructuredResponse.
Παράδειγμα απόκρισης
{
"answer": "4471",
"matched": true,
"summary": "Caller cancelled order 4471."
}
POST /v1/transcribe#
Transcribe audio. Transcribes an uploaded audio file. Send multipart/form-data with a file part; optional language, model, and speaker_diarization fields.
Σώμα αιτήματος
multipart/form-data
Αποκρίσεις
| Κωδικός | Περιγραφή |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Παράδειγμα αιτήματος
curl -X POST "https://api.voiceland.ai/v1/transcribe" \
-H "Authorization: Bearer VL_API_KEY" \
-F "file=@audio.wav" \
-F "language=el" \
-F "speaker_diarization=true"
Παράδειγμα απόκρισης
{
"audio_duration_seconds": 12.3,
"language": "el",
"text": "Καλησπέρα…",
"transcription_id": "…"
}
Σχήματα#
ChatMessage#
| Πεδίο | Τύπος | Απαιτείται | Περιγραφή |
|---|---|---|---|
content |
string | Ναι | |
role |
string | Ναι |
ChatRequest#
Ask a question over a transcript.
| Πεδίο | Τύπος | Απαιτείται | Περιγραφή |
|---|---|---|---|
history |
array of ChatMessage |
Optional prior turns for multi-turn context. | |
max_tokens |
integer | Optional cap on the response length. | |
mode |
string | Ναι | freeform (default) returns an answer; structured also returns matched + a summary. |
model |
string | Optional model override from the account catalog. | |
question |
string | Ναι | The question to answer about the transcript. |
transcript |
string | Ναι | The conversation text to reason over. |
ChatUsage#
| Πεδίο | Τύπος | Απαιτείται | Περιγραφή |
|---|---|---|---|
completion_tokens |
integer | Ναι | |
prompt_tokens |
integer | Ναι | |
total_tokens |
integer | Ναι |
Error#
Error envelope returned for non-2xx responses.
| Πεδίο | Τύπος | Απαιτείται | Περιγραφή |
|---|---|---|---|
error |
object | Ναι |
StructuredResponse#
| Πεδίο | Τύπος | Απαιτείται | Περιγραφή |
|---|---|---|---|
answer |
string | Ναι | The extracted answer. |
matched |
boolean | Ναι | Whether the transcript contained an answer. |
model |
string | Ναι | |
summary |
string | Ναι | A short summary of the transcript. |
usage |
ChatUsage |
Ναι |