Asistentes
Asistentes
Crear nuevo asistente
post/assistants
Crea un nuevo asistente con los detalles proporcionados
- HTTP
- cURL
- JavaScript
- Python
POST /assistants HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 526
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
}
curl -L \
--request POST \
--url '/assistants' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
}'
const response = await fetch('/assistants', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_SECRET_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
})
});
const data = await response.json();
import json
import requests
response = requests.post(
"/assistants",
headers={"Authorization":"Bearer YOUR_SECRET_TOKEN","Content-Type":"application/json"},
data=json.dumps({
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
})
)
data = response.json()
Obtener asistente por ID
get/assistants/{id}
Obtiene los detalles de un asistente existente
- HTTP
- cURL
- JavaScript
- Python
GET /assistants/{id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -L \
--url '/assistants/{id}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Accept: */*'
const response = await fetch('/assistants/{id}', {
method: 'GET',
headers: {
"Authorization": "Bearer YOUR_SECRET_TOKEN",
"Accept": "*/*"
},
});
const data = await response.json();
import requests
response = requests.get(
"/assistants/{id}",
headers={"Authorization":"Bearer YOUR_SECRET_TOKEN","Accept":"*/*"},
)
data = response.json()
Actualiza los detalles de un asistente existente
put/assistants/{id}
Actualiza los detalles de un asistente existente
- HTTP
- cURL
- JavaScript
- Python
PUT /assistants/{id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 526
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
}
curl -L \
--request PUT \
--url '/assistants/{id}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
}'
const response = await fetch('/assistants/{id}', {
method: 'PUT',
headers: {
"Authorization": "Bearer YOUR_SECRET_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
})
});
const data = await response.json();
import json
import requests
response = requests.put(
"/assistants/{id}",
headers={"Authorization":"Bearer YOUR_SECRET_TOKEN","Content-Type":"application/json"},
data=json.dumps({
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"details": {
"id": "asst_zbNeYIuXIUSKVHjJkfRo6ilv",
"name": "assistant",
"description": "text",
"model": "gpt-4",
"instructions": "You are a helpful assistant, do your best to answer question and query",
"temperature": 1,
"top_p": 1,
"tools": [
"function",
"code_interpreter",
"file_search"
],
"tool_resources": {
"ANY_ADDITIONAL_PROPERTY": {}
}
},
"credential": "7db93c02-8d5a-4117-a8f1-3dfb6721b339",
"iconSrc": "/images/assistant.png",
"createdDate": "2024-08-24T14:15:22Z",
"updatedDate": "2024-08-24T14:15:22Z"
})
)
data = response.json()
Eliminar asistente
delete/assistants/{id}
Elimina un asistente por ID
- HTTP
- cURL
- JavaScript
- Python
DELETE /assistants/{id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
curl -L \
--request DELETE \
--url '/assistants/{id}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Accept: */*'
const response = await fetch('/assistants/{id}', {
method: 'DELETE',
headers: {
"Authorization": "Bearer YOUR_SECRET_TOKEN",
"Accept": "*/*"
},
});
const data = await response.json();
import requests
response = requests.delete(
"/assistants/{id}",
headers={"Authorization":"Bearer YOUR_SECRET_TOKEN","Accept":"*/*"},
)
data = response.json()