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
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://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
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data 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
| Field | Type | Required | Description |
|---|---|---|---|
| enable_rag | boolean | No | Enable Retrieval-Augmented Generation (RAG) for the agent. |
| rag_config | object | No | Configuration settings for RAG functionality. |
| llm_config | object | Yes | Large Language Model configuration settings. |
| enable_guardrails | boolean | No | Enable safety guardrails for content moderation. |
| guardrail | object | No | Guardrail configuration settings. |
| enable_tools | boolean | No | Enable external tools/integrations for the agent. |
| tool_ids | array | No | Array of tool identifiers to enable for the agent. |
| memory_config | object | No | Configuration for conversation memory and context. |
| response_type | string | No | Type of response output (e.g., text, json). |
| response_format | string | No | Format specification for the response. |
| project_key | string | Yes | The project key for your project. |
| agent_id | string | Yes | Unique identifier of the agent to be updated. |
RAG Configuration Parameters
| Field | Type | Description |
|---|---|---|
| TopK | integer | Number of top results to retrieve. |
| ScoreThreshold | number | Minimum similarity score threshold for retrieved documents. |
| EmbeddingModel | string | Name of the embedding model to use. |
| EmbeddingModelProvider | string | Provider of the embedding model (e.g., azure, openai). |
| ChunkingStrategy | string | Strategy for splitting documents into chunks. |
| EnableQueryEnhancement | boolean | Enable query enhancement for better retrieval. |
| EnableRerank | boolean | Enable reranking of retrieved results. |
| DenseWeight | number | Weight for dense retrieval (0.0-1.0). |
| KeywordWeight | number | Weight for keyword-based retrieval (0.0-1.0). |
LLM Configuration Parameters
| Field | Type | Description |
|---|---|---|
| Provider | string | LLM provider name (e.g., openai, azure). |
| ModelName | string | Name of the language model. |
| IsBlocksProvider | boolean | Whether using Blocks-managed provider. |
| ModelId | string | Unique identifier for the model. |
| Temperature | number | Controls randomness in responses (0.0-1.0). |
| MaxTokens | integer | Maximum number of tokens in the response. |
| ModelType | string | Type of model (e.g., chat, completion). |
| BasePrompt | string | System prompt or base instructions for the model. |
| BasePromptToken | integer | Token count for the base prompt. |
Guardrail Configuration Parameters
| Field | Type | Description |
|---|---|---|
| EnablePiiDetection | boolean | Enable detection of Personally Identifiable Information. |
| EnableInjectionDetection | boolean | Enable detection of prompt injection attempts. |
| EnableKeywordCheck | boolean | Enable checking for banned keywords. |
| EnableCustomRules | boolean | Enable custom validation rules. |
| EnablePreValidation | boolean | Enable validation before processing. |
| EnablePostValidation | boolean | Enable validation after processing. |
| BannedKeywords | array | List of keywords to block. |
| BannedPatterns | array | List of regex patterns to block. |
| CustomRules | array | Array of custom rule objects. |
| InputRiskThreshold | number | Risk threshold for input validation (0.0-1.0). |
| OutputRiskThreshold | number | Risk threshold for output validation (0.0-1.0). |
Custom Rule Parameters
| Field | Type | Description |
|---|---|---|
| Name | string | Name of the custom rule. |
| Pattern | string | Regex pattern to match. |
| Severity | string | Severity level (e.g., low, medium, high). |
| AutoBlock | boolean | Automatically block content matching this rule. |
| Message | string | Message to display when rule is triggered. |
| EnablePre | boolean | Enable rule for pre-validation. |
| EnablePost | boolean | Enable rule for post-validation. |
Memory Configuration Parameters
| Field | Type | Description |
|---|---|---|
| LastNConversations | integer | Number of recent conversations to keep in memory. |
| EnableSummary | boolean | Enable conversation summarization. |
| EnableQuestionSuggestions | boolean | Enable 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
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the configuration update was successful. |
| item_id | string | Unique identifier for the updated agent. |
| detail | string | Success or failure message with additional context. |
| error | object | Error 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
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., body field). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |