Skip to content
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

Fix: Default max comparison pairs in resolve.py #147

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
custom rate limits added
  • Loading branch information
staru09 committed Nov 5, 2024
commit bed0b86bc063b7a85c0097cac507ff563bae475a
39 changes: 39 additions & 0 deletions docetl/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,45 @@ def custom_parser(text: str) -> List[str]:
This example shows a complete pipeline configuration with datasets, operations,
steps, and output settings.
"""
DEFAULT_RATE_LIMITS = {
# OpenAI models
"gpt-4o": 1000,
"gpt-4o-mini": 200,
"gpt-3.5-turbo": 500,

# Anthropic models
"claude 3.5-sonnet": 1000,
"claude-3-opus": 500,
"claude-3-sonnet": 400,
"claude-3-haiku": 200,
}

def get_rate_limits(self, model: str) -> dict:
"""Get rate limits for a specific model.

Args:
model: The model identifier (e.g., 'gpt-4o', 'claude-3-sonnet')

Returns:
dict: Rate limit information including requests_per_minute
"""
if self.rate_limits and model in self.rate_limits:
return {
"requests_per_minute": self.rate_limits[model],
"source": "custom"
}

if model in self.DEFAULT_RATE_LIMITS:
return {
"requests_per_minute": self.DEFAULT_RATE_LIMITS[model],
"source": "default"
}

return {
"requests_per_minute": 200,
"source": "fallback"
}


def __init__(
self,
Expand Down