Skip to content

Feat/add aidbase app#223

Merged
thisisfixer merged 4 commits intomainfrom
feat/add-aidbase-app
Apr 17, 2025
Merged

Feat/add aidbase app#223
thisisfixer merged 4 commits intomainfrom
feat/add-aidbase-app

Conversation

@TenTwo07
Copy link
Contributor

@TenTwo07 TenTwo07 commented Apr 17, 2025

Summary

This PR introduces updates and improvements to the functions.json file for the Aidbase application. The changes ensure consistency in naming conventions, descriptions, and parameter structures for all API functions.

APP_URL: https://aidbase.ai
APP_API_DOCS_URL: https://docs.aidbase.ai

Integrated API

AIDBASE__GET_ALL_CHATBOTS - Retrieve a list of all chatbots associated with the user.
AIDBASE__GET_CHATBOT_BY_ID - Retrieve details of a specific chatbot by its unique ID.
AIDBASE__POST_CHATBOT_REPLY - Send a reply to a specific chatbot.
AIDBASE__GET_CHATBOT_KNOWLEDGE - Retrieve all knowledge items associated with a specific chatbot.
AIDBASE__PUT_CHATBOT_KNOWLEDGE - Add or update a knowledge item in a chatbot.
AIDBASE__REMOVE_CHATBOT_KNOWLEDGE - Remove a knowledge item from a chatbot.

Fuzzy Tests

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__GET_ALL_CHATBOTS --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Can you show me all the chatbots in the system?"

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__GET_CHATBOT_BY_ID --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Get the details of the chatbot with ID cvkHIqhSMWaiwRP5O763K."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__POST_CHATBOT_REPLY --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Send the message 'hello?' to the chatbot with ID cvkHIqhSMWaiwRP5O763K."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__GET_CHATBOT_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "show me all the chatbot knowledge,ID='cvkHIqhSMWaiwRP5O763K'."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__PUT_CHATBOT_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Add the knowledge base of the chatbot with ID cvkHIqhSMWaiwRP5O763K for the knowledge item with ID 3facf6c9-4bfe-4524-838d-75ea395eecee."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__REMOVE_CHATBOT_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Remove the knowledge item with ID 3facf6c9-4bfe-4524-838d-75ea395eecee from the chatbot with ID cvkHIqhSMWaiwRP5O763K."

Videos

aidbase.mp4

Summary by CodeRabbit

  • New Features
    • Added integration for the Aidbase application, including app metadata and security configuration.
    • Introduced support for managing Aidbase chatbots via new API endpoints, enabling users to retrieve, update, and interact with chatbots and their knowledge items.

### Summary
General introduction about this PR and this APP.

APP_URL: https://aidbase.ai
APP_API_DOCS_URL: https://docs.aidbase.ai

### Integrated API
AIDBASE__LIST_CHATBOTS - Retrieve a list of all chatbots.
AIDBASE__GET_CHATBOT_DETAILS - Retrieve details of a specific chatbot by ID.
AIDBASE__SEND_REPLY - Send a reply to a specific chatbot.
AIDBASE__GET_KNOWLEDGE - Retrieve the knowledge base of a specific chatbot.
AIDBASE__LIST_KNOWLEDGE - Retrieve the list of all knowledge bases.
AIDBASE__UPDATE_KNOWLEDGE - Add or update a knowledge item in a chatbot.
AIDBASE__DELETE_KNOWLEDGE - Remove a knowledge item from a chatbot.

### Fuzzy Tests
docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__LIST_CHATBOTS --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Can you show me all the chatbots in the system?"

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__GET_CHATBOT_DETAILS --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Get the details of the chatbot with ID cvkHIqhSMWaiwRP5O763K."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__SEND_REPLY --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Send the message 'hello?' to the chatbot with ID cvkHIqhSMWaiwRP5O763K."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__SEND_REPLY --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Send the message '你好吗?' to the chatbot with ID='cvkHIqhSMWaiwRP5O763K' and session_id = PseQjqiKlpyBuYYCPe6zT."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__GET_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Fetch the knowledge base for the chatbot with ID cvkHIqhSMWaiwRP5O763K."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__LIST_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Can you show me all the knowledge bases that have been trained?"

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__UPDATE_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Add the knowledge base of the chatbot with ID cvkHIqhSMWaiwRP5O763K for the knowledge item with ID 3facf6c9-4bfe-4524-838d-75ea395eecee."

docker compose exec runner python -m aipolabs.cli.aipolabs fuzzy-test-function-execution --function-name AIDBASE__DELETE_KNOWLEDGE --linked-account-owner-id <LINKED_ACCOUNT_OWNER_ID> --aipolabs-api-key <AIPOLABS_API_KEY> --prompt "Remove the knowledge item with ID 3facf6c9-4bfe-4524-838d-75ea395eecee from the chatbot with ID cvkHIqhSMWaiwRP5O763K."
修改 AIDBASE__GET_CHATBOT_DETAILS 方法 id 入参的 description
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 17, 2025

Walkthrough

This update introduces two new JSON configuration files for the Aidbase application. The first, app.json, defines the application's metadata, security scheme, categories, and visibility. The second, functions.json, specifies seven REST API endpoints for managing chatbots and their knowledge items, including operations for listing, retrieving, messaging, adding, updating, and removing chatbot data. Each endpoint includes detailed protocol, parameter, and schema definitions to ensure structured and secure API interactions.

Changes

File(s) Change Summary
apps/aidbase/app.json Added a new JSON file defining Aidbase app metadata, integration details, categories, visibility, and security scheme.
apps/aidbase/functions.json Added a new JSON file specifying seven REST API endpoints for chatbot and knowledge item management in Aidbase.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AidbaseAPI

    Client->>AidbaseAPI: GET /v1/chatbots
    AidbaseAPI-->>Client: List of chatbots

    Client->>AidbaseAPI: GET /v1/chatbot/{id}
    AidbaseAPI-->>Client: Chatbot details

    Client->>AidbaseAPI: POST /v1/chatbot/{id}/reply (message, session_id)
    AidbaseAPI-->>Client: AI-generated reply

    Client->>AidbaseAPI: GET /v1/chatbot/{id}/knowledge
    AidbaseAPI-->>Client: List of knowledge items

    Client->>AidbaseAPI: PUT /v1/chatbot/{id}/knowledge (knowledge_item_id)
    AidbaseAPI-->>Client: Updated knowledge item

    Client->>AidbaseAPI: DELETE /v1/chatbot/{id}/knowledge (knowledge_item_id)
    AidbaseAPI-->>Client: Knowledge item removed
Loading

Suggested reviewers

  • thisisfixer

Poem

In JSON fields, a story grows,
Of chatbots wise and workflows flows.
Endpoints ready, schemas tight,
Knowledge added, answers bright.
With headers set and tokens true,
Aidbase welcomes something new!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd076c8 and c9b9f0c.

📒 Files selected for processing (2)
  • apps/aidbase/app.json (1 hunks)
  • apps/aidbase/functions.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test
  • GitHub Check: Format & Lint

Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

ACI Integration Code Review (Sonnet 3.7) - 2025-04-17 15:57:43.072

This review analyzes changes to integration files in the app/ directories.

Code Review: Aidbase App Integration

Overview

I've reviewed the pull request that adds the Aidbase app integration to the platform. The PR introduces a new functions.json file for the Aidbase application, which defines several API endpoints for interacting with chatbots and knowledge bases.

Issues and Recommendations

1. Function Naming Convention

File: apps/aidbase/functions.json
Issue: Some function names don't follow the standard naming convention.

The function names should follow the pattern APPNAME__FUNCTION_NAME with consistent verb-noun ordering. I noticed inconsistencies in the naming:

"name": "AIDBASE__LIST_CHATBOTS",
"name": "AIDBASE__GET_CHATBOT_DETAILS",
"name": "AIDBASE__SEND_REPLY",
"name": "AIDBASE__GET_KNOWLEDGE",
"name": "AIDBASE__LIST_KNOWLEDGE",
"name": "AIDBASE__UPDATE_KNOWLEDGE",
"name": "AIDBASE__DELETE_KNOWLEDGE",

Recommendation: Standardize the function names to follow a consistent pattern:

"name": "AIDBASE__LIST_CHATBOTS",
"name": "AIDBASE__GET_CHATBOT_BY_ID", // More consistent with other GET functions
"name": "AIDBASE__POST_CHATBOT_REPLY", // Specify HTTP method and resource
"name": "AIDBASE__GET_CHATBOT_KNOWLEDGE",
"name": "AIDBASE__LIST_KNOWLEDGE_ITEMS", // Clarify this is listing items
"name": "AIDBASE__PUT_CHATBOT_KNOWLEDGE",
"name": "AIDBASE__REMOVE_CHATBOT_KNOWLEDGE", // or DELETE_CHATBOT_KNOWLEDGE

2. Headers Implementation

File: apps/aidbase/functions.json
Issue: The headers property is defined at the root level of each function object, but it should be inside the parameters object.

Recommendation: Move the headers definition inside the parameters object:

"parameters": {
    "type": "object",
    "properties": {
        "header": {
            "type": "object",
            "description": "Headers for the HTTP request",
            "properties": {
                "accept": {
                    "type": "string",
                    "description": "Content type accepted by the client.",
                    "default": "application/json"
                }
            },
            "required": ["accept"],
            "visible": [],
            "additionalProperties": false
        }
    },
    "required": ["header"],
    "visible": [],
    "additionalProperties": false
}

3. Missing Required and Visible Fields

File: apps/aidbase/functions.json
Issue: Some functions are missing proper required and visible field definitions in their parameters.

Recommendation: Ensure all parameter objects have appropriate required and visible arrays defined. For example:

"parameters": {
    "type": "object",
    "properties": {
        "path": {
            "type": "object",
            "description": "Path parameters.",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Unique identifier for the chatbot",
                    "example": "p-8KP033W9GT8xZMEULqa"
                }
            },
            "required": ["id"],
            "visible": ["id"],
            "additionalProperties": false
        }
    },
    "required": ["path"],
    "visible": ["path"],
    "additionalProperties": false
}

4. Inconsistent Parameter Structure

File: apps/aidbase/functions.json
Issue: The parameter structure is inconsistent across functions. Some have proper path/query/body organization while others don't.

Recommendation: Standardize the parameter structure across all functions to ensure consistency.

Summary

The Aidbase integration adds valuable functionality for managing chatbots and knowledge bases. The implementation is generally good, but there are several areas that need improvement for consistency and adherence to the platform's standards.

Overall Assessment: Needs Improvement

The code is functional but requires standardization in naming conventions, parameter structures, and proper implementation of required/visible fields.

Next Steps for the Developer:

  1. Standardize function names to follow the consistent APPNAME__VERB_NOUN pattern
  2. Move header definitions inside the parameters object
  3. Ensure all parameter objects have proper required and visible field definitions
  4. Standardize parameter structure across all functions
  5. Update the PR description to match the corrected function names

Once these changes are made, the integration will be more consistent with the platform's standards and provide a better experience for users.

@github-actions
Copy link

ACI Integration Code Review (Sonnet 3.7) - 2025-04-17 15:59:00.082

This review analyzes changes to integration files in the app/ directories.

Code Review: Aidbase Integration

Overview

I've reviewed the PR that adds a new Aidbase integration to the platform. The PR adds a new functions.json file for the Aidbase application, which defines several API endpoints for interacting with chatbots.

Findings

1. Function Specifications

The functions.json file defines 6 functions for the Aidbase API:

  • AIDBASE__GET_ALL_CHATBOTS - Retrieve all chatbots
  • AIDBASE__GET_CHATBOT_BY_ID - Get a specific chatbot by ID
  • AIDBASE__POST_CHATBOT_REPLY - Send a reply to a chatbot
  • AIDBASE__GET_CHATBOT_KNOWLEDGE - Get knowledge items for a chatbot
  • AIDBASE__PUT_CHATBOT_KNOWLEDGE - Add/update knowledge item
  • AIDBASE__REMOVE_CHATBOT_KNOWLEDGE - Remove knowledge item

2. Positive Aspects

  • Function naming follows the convention of uppercase app name followed by double underscore and function name
  • All functions have appropriate descriptions, tags, and visibility settings
  • The server URL is correctly specified as https://api.aidbase.ai
  • Required and visible fields are properly defined
  • Authorization is handled via Bearer token in the header as specified in app.json

3. Issues and Recommendations

Issue 3.1: Consistent Header Parameters

File: apps/aidbase/functions.json, all functions
Description: The header parameters are defined with "Accept" (capitalized) but this is inconsistent with other integrations that typically use lowercase "accept".

Recommendation:
Consider standardizing header parameter names to lowercase for consistency across integrations:

"header": {
    "type": "object",
    "description": "header parameters",
    "properties": {
        "accept": {
            "type": "string",
            "description": "The supported media type",
            "default": "application/json"
        }
    },
    "required": [],
    "visible": [],
    "additionalProperties": false
}

Issue 3.2: Missing Content-Type Header for POST/PUT Requests

File: apps/aidbase/functions.json, functions with POST/PUT methods
Description: The POST and PUT requests (AIDBASE__POST_CHATBOT_REPLY, AIDBASE__PUT_CHATBOT_KNOWLEDGE, AIDBASE__REMOVE_CHATBOT_KNOWLEDGE) should include a Content-Type header.

Recommendation:
Add Content-Type header to POST/PUT requests:

"header": {
    "type": "object",
    "description": "header parameters",
    "properties": {
        "Accept": {
            "type": "string",
            "description": "The supported media type",
            "default": "application/json"
        },
        "Content-Type": {
            "type": "string",
            "description": "The content type of the request",
            "default": "application/json"
        }
    },
    "required": ["Content-Type"],
    "visible": [],
    "additionalProperties": false
}

Issue 3.3: Example Values

File: apps/aidbase/functions.json, various functions
Description: While example values are provided for some parameters (which is good), they could be more consistent across all parameters.

Recommendation:
Add example values for all path and body parameters where applicable to improve developer experience.

Summary

The Aidbase integration is well-structured and follows most of the required conventions. The functions are properly defined with appropriate metadata, parameters, and visibility settings. The issues identified are minor and relate to consistency in header parameters and example values.

Overall Assessment: High Quality

The integration is of high quality and ready for use with minor improvements suggested above. The functions cover the core functionality of the Aidbase API for chatbot management and interaction.

Next Steps for Developer:

  1. Consider standardizing header parameter names to lowercase for consistency
  2. Add Content-Type headers to POST/PUT requests
  3. Ensure example values are provided consistently across all parameters
  4. Verify the integration with the suggested fuzzy tests mentioned in the PR description

These changes would further improve the already high-quality integration.

Copy link
Contributor Author

@TenTwo07 TenTwo07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重新推

@thisisfixer thisisfixer merged commit 6c02438 into main Apr 17, 2025
4 checks passed
@thisisfixer thisisfixer deleted the feat/add-aidbase-app branch April 17, 2025 16:11
@coderabbitai coderabbitai bot mentioned this pull request Apr 17, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 16, 2025
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants