Перейти к основному содержимому

Проксирование запросов к OpenAI Assistants API

Подробнее об Assistants API читайте в документации OpenAI.

Ассистенты

Создать ассистента для интерпретации кода

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl --location "${JAY_GUARD_BASE_URL}/proxy/openai/v1/assistants" \
-H 'Content-Type: application/json' \
-H 'OpenAI-Beta: assistants=v2' \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
--data-raw '{
"instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
"name": "Math Tutor",
"tools": [{"type": "code_interpreter"}],
"model": "gpt-4o"
}'

Получить список ассистентов

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/assistants?order=desc&limit=20" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Получить ассистента

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/assistants/asst_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Создать ассистента для работы с файлами

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl --location "${JAY_GUARD_BASE_URL}/proxy/openai/v1/assistants" \
-H 'Content-Type: application/json' \
-H 'OpenAI-Beta: assistants=v2' \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
--data-raw '{
"instructions": "You are a personal math tutor. Use files to answer the question.",
"tools": [{"type": "file_search"}],
"tool_resources": {"file_search": {"vector_store_ids": ["vs_123"]}},
"model": "gpt-4o"
}'

Изменить ассистента для интерпретации кода

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl --location "${JAY_GUARD_BASE_URL}/proxy/openai/v1/assistants/asst_abc123" \
-H 'Content-Type: application/json' \
-H 'OpenAI-Beta: assistants=v2' \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
--data-raw '{
"instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.",
"tools": [{"type": "file_search"}],
"model": "gpt-4o"
}'

Удалить ассистента

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/assistants/asst_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-X DELETE

Threads

Создать thread

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-d ''

Создать thread с сообщениями

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl --location "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads" \
-H 'Content-Type: application/json' \
-H 'OpenAI-Beta: assistants=v2' \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
--data-raw '{
"messages": [{
"role": "user",
"content": "Hello, what is AI?"
}, {
"role": "user",
"content": "How does AI work? Explain it in simple terms."
}]
}'

Создать стандартный thread и run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_abc123",
"thread": {
"messages": [
{"role": "user", "content": "Explain deep learning to a 5 year old."}
]
}
}'

Создать потоковый thread и run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_123",
"thread": {
"messages": [
{"role": "user", "content": "Hello"}
]
},
"stream": true
}'

Создать потоковый thread с функциями и run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_abc123",
"thread": {
"messages": [
{"role": "user", "content": "What is the weather like in San Francisco?"}
]
},
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
],
"stream": true
}'

Получить thread

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Изменить thread

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"metadata": {
"modified": "true",
"user": "abc123"
}
}'

Удалить thread

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-X DELETE

Сообщения

Создать сообщение

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/messages" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"role": "user",
"content": "How does AI work? Explain it in simple terms."
}'

Получить список сообщений

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/messages" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Получить сообщение

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/messages/msg_abc123" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Изменить сообщение

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/messages/msg_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"metadata": {
"modified": "true",
"user": "abc123"
}
}'

Удалить сообщение

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl -X DELETE "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/messages/msg_abc123" \
-H "Content-Type: application/json" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Runs

Создать стандартный run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_abc123"
}'

Создать потоковый run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_123/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_123",
"stream": true
}'

Создать потоковый run с функциями

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_abc123",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
],
"stream": true
}'

Создать стандартный thread и run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_abc123",
"thread": {
"messages": [
{"role": "user", "content": "Explain deep learning to a 5 year old."}
]
}
}'

Создать потоковый thread и run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_123",
"thread": {
"messages": [
{"role": "user", "content": "Hello"}
]
},
"stream": true
}'

Создать потоковый thread с функциями и run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"assistant_id": "asst_abc123",
"thread": {
"messages": [
{"role": "user", "content": "What is the weather like in San Francisco?"}
]
},
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
],
"stream": true
}'

Получить список run-ов

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Получить run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs/run_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2"

Изменить run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs/run_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"metadata": {
"user_id": "user_abc123"
}
}'

Отправить стандартный вывод инструментов на run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_123/runs/run_123/submit_tool_outputs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"tool_outputs": [
{
"tool_call_id": "call_001",
"output": "70 degrees and sunny."
}
]
}'

Создать потоковый вывод инструментов на run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_123/runs/run_123/submit_tool_outputs" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"tool_outputs": [
{
"tool_call_id": "call_001",
"output": "70 degrees and sunny."
}
],
"stream": true
}'

Отменить run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs/run_abc123/cancel" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "OpenAI-Beta: assistants=v2" \
-X POST

Получить список шагов run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs/run_abc123/steps" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Получить шаги run

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/threads/thread_abc123/runs/run_abc123/steps/step_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Векторные хранилища

Создать векторное хранилище

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"\
-d '{
"name": "Support FAQ"
}'

Получить список векторных хранилищ

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Получить векторное хранилище

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Изменить векторное хранилище

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"\
-d '{
"name": "Support FAQ"
}'

Удалить векторное хранилище

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-X DELETE

Создать файл векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"file_id": "file-abc123"
}'

Получить список файлов векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GУARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Получить файл векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files/file-abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Удалить файл векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files/file-abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-X DELETE

Создать пакет файлов векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/file_batches" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"file_ids": ["file-abc123", "file-abc456"]
}'

Получить пакет файлов векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"

Отменить пакет файлов векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GУARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-X POST

Получить список файлов в пакетах векторного хранилища

export JAY_GUARD_BASE_URL="https://app.jayguard.com"
export DATA_GUARD_API_KEY="dataguard_api_key"
export OPENAI_API_KEY="openai_api_key"

curl "${JAY_GUARD_BASE_URL}/proxy/openai/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files" \
-H "X-DATA-GUARD-API-KEY: ${DATA_GUARD_API_KEY}" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"