diff --git a/docs/api_doc/apis/api-prod-oas30.yaml b/docs/api_doc/apis/api-prod-oas30.yaml index 90a5afb2..442024a9 100644 --- a/docs/api_doc/apis/api-prod-oas30.yaml +++ b/docs/api_doc/apis/api-prod-oas30.yaml @@ -116,6 +116,20 @@ paths: - aicsaicustomerserviceapiconstructApiAuthorizer94F43DD0: [] /chatbot-management/chatbots: get: + summary: List chatbots + description: | + GET /chatbot-management/chatbots - This endpoint retrieves a list of chatbots. The results can be paginated using the 'max_items' and 'page_size' query parameters. + parameters: + - name: "page_size" + in: "query" + schema: + type: "string" + description: Maximum number of items to return + - name: page_size + in: query + schema: + type: integer + description: Number of items per page responses: "400": description: "400 response" @@ -134,10 +148,19 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Empty" + $ref: "#/components/schemas/aicusapicoj51o7moLWF0z" security: - aicsaicustomerserviceapiconstructApiAuthorizer94F43DD0: [] post: + summary: Create chatbots + description: | + POST /chatbot-management/chatbots - This endpoint creates chatbot for intention injection and chat conversation. + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/aicusapicoXPDy1YuPTCzQ" + required: true responses: "400": description: "400 response" @@ -156,7 +179,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Empty" + $ref: "#/components/schemas/aicusapicoM92ois3mRqdG" security: - aicsaicustomerserviceapiconstructApiAuthorizer94F43DD0: [] /chatbot-management/check-chatbot: @@ -186,6 +209,20 @@ paths: # Intention /intention/executions: get: + summary: List upload batch of intention management + description: | + GET /intention/executions - This endpoint retrieves a list of batch. The results can be paginated using the 'max_items' and 'page_size' query parameters. + parameters: + - name: "page_size" + in: "query" + schema: + type: "string" + description: Maximum number of items to return + - name: page_size + in: query + schema: + type: integer + description: Number of items per page responses: "400": description: "400 response" @@ -204,10 +241,19 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Empty" + $ref: "#/components/schemas/aicusapicoIEpQmiPSwa8a" security: - aicsaicustomerserviceapiconstructApiAuthorizer94F43DD0: [] post: + summary: Create intention upload batch + description: | + POST /intention/executions - This endpoint creates upload batch for intention injection. + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/aicusapicoICmkVHXXdPT7" + required: true responses: "400": description: "400 response" @@ -226,11 +272,14 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Empty" + $ref: "#/components/schemas/aicusapicoW39avaSeAfwl" security: - aicsaicustomerserviceapiconstructApiAuthorizer94F43DD0: [] /intention/executions/{executionId}: get: + summary: Detail a upload batch of intention management + description: | + GET /intention/executions/{executionId} - This endpoint retrieves details of a batch. The result contains execution details and injection details . parameters: - name: "intentionId" in: "path" @@ -659,6 +708,94 @@ components: type: "string" message: type: "string" + aicusapicoICmkVHXXdPT7: + title: "PostPayload" + required: + - "chatbotId" + - "index" + - "model" + - "s3Bucket" + - "s3Prefix" + type: "object" + properties: + chatbotId: + type: "string" + index: + type: "string" + model: + type: "string" + s3Prefix: + type: "string" + s3Bucket: + type: "string" + aicusapicoIEpQmiPSwa8a: + title: "ResponsePayload" + type: "object" + properties: + Config: + type: "object" + properties: + PageSize: + type: "integer" + MaxItems: + type: "integer" + Items: + type: "array" + items: + required: + - "chatbotId" + - "createBy" + - "createTime" + - "details" + - "executionId" + - "executionStatus" + - "fileName" + - "index" + - "model" + - "tag" + type: "object" + properties: + executionId: + type: "string" + fileName: + type: "string" + createBy: + type: "string" + chatbotId: + type: "string" + createTime: + type: "string" + executionStatus: + type: "string" + index: + type: "string" + model: + type: "string" + details: + type: "string" + tag: + type: "string" + Count: + type: "integer" + aicusapicoM92ois3mRqdG: + title: "ResponsePayload" + type: "object" + properties: + chatbotId: + type: "string" + groupName: + type: "string" + indexIds: + type: "object" + properties: + qq: + type: "string" + qd: + type: "string" + intention: + type: "string" + Message: + type: "string" aicsaiapicoFa1ujqwjnv8W: title: "ResponsePayload" type: "object" @@ -671,6 +808,57 @@ components: type: "string" s3Bucket: type: "string" + aicusapicoW39avaSeAfwl: + title: "ResponsePayload" + type: "object" + properties: + result: + type: "string" + execution_id: + type: "string" + input_payload: + type: "object" + properties: + chatbotId: + type: "string" + groupName: + type: "string" + tableItemId: + type: "string" + fieldName: + type: "string" + index: + type: "string" + model: + type: "string" + aicusapicoXPDy1YuPTCzQ: + title: "PostPayload" + required: + - "chatbotId" + - "index" + - "modelId" + - "modelName" + type: "object" + properties: + modelName: + type: "string" + chatbotId: + type: "string" + modelId: + type: "string" + index: + required: + - "intention" + - "qd" + - "qq" + type: "object" + properties: + qq: + type: "string" + qd: + type: "string" + intention: + type: "string" aicsaiapicoS7193iOfsONP: title: "PostPayload" required: @@ -724,6 +912,41 @@ components: type: "string" Count: type: "integer" + aicusapicoj51o7moLWF0z: + title: "ResponsePayload" + type: "object" + properties: + chatbot_ids: + type: "array" + items: + type: "string" + Config: + type: "object" + properties: + PageSize: + type: "integer" + MaxItems: + type: "integer" + Items: + type: "array" + items: + required: + - "ChatbotId" + - "LastModifiedTime" + - "ModelId" + - "ModelName" + type: "object" + properties: + ChatbotId: + type: "string" + ModelName: + type: "string" + LastModifiedTime: + type: "string" + ModelId: + type: "string" + Count: + type: "integer" aicsaiapicocohEaD85KKTd: title: "ResponsePayload" type: "object" diff --git a/source/lambda/etl/chatbot_management.py b/source/lambda/etl/chatbot_management.py index d1bc1f9a..6470e88c 100644 --- a/source/lambda/etl/chatbot_management.py +++ b/source/lambda/etl/chatbot_management.py @@ -154,7 +154,7 @@ def __list_chatbot(event, group_name): chatbot_model_item = model_table.get_item( Key={ "groupName": group_name, - "modelId": model_id, + "modelId": f"{chatbot_id}-embedding", } ).get("Item") item_json["ModelName"] = chatbot_model_item.get("parameter", {}).get(