Skip to content

EkoAI

GET /agents/{agentId}

Get AI Agent based on Id

curl --location 'https://ekoai.ekoapp.com/agents/{agentId}' \
--header 'Authorization: Bearer {token}'

Headers

Name Value
Content-Type application/json
Authorization Bearer <token>

Response

{
"name": "EkoAI_ekoai_demo_ai_assistant",
"type": "tools",
"tools": {
"report_builder": {
"toolName": "report_builder",
"config": {
"timezone": "Asia/Bangkok"
}
},
"research": {
"toolName": "research",
"config": {
"allowedResearchTypes": [
"web_search",
"news",
"images",
"videos",
"shopping",
"places"
]
}
},
"web_scraper": {
"toolName": "web_scraper"
},
"image_generator": {
"toolName": "image_generator",
"config": {
"image_preference": ""
}
}
},
"features": {
"generative_dashboard": true,
"inner_thought": true,
"secure_report": false,
"suggested_questions": true
},
"homeScreen": {
"title": "",
"description": "",
"predefinedPrompts": [
{
"title": "Text me message",
"text": "send me some message",
"icon": {
"color": "#ffb400",
"id": "comment"
}
}
]
},
"systemPrompt": "\n You're a female internal AI assistant to answer employee enquiries within a company called \"Amity\" - a company in Thailand. \n Answer Guidelines:\n Guidelines:\n - You may use markdown syntax to format your responses.\n - Provide comprehensive and detailed answer to the question.\n - [IMPORTANT] Never mention any tool name you are calling - just call the tool using <tool> xml tags and get the result.\n - [IMPORTANT] NEVER make up data or provide false information - always use data returned from the tool.\n\t\t\t- If you're asked about some topic or news, use 'research' tool to perform google search and provide the information using <tool> xml tag\n - Format your response in markdown language - and you can use any markdown table, bold text, or any other markdown syntax as needed.\n \nContext:\n\n## บทสรุปผู้บริหาร\n\nรายงานนี้นำเสนอการวิเคราะห์ยอด stock สินค้าของสาขา 5032 ในวันที่ 1 กุมภาพันธ์ 2024 โดยเปรียบเทียบกับช่วงเวลาต่างๆ และแบ่งตามหมวดหมู่ต่างๆ\n\n**ประเด็นสำคัญ:**\n\n* ยอดขายรวมวันที่ 1 กุมภาพันธ์ 2024: coke zero 1800 ขวด\n* เพิ่มขึ้น 10% เมื่อเทียบกับเมื่อวาน\n\nผลการวิเคราะห์แสดงให้เห็นถึงการเติบโตของยอดขายเมื่อเทียบกับปีก่อน แต่ยังต่ำกว่าเป้าหมายรายสัปดาห์ ซึ่งชี้ให้เห็นถึงโอกาสในการปรับปรุงและเพิ่มยอดขายในช่วงเวลาที่เหลือของสัปดาห์\n\n## การวิเคราะห์ยอดขายรายวัน\n\nยอดขายของสาขา 5032 ในวันที่ 1 กุมภาพันธ์ 2024 coke zero 800 ขวด\n\nเมื่อเปรียบเทียบกับเป้าหมายยอดขายรายสัปดาห์ที่ 2000 ขวด พบว่ายอดขายวันที่ 1 กุมภาพันธ์ 2024 ต่ำกว่าเป้าหมายอยู่ที่ 200 ขวด\n\n## สินค้าคงเหลือ\n\nเมื่อเทียบกับสินค้าใน stock ที่เหลืออยู่ 65 ขวด\n\nและของใน stock ต้องมีมากกว่า 300 ขวด หมายความว่า พนักงานราค้าจะต้องสั่ง 235 ขวดเป็นอย่างต่ำ\n\nอย่างไรก็ตามพนักงานต้องสั่งเป็นแพ็คซึ่งมี 12 ขวด หมายความว่าพนักงานต้อง สั่ง 20 แพ็ค หรือเท่ากับ 240 ขวด\n\n\n## Reference Data\n\n### Data Set 1\n\n| total\\_sales\\_amount |\n| --- |\n| 1800|\n\n### Data Set 2\n\n| SALES\\_TY | WEEKLY\\_TARGET | DIFFERENCE |\n| --- | --- | --- |\n| 1800 | 2000 | -200 |",
"id": "{clientId}",
"networkId": "{networkId}",
"model": "gpt-4o",
"channels": [
{
"channelType": "eko",
"clientId": "{clientId}",
"clientSecret": "{clientSecret}",
"ekoaiUrl": "https://ekogreen-h1.ekoapp.com",
"channelId": "{clientId}"
}
],
"_ts": 1738210137
}

POST ``/agents

Create or Update agent tools

curl --location 'https://ekoai.ekoapp.com/agents' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data '{
"id": "9009e401-cbc7-4963-8932-134873f7d8dd",
"name": "API assistant",
"networkId": "679349450241866197fd98ff",
"type": "tools",
"tools": {
"report_builder": {
"toolName": "report_builder",
"config": {
"timezone": "Asia/Bangkok"
}
},
"research": {
"toolName": "research",
"config": {
"allowedResearchTypes": [
"web_search",
"news",
"images",
"videos",
"shopping",
"places"
]
}
},
"web_scraper": {
"toolName": "web_scraper"
},
"image_generator": {
"toolName": "image_generator",
"config": {
"image_preference": ""
}
},
"query_knowledge_base": {
"toolName": "query_knowledge_base",
"config": {
"knowledgebases": [
{
"id": 5158,
"description": "Knowledge Base 1",
"assistant_secret": "9df85eae23a34a8e635097c9616e1c8cf9d11357bae97ff4d6b2fdf9de1a5399",
"language": "en"
}
]
}
}
},
"systemPrompt": "Act as agent in following conversation example. Write answer without prefix '\''agent'\''.When the user requests private, sensitive, or dynamic information (e.g., PII or transient values like prices, dates, or events), represent such information using placeholder tags in the format <value>.Example dynamic information:user: ticket price today.agent: Today'\''s ticket price is <ticket_price>.<CONTEXT>",
"model": "gpt-4o",
"channels": [
{
"channelType": "eko",
"clientId": "9009e401-cbc7-4963-8932-134873f7d8dd",
"clientSecret": "<CLIENT_SECRET>",
"ekoaiUrl": "https://ekogreen-h1.ekoapp.com",
"channelId": "9009e401-cbc7-4963-8932-134873f7d8dd"
}
],
"homeScreen": {
"title": "",
"description": "",
"predefinedPrompts": [
{
"title": "Text me message",
"text": "send me some message",
"icon": {
"color": "#ffb400",
"id": "comment"
}
}
]
}
}'

Headers

Name Value
Content-Type application/json
Authorization Bearer <token>

Body

FieldTypeDescription
id*StringThe unique identifier for the agent.
name*StringThe name of the agent.
networkId*StringThe ID of the network to which the agent belongs.
type*String

  • ‘tools’: Indicates that the agent uses a set of tools.
  • ‘botsplus’: Indicates that the agent uses the BotsPlus configuration.
  • ‘ekoaistudio’: Indicates that the agent uses the EkoaiStudio configuration.
toolsObjectsAn object containing the configuration for the tools used by the agent. Each key in the object represents a tool name, and the corresponding value is a ToolAssistantConfig object. This field is only applicable when the type is set to ‘tools’.
botsplusConfigObjects

An object containing the configuration for the BotsPlus agent. It is only needed when the type is set to ‘botsplus’. It includes the following fields:

  • secret (string): The secret key for authenticating with the BotsPlus service.
  • endpoint (string, optional): The endpoint URL for the BotsPlus service.
ekoaiStudioConfigObjects

An object containing the configuration for the EkoaiStudio agent. It is only needed when the type is set to ‘ekoaistudio’. It includes the following fields:

  • secret (string): The secret key for authenticating with the EkoaiStudio service.
  • endpoint (string, optional): The endpoint URL for the EkoaiStudio service.
  • workflow (string): The workflow identifier for the EkoaiStudio agent to interact with.
loggingObjects

An object containing the logging configuration for the agent. It includes the following field:

  • line_notify_token (string, optional): The token for sending notifications via LINE Notify on all request response of the agent
systemPromptStringThe system prompt used by the agent to provide instructions or context.
modelAgentModel

The configuration for the agent’s language model. Available options include:

  • ‘gpt-3.5-turbo-0125’
  • ‘gpt-4-0125-preview’
  • ‘claude-3-haiku-20240307’
  • ‘claude-3-sonnet-20240229’
  • ‘claude-3-opus-20240229’
  • ‘accounts/fireworks/models/llama-v3-70b-instruct’
  • ‘accounts/fireworks/models/dbrx-instruct’
channelsArray of Objects

An array of channel configurations for the agent, specifying the channels through which the agent can communicate. Currently only supports eko channel with the following JSON format

  • {
    “clientId”: <clientId of eko bot>,
    “channelType”: “eko”,
    “clientSecret”: <client secret of eko bot>,
    “ekoaiUrl”: <api endpoint of eko bot>,
    “channelId”: <any random ID>
    }
featureObjects

Set of feature flags and configuration to enable / disable for the assistant:

  • generative_dashboard - set to true to enable Generative Dashboard feature for all conversation between all users and this assistant
  • inner_thought - set to true to enable chain-of-thought process before providing response. This allow bots to handle more complex answer and tool chaining
  • secure_report - set to true to secure any report generated from this assistant. User will need to have access to the same Eko network.

Response

{
"status": "success"
}