Skip to main content

Create assistant

Creates an assistant based on the model and instruction

Function CreateAssistant(Val URL, Val Token, Val Model, Val Name = "", Val Instruction = "", Val AdditionalParameters = "", Val AdditionalHeaders = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringOpenAI server URL
Token--tokenStringOpenAI authorization token
Model--modelStringModels name
Name--nameStringAssistant name
Instruction--instStringSystem instruction for the assistant
AdditionalParameters--optionsStructure Of KeyAndValueAdditional request parameters, if necessary
AdditionalHeaders--headersMap Of KeyAndValueAdditional request headers, if necessary

Returns: Map Of KeyAndValue - Processing result


tip

Method at API documentation: Create assistant


1C:Enterprise/OneScript code example
    URL   = "https://api.athenaeum.digital:1122/";
Token = "sk-or-vv-c5884ebe9f13fb143194bb07ecb...";

Instruction = "You are a personal math tutor. When asked a question, write and run Python code to answer the question.";
Model = "smolvlm-256m-instruct";
Name = "Math tutor";

Result = OPI_OpenAI.CreateAssistant(URL, Token, Model, Name, Instruction);
    oint openai CreateAssistant \
--url "https://api.athenaeum.digital:1122/" \
--token "***" \
--model "smolvlm-256m-instruct" \
--name "Math tutor" \
--inst "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
Result
{
"id": "asst_19",
"object": "assistant",
"created": 1750098851,
"model": "smolvlm-256m-instruct",
"name": "Math tutor",
"instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
}