Skip to content

Conversation

@haoye2
Copy link

@haoye2 haoye2 commented Nov 4, 2025

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

  • Company Search: Advanced company lookup and enrichment
  • Contact Discovery: Find contacts within target companies
  • Authentication: JWT and PKI support with auto-refresh
  • Error Handling: Comprehensive error management and logging
  • Testing: 100% test coverage with mock-based testing

🧪 Testing

  • ✅ 9/9 tests passing (100%)
  • ✅ Mock-based API testing
  • ✅ Authentication flow testing
  • ✅ Error condition handling
  • ✅ Edge case coverage

📚 Documentation

  • Complete README with installation and usage examples
  • API documentation with type hints
  • Configuration guide for environment variables
  • Contributing guidelines

✅ Compliance

  • Follows CAMEL naming conventions (zoominfo_* prefix)
  • Uses CAMEL logging standards
  • Apache 2.0 licensed
  • Pre-commit hooks configured
  • Modern Python project structure

Checklist

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #3316 in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated tests accordingly (required for a bug fix or a new feature)
  • I have updated documentation if needed
  • I have added examples if this is a new feature

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +20 to +51
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


Copy link
Collaborator

@Saedbhati Saedbhati Nov 4, 2025

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

Copy link
Author

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.

Copy link
Collaborator

@waleedalzarooni waleedalzarooni left a 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
Copy link
Collaborator

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.

Copy link
Author

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}")
Copy link
Collaborator

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,
Copy link
Collaborator

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. =========

Copy link
Collaborator

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)

@JINO-ROHIT
Copy link
Collaborator

closing, duplicate

@JINO-ROHIT JINO-ROHIT closed this Nov 6, 2025
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.

[Feature Request] Integrate zoominfo as toolkit

4 participants