TsgcHTTP_API_OpenAIMethods › ModifyAssistant

ModifyAssistant Method

Updates an existing Assistant with new model, instructions, tools or metadata

Syntax

function ModifyAssistant(const aAssistantId: string; const aRequest: TsgcOpenAIClass_Request_Assistant) : TsgcOpenAIClass_Assistant;

Parameters

NameTypeDescription
aAssistantIdconst stringThe identifier of the Assistant to modify.
aRequestconst TsgcOpenAIClass_Request_AssistantThe fields to update (model, name, instructions, tools, tool resources, metadata).

Return Value

The updated Assistant object reflecting the new configuration (TsgcOpenAIClass_Assistant)

Remarks

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.

Example

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;

Back to Methods