-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: Lark integration closes #3571 #3576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@waleedalzarooni thanks for the contribution. I suppose that would be better that the Lark integration should allow: Agents to access Lark data from:
|
|
@Wendong-Fan @a7m-1st @fengju0213 @JINO-ROHIT There are a couple of conflicts however I don't want to resolve them on the command line in case all the changes in master get included in the diff making reviews difficult. I propose that after reviews are completed I can create a commit updating the branch to master before we merge. |
a7m-1st
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there @waleedalzarooni thanks for the PR, those are my analysis after static review.
I am yet to test it, though I hope meanwhile you can make those simple changes to maintain consistency.
|
|
||
| response = requests.post( | ||
| url, headers=headers, json=body, timeout=30 | ||
| ) | ||
| result = response.json() | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 instances use hard coded timeouts, but we defined it in Args. Perhaps need to use self.timeout:
timeout (Optional[float]): Request timeout in seconds.
fengju0213
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @waleedalzarooni left some comments
camel/toolkits/lark_toolkit.py
Outdated
| logger.error(f"Error getting document: {e}") | ||
| return {"error": f"Error getting document: {e!s}"} | ||
|
|
||
| def lark_get_document_content( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel/toolkits/lark_toolkit.py
Outdated
| logger.error(f"Error listing blocks: {e}") | ||
| return {"error": f"Error listing blocks: {e!s}"} | ||
|
|
||
| def lark_get_block( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel/toolkits/lark_toolkit.py
Outdated
| self, | ||
| document_id: str, | ||
| block_id: str, | ||
| parent_block_id: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can not find the parent_block_id parameter in the doc https://open.larksuite.com/document/server-docs/docs/docs/docx-v1/document-block/batch_delete
camel/toolkits/lark_toolkit.py
Outdated
| self, | ||
| folder_token: Optional[str] = None, | ||
| page_size: int = 50, | ||
| page_token: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cannot find order_by and direction in doc https://open.larksuite.com/document/server-docs/docs/drive-v1/folder/list
camel/toolkits/lark_toolkit.py
Outdated
| logger.error(f"Error listing folder contents: {e}") | ||
| return {"error": f"Error listing folder contents: {e!s}"} | ||
|
|
||
| def lark_get_root_folder_token(self) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel/toolkits/lark_toolkit.py
Outdated
| def lark_create_folder( | ||
| self, | ||
| name: str, | ||
| folder_token: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel/toolkits/lark_toolkit.py
Outdated
| self, | ||
| receive_id: str, | ||
| content: str, | ||
| receive_id_type: Literal[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fengju0213
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @waleedalzarooni and @fengju0213 and sorry for the late review, added one enhance PR: #3685, feel free to check and leave your comment





Description
Adds
LarkToolkitfor integrating CAMEL agents with Lark (Feishu) Open Platform - a popular enterprise collaboration platform similar to Slack + Notion.Features
Authentication
~/.camel/lark_token.json)16 Tools Available
create_document,get_document,get_document_contentlist_document_blocks,get_block,get_block_children,create_block,update_block,delete_blockget_root_folder_token,list_folder_contents,create_foldersend_message,list_chats,get_chat,get_chat_messagesBlock Types Supported: text, heading (1-9), bullet, ordered, code, quote, todo, divider, callout
Configuration
Usage
Files Added
camel/toolkits/lark_toolkit.py- Main implementationexamples/toolkits/lark_toolkit_example.py- Examplestest/toolkits/test_lark_toolkit.py- Unit testsChecklist
Go over all the following points, and put an
xin all the boxes that apply.Fixes #issue-numberin the PR description (required)pyproject.tomlanduv lockIf you are unsure about any of these, don't hesitate to ask. We are here to help!