Skip to content

integrate Rossum basic 5 api #197

Merged
thisisfixer merged 4 commits intomainfrom
rossum
Apr 18, 2025
Merged

integrate Rossum basic 5 api #197
thisisfixer merged 4 commits intomainfrom
rossum

Conversation

@Justwannasleep
Copy link
Contributor

@Justwannasleep Justwannasleep commented Apr 15, 2025

Overview

This integration implements Rossum API endpoints into our application, providing comprehensive workspace management capabilities including login, document upload, document annotation.

notice
Please note that there is an error in uploading files on the function ROSSUM__UPLOAD_TO_QUEUE .
get response : {'success': False, 'error': "{'detail': 'Multipart form parse error - Invalid boundary in multipart: None', 'code': 'parse_error'}"}

Application URL: https://rossum.ai
API Documentation URL: https://elis.rossum.ai/api/docs

Integrated API

ROSSUM__LOGIN
ROSSUM__GET_DOCUMENT
ROSSUM__GET_QUEUES
ROSSUM__UPLOAD_TO_QUEUE
ROSSUM__GET_ANNOTATION

Fuzzy Tests

docker compose exec runner python
-m
aipolabs.cli.aipolabs
fuzzy-test-function-execution
--aipolabs-api-key
5380c46b933a55a3f00f4738f96c898c5fc123ad844d959d48e38fb63f65237a
--linked-account-owner-id
linhao3370@foxmail.com
--function-name
ROSSUM__LOGIN
--prompt
"organizations is fzguoguo, username is linhao3370@foxmail.com , password is v8EC@W2DLeBRN6G"


docker compose exec runner python
-m
aipolabs.cli.aipolabs
fuzzy-test-function-execution
--aipolabs-api-key
5380c46b933a55a3f00f4738f96c898c5fc123ad844d959d48e38fb63f65237a
--linked-account-owner-id
linhao3370@foxmail.com
--function-name
ROSSUM__UPLOAD_TO_QUEUE
--prompt
"organizations is fzguoguo, queue_id is 1765744, upload file is @\"/Users/linhao/Downloads/O'\''Reilly - Python Cookbook.pdf \""

docker compose exec runner python
-m
aipolabs.cli.aipolabs
fuzzy-test-function-execution
--aipolabs-api-key
5380c46b933a55a3f00f4738f96c898c5fc123ad844d959d48e38fb63f65237a
--linked-account-owner-id
linhao3370@foxmail.com
--function-name
ROSSUM__GET_DOCUMENT
--prompt
"organizations is fzguoguo , document_id is 15743988"


docker compose exec runner python
-m
aipolabs.cli.aipolabs
fuzzy-test-function-execution
--aipolabs-api-key
5380c46b933a55a3f00f4738f96c898c5fc123ad844d959d48e38fb63f65237a
--linked-account-owner-id
linhao3370@foxmail.com
--function-name
ROSSUM__GET_QUEUES
--prompt
"get queues by  organizations frome fzguoguo"


docker compose exec runner python
-m
aipolabs.cli.aipolabs
fuzzy-test-function-execution
--aipolabs-api-key
5380c46b933a55a3f00f4738f96c898c5fc123ad844d959d48e38fb63f65237a
--linked-account-owner-id
linhao3370@foxmail.com
--function-name
ROSSUM__GET_QUEUES
--prompt
"organizations is fzguoguo ID is 8813919"

Videos / IMAGE

--- ROSSUM__LOGIN
image

--- ROSSUM__GET_DOCUMENT
image

--- ROSSUM__GET_QUEUES
image

--- ROSSUM__GET_ANNOTATION
image

--- ROSSUM__UPLOAD_DOCUMENT
image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced Rossum app integration with AI-powered document processing.
    • Added secure API connectivity for document retrieval, queue management, authentication, document upload, and annotation access.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 15, 2025

Walkthrough

This update introduces two new JSON configuration files for integrating the Rossum application. The first file defines the app's metadata, security scheme, and categorization, specifying API key-based authentication and visibility settings. The second file outlines six REST API function definitions for interacting with Rossum's services, including document retrieval, queue listing, authentication, document upload, and annotation retrieval. Each function includes detailed parameter schemas, HTTP method, endpoint paths, and protocol requirements, supporting automated and validated API interactions with Rossum.

Changes

File(s) Change Summary
apps/rossum/app.json Added Rossum app metadata and security configuration, including API key authorization and app categorization.
apps/rossum/functions.json Introduced six REST API function definitions for Rossum: document retrieval, queue listing, login, upload, and annotation retrieval, with strict parameter schemas and endpoint specifications.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RossumApp
    participant RossumAPI

    Client->>RossumApp: Authenticate (POST /auth/login)
    RossumApp->>RossumAPI: Forward credentials
    RossumAPI-->>RossumApp: Return token
    RossumApp-->>Client: Provide token

    Client->>RossumApp: Get Queues (GET /queues) with token
    RossumApp->>RossumAPI: Fetch queues
    RossumAPI-->>RossumApp: Return queue list
    RossumApp-->>Client: Provide queue list

    Client->>RossumApp: Upload Document (POST /queues/{queue_id}/upload)
    RossumApp->>RossumAPI: Upload file to queue
    RossumAPI-->>RossumApp: Confirm upload
    RossumApp-->>Client: Return upload result

    Client->>RossumApp: Get Document/Annotation
    RossumApp->>RossumAPI: Fetch document/annotation by ID
    RossumAPI-->>RossumApp: Return details
    RossumApp-->>Client: Provide details
Loading

Poem

In JSON fields, a story grows,
Of Rossum's docs and queues in rows.
With keys and tokens, headers tight,
API calls now work just right.
Upload, fetch, and annotate—
The rabbits cheer, integrations great!
🐰✨


📜 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 a854cc3 and 199b2e8.

📒 Files selected for processing (1)
  • apps/rossum/functions.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/rossum/functions.json
⏰ 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-15 12:30:46.597

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

Code Review: Rossum API Integration

Overview

I've reviewed the pull request that adds Rossum API integration to your application. The PR adds 5 basic API endpoints for Rossum, which provides document processing capabilities.

Issues and Recommendations

1. Provider Name in app.json

File: apps/rossum/app.json (Line 5)
Issue: The provider name is incorrectly set as "Resend" instead of "Rossum"
Suggestion: Change the provider name to "Rossum" to match the actual service being integrated.

"provider": "Rossum", // Not "Resend"

2. Non-English Description in Function

File: apps/rossum/functions.json (Line 53)
Issue: The description for ROSSUM__GET_QUEUES is in Chinese instead of English
Suggestion: Replace with an English description for consistency:

"description": "Get all queues from the Rossum system",

3. Inconsistent Parameter Requirements

File: apps/rossum/functions.json (Lines 280-281)
Issue: The annotation_id is marked as required in the required array, but organizations is not, despite both being needed for the API call to work.
Suggestion: Add "organizations" to the required array:

"required": [
    "annotation_id",
    "organizations"
],

4. Default Value in Path Parameter

File: apps/rossum/functions.json (Line 188)
Issue: There's a default value for the organizations path parameter that says "example name." which isn't helpful
Suggestion: Either remove the default value or provide a more meaningful placeholder:

"organizations": {
    "type": "string",
    "description": "organizations name"
    // Remove default or provide better example
}

5. Content-Type Header Visibility

File: apps/rossum/functions.json (Line 211)
Issue: The Content-Type header is marked as required but not visible to the LLM
Suggestion: Since this is a critical header for file uploads, consider making it visible:

"visible": ["Content-Type"],

6. Missing Documentation for Upload Error

File: apps/rossum/functions.json (ROSSUM__UPLOAD_TO_QUEUE function)
Issue: The PR description mentions an error with file uploads, but this isn't documented in the function
Suggestion: Add a note in the function description about potential multipart boundary issues:

"description": "Upload a document to a specific queue in Rossum. Note: There may be issues with multipart boundary handling.",

Summary

The Rossum integration adds 5 basic API endpoints for document processing:

  1. Login authentication
  2. Document retrieval
  3. Queue listing
  4. Document upload (with noted issues)
  5. Annotation retrieval

The implementation generally follows good practices for function specifications, with proper parameter definitions and descriptions. The main issues are minor inconsistencies in required fields, a non-English description, and an incorrect provider name.

Overall Assessment

Rating: Acceptable with minor improvements needed

Next Steps for Developer

  1. Fix the provider name in app.json
  2. Translate the Chinese description to English
  3. Make the organizations parameter required where appropriate
  4. Remove or improve default values that aren't helpful
  5. Consider making Content-Type header visible for the upload function
  6. Document the known issue with file uploads in the function description

Once these changes are made, the integration should be ready for use, though the file upload functionality may need additional debugging to resolve the multipart boundary error mentioned in the PR description.

Copy link
Contributor

@thisisfixer thisisfixer left a comment

Choose a reason for hiding this comment

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

see comments

},
{
"name": "ROSSUM__GET_QUEUES",
"description": "获取 Rossum 系统中的所有队列列表",
Copy link
Contributor

Choose a reason for hiding this comment

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

English only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@github-actions
Copy link

ACI Integration Code Review (Sonnet 3.7) - 2025-04-17 16:54:32.167

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

Code Review: Rossum API Integration

File Analysis

apps/rossum/functions.json (New File)

This file adds 5 new functions for the Rossum API integration:

  1. ROSSUM__GET_DOCUMENT - Retrieves a specific document by ID
  2. ROSSUM__GET_QUEUES - Gets all queues
  3. ROSSUM__LOGIN - Authenticates with username/password
  4. ROSSUM__UPLOAD_TO_QUEUE - Uploads a document to a specific queue
  5. ROSSUM__GET_ANNOTATION - Retrieves a specific annotation by ID

apps/github/functions.json (Modified)

This file was modified to clean up formatting (removing extra whitespace and line breaks), but no functional changes were made.

apps/slack/functions.json (Modified)

This file was modified to add example values to some parameters in the SLACK__CONVERSATIONS_REPLIES and other functions.

Issues and Recommendations

1. Rossum Provider Name Mismatch

File: apps/rossum/app.json
Issue: The provider name is set to "Resend" instead of "Rossum"
Recommendation: Update the provider name to match the service:

"provider": "Rossum",

2. Missing Content-Type in ROSSUM__LOGIN

File: apps/rossum/functions.json
Issue: The ROSSUM__LOGIN function specifies content_type in the protocol_data, but doesn't include a Content-Type header
Recommendation: Add a Content-Type header to the function:

"header": {
    "type": "object",
    "properties": {
        "Content-Type": {
            "type": "string",
            "default": "application/json",
            "description": "Content type for the request"
        }
    },
    "required": ["Content-Type"],
    "visible": [],
    "additionalProperties": false
},

3. Inconsistent Required Fields in ROSSUM__GET_ANNOTATION

File: apps/rossum/functions.json
Issue: The organizations field is not marked as required, but it's needed for the server URL
Recommendation: Add organizations to the required array:

"required": [
    "annotation_id",
    "organizations"
],

4. Inconsistent Required Fields in ROSSUM__UPLOAD_TO_QUEUE

File: apps/rossum/functions.json
Issue: The organizations field is not marked as required, but it's needed for the server URL
Recommendation: Add organizations to the required array:

"required": [
    "queue_id",
    "organizations"
],

5. Multipart Form Data Issue in ROSSUM__UPLOAD_TO_QUEUE

File: apps/rossum/functions.json
Issue: The PR description mentions an error with multipart form data in the ROSSUM__UPLOAD_TO_QUEUE function
Recommendation: The boundary parameter might be missing. Update the Content-Type header:

"Content-Type": {
    "type": "string",
    "default": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    "description": "Must be set for file uploads with a proper boundary"
}

6. Default Value for Organizations in ROSSUM__UPLOAD_TO_QUEUE

File: apps/rossum/functions.json
Issue: The organizations field has a default value of "example name." which is not useful
Recommendation: Remove the default value or provide a more meaningful placeholder:

"organizations": {
    "type": "string",
    "description": "Your Rossum organization name"
}

Summary

The PR adds a new integration for Rossum, a document processing API. The implementation includes 5 core functions for authentication, document retrieval, and document processing. The code is generally well-structured, but there are a few issues with required fields and content type headers that should be addressed.

The most significant issue is the multipart form data upload functionality, which according to the PR description is not working correctly. This likely requires adjusting the Content-Type header to include a proper boundary parameter.

Overall Assessment: Needs Improvement

The integration is functional for most operations but has issues with the file upload functionality that need to be addressed before merging.

Next Steps for the Developer:

  1. Fix the provider name in the app.json file
  2. Add proper Content-Type headers to all functions
  3. Make the organizations field required in all functions that use it in the server URL
  4. Fix the multipart form data issue in the ROSSUM__UPLOAD_TO_QUEUE function
  5. Remove or update the default value for the organizations field
  6. Test the file upload functionality after making these changes

Once these issues are addressed, the integration should be ready for use.

@thisisfixer thisisfixer merged commit 2f03d21 into main Apr 18, 2025
4 checks passed
@thisisfixer thisisfixer deleted the rossum branch April 18, 2025 12:53
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