Skip to main content

Update AI Agent Configurations

Used to update the AI-specific configurations for an existing agent, such as model parameters, prompt templates, RAG settings, guardrails, tools, and memory configurations.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/agents/update-ai-configurations

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/agents/update-ai-configurations' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"enable_rag": true,
"rag_config": {
"TopK": 5,
"ScoreThreshold": 0.3,
"EmbeddingModel": "text-embedding-ada-002",
"EmbeddingModelProvider": "azure",
"ChunkingStrategy": "recursive",
"EnableQueryEnhancement": true,
"EnableRerank": true,
"DenseWeight": 0.9,
"KeywordWeight": 0.1
},
"llm_config": {
"Provider": "openai",
"ModelName": "gpt-4",
"IsBlocksProvider": true,
"ModelId": "gpt-4-turbo",
"Temperature": 0.7,
"MaxTokens": 2000,
"ModelType": "chat",
"BasePrompt": "You are a helpful assistant",
"BasePromptToken": 50
},
"enable_guardrails": true,
"guardrail": {
"EnablePiiDetection": false,
"EnableInjectionDetection": false,
"EnableKeywordCheck": false,
"EnableCustomRules": false,
"EnablePreValidation": true,
"EnablePostValidation": true,
"BannedKeywords": ["spam", "inappropriate"],
"BannedPatterns": [".*badpattern.*"],
"CustomRules": [
{
"Name": "Rule1",
"Pattern": ".*",
"Severity": "medium",
"AutoBlock": false,
"Message": "Custom rule triggered",
"EnablePre": true,
"EnablePost": true
}
],
"InputRiskThreshold": 0.7,
"OutputRiskThreshold": 0.8
},
"enable_tools": true,
"tool_ids": ["tool_id_1", "tool_id_2"],
"memory_config": {
"LastNConversations": 5,
"EnableSummary": false,
"EnableQuestionSuggestions": false
},
"response_type": "text",
"response_format": "markdown",
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"enable_rag": true,
"rag_config": {
"TopK": 5,
"ScoreThreshold": 0.3,
"EmbeddingModel": "text-embedding-ada-002",
"EmbeddingModelProvider": "azure",
"ChunkingStrategy": "recursive",
"EnableQueryEnhancement": true,
"EnableRerank": true,
"DenseWeight": 0.9,
"KeywordWeight": 0.1
},
"llm_config": {
"Provider": "",
"ModelName": "",
"IsBlocksProvider": true,
"ModelId": "string",
"Temperature": 0.7,
"MaxTokens": 0,
"ModelType": "chat",
"BasePrompt": "string",
"BasePromptToken": 0
},
"enable_guardrails": true,
"guardrail": {
"EnablePiiDetection": false,
"EnableInjectionDetection": false,
"EnableKeywordCheck": false,
"EnableCustomRules": false,
"EnablePreValidation": true,
"EnablePostValidation": true,
"BannedKeywords": ["string"],
"BannedPatterns": ["string"],
"CustomRules": [
{
"Name": "",
"Pattern": "",
"Severity": "medium",
"AutoBlock": false,
"Message": "",
"EnablePre": true,
"EnablePost": true
}
],
"InputRiskThreshold": 0.7,
"OutputRiskThreshold": 0.8
},
"enable_tools": true,
"tool_ids": ["string"],
"memory_config": {
"LastNConversations": 5,
"EnableSummary": false,
"EnableQuestionSuggestions": false
},
"response_type": "text",
"response_format": "string",
"project_key": "string",
"agent_id": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
enable_ragbooleanNoEnable Retrieval-Augmented Generation (RAG) for the agent.
rag_configobjectNoConfiguration settings for RAG functionality.
llm_configobjectYesLarge Language Model configuration settings.
enable_guardrailsbooleanNoEnable safety guardrails for content moderation.
guardrailobjectNoGuardrail configuration settings.
enable_toolsbooleanNoEnable external tools/integrations for the agent.
tool_idsarrayNoArray of tool identifiers to enable for the agent.
memory_configobjectNoConfiguration for conversation memory and context.
response_typestringNoType of response output (e.g., text, json).
response_formatstringNoFormat specification for the response.
project_keystringYesThe project key for your project.
agent_idstringYesUnique identifier of the agent to be updated.

RAG Configuration Parameters

FieldTypeDescription
TopKintegerNumber of top results to retrieve.
ScoreThresholdnumberMinimum similarity score threshold for retrieved documents.
EmbeddingModelstringName of the embedding model to use.
EmbeddingModelProviderstringProvider of the embedding model (e.g., azure, openai).
ChunkingStrategystringStrategy for splitting documents into chunks.
EnableQueryEnhancementbooleanEnable query enhancement for better retrieval.
EnableRerankbooleanEnable reranking of retrieved results.
DenseWeightnumberWeight for dense retrieval (0.0-1.0).
KeywordWeightnumberWeight for keyword-based retrieval (0.0-1.0).

LLM Configuration Parameters

FieldTypeDescription
ProviderstringLLM provider name (e.g., openai, azure).
ModelNamestringName of the language model.
IsBlocksProviderbooleanWhether using Blocks-managed provider.
ModelIdstringUnique identifier for the model.
TemperaturenumberControls randomness in responses (0.0-1.0).
MaxTokensintegerMaximum number of tokens in the response.
ModelTypestringType of model (e.g., chat, completion).
BasePromptstringSystem prompt or base instructions for the model.
BasePromptTokenintegerToken count for the base prompt.

Guardrail Configuration Parameters

FieldTypeDescription
EnablePiiDetectionbooleanEnable detection of Personally Identifiable Information.
EnableInjectionDetectionbooleanEnable detection of prompt injection attempts.
EnableKeywordCheckbooleanEnable checking for banned keywords.
EnableCustomRulesbooleanEnable custom validation rules.
EnablePreValidationbooleanEnable validation before processing.
EnablePostValidationbooleanEnable validation after processing.
BannedKeywordsarrayList of keywords to block.
BannedPatternsarrayList of regex patterns to block.
CustomRulesarrayArray of custom rule objects.
InputRiskThresholdnumberRisk threshold for input validation (0.0-1.0).
OutputRiskThresholdnumberRisk threshold for output validation (0.0-1.0).

Custom Rule Parameters

FieldTypeDescription
NamestringName of the custom rule.
PatternstringRegex pattern to match.
SeveritystringSeverity level (e.g., low, medium, high).
AutoBlockbooleanAutomatically block content matching this rule.
MessagestringMessage to display when rule is triggered.
EnablePrebooleanEnable rule for pre-validation.
EnablePostbooleanEnable rule for post-validation.

Memory Configuration Parameters

FieldTypeDescription
LastNConversationsintegerNumber of recent conversations to keep in memory.
EnableSummarybooleanEnable conversation summarization.
EnableQuestionSuggestionsbooleanEnable AI-generated follow-up question suggestions.

Response

Success Response (200 OK)

Returns an object containing the update status and details.

{
"is_success": true,
"item_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"detail": "AI configurations updated successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the configuration update was successful.
item_idstringUnique identifier for the updated agent.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"agent_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
422Validation Error - Invalid request parametersUnprocessable Entity