-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add ZoomInfo Toolkit for CAMEL-AI framework #3368
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 ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
| from typing import Any, Dict, List, Optional, Literal | ||
| # Try to import from CAMEL framework, fallback to local implementation | ||
| try: | ||
| from camel.toolkits.base import BaseToolkit | ||
| from camel.toolkits import FunctionTool | ||
| from camel.utils import MCPServer, api_keys_required, retry_on_error | ||
| except ImportError: | ||
| # Fallback for testing without full CAMEL installation | ||
| class BaseToolkit: | ||
| def __init__(self, timeout=None): | ||
| self.timeout = timeout | ||
|
|
||
| class FunctionTool: | ||
| def __init__(self, func): | ||
| self.func = func | ||
|
|
||
| def MCPServer(): | ||
| def decorator(cls): | ||
| return cls | ||
| return decorator | ||
|
|
||
| def api_keys_required(keys): | ||
| def decorator(func): | ||
| return func | ||
| return decorator | ||
|
|
||
| def retry_on_error(): | ||
| def decorator(func): | ||
| return func | ||
| return decorator | ||
|
|
||
|
|
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.
you’re integrating inside the camel-ai framework , this fallback becomes redundant
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 @Saedbhati ,I have removed this fallback in #3389. Please let me know in #3389 if there are any new reviews.
waleedalzarooni
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.
Great work @haoye2!,
I left some comments below, thanks again for the contribution.
|
|
||
| # Global variables for token management | ||
| _zoominfo_access_token = None | ||
| _zoominfo_token_expires_at = 0 |
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.
Global variables are not thread-safe. In concurrent environments, multiple threads could simultaneously refresh tokens, causing race conditions. Consider using threading.Lock or a proper token cache.
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 ,I have seen your comment and am making corresponding modifications. I will let you know in #3389 that the modifications are complete.thanks again!
| return response.json() | ||
|
|
||
| except requests.exceptions.RequestException as e: | ||
| raise Exception(f"ZoomInfo API request failed: {e}") |
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.
include some more info here for debugging
for example:
- HTTP status code
- Response body
- Request endpoint
- Original exception type
| headers=request_headers, | ||
| json=json_data, | ||
| params=params, | ||
| timeout=30, |
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.
move method to be a member of the toolkit class so that timeout usage is consistent with the timeout set in __init__
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= | ||
|
|
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.
could you ensure all necessary dependencies are added to pyproject.toml as per the guidelines in Contributing.MD (zi_api_auth_client, pyjwt, cryptography)
|
closing, duplicate |
Fixes #3316
Description
Add comprehensive ZoomInfo API integration to CAMEL-AI framework, enabling AI agents to perform B2B data intelligence, company research, and contact discovery.
🔧 Features
🧪 Testing
📚 Documentation
✅ Compliance
zoominfo_*prefix)Checklist
Fixes #3316in the PR description (required)pyproject.tomlanduv lock