TsgcHTTP_API_OpenAI › Methods › ModifyAssistant
Updates an existing Assistant with new model, instructions, tools or metadata
function ModifyAssistant(const aAssistantId: string; const aRequest: TsgcOpenAIClass_Request_Assistant) : TsgcOpenAIClass_Assistant;
| Name | Type | Description |
|---|---|---|
aAssistantId | const string | The identifier of the Assistant to modify. |
aRequest | const TsgcOpenAIClass_Request_Assistant | The fields to update (model, name, instructions, tools, tool resources, metadata). |
The updated Assistant object reflecting the new configuration (TsgcOpenAIClass_Assistant)
Calls POST /v1/assistants/{assistant_id} to update the specified Assistant in place. Only the fields populated in the request will be changed; omitted fields keep their previous values. Returns the full updated Assistant definition.
var oRequest: TsgcOpenAIClass_Request_Assistant;
begin
oRequest := TsgcOpenAIClass_Request_Assistant.Create;
try
oRequest.Instructions := 'You are an expert algebra tutor.';
oAPI.ModifyAssistant('asst_abc123', oRequest);
finally
oRequest.Free;
end;
end;