Skip to content

Commit

Permalink
Change claude.ai API base url
Browse files Browse the repository at this point in the history
  • Loading branch information
jahwag committed Aug 5, 2024
1 parent e3b3a17 commit fcfa89c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,6 @@ claude.sync
config.json
claudesync.log
claude_chats
some_value
some_value

ROADMAP.md
29 changes: 16 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "claudesync"
version = "0.4.6"
Expand All @@ -18,15 +14,12 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"Click",
"requests",
"pathspec",
"crontab",
"setuptools",
"pytest",
"pytest-cov",
"click_completion",
"tqdm",
"Click>=8.1.7",
"requests>=2.32.3",
"pathspec>=0.12.1",
"crontab>=1.0.1",
"click_completion>=0.5.2",
"tqdm>=4.66.4",
]
keywords = [
"sync",
Expand All @@ -47,13 +40,23 @@ keywords = [
"version control"
]

[project.optional-dependencies]
test = [
"pytest>=8.2.2",
"pytest-cov>=5.0.0",
]

[project.urls]
"Homepage" = "https://github.com/jahwag/claudesync"
"Bug Tracker" = "https://github.com/jahwag/claudesync/issues"

[project.scripts]
claudesync = "claudesync.cli.main:cli"

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["src"]
include = ["claudesync*"]
Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Click>=8.1.7
requests>=2.32.3
pathspec>=0.12.1
crontab>=1.0.1
setuptools>=65.5.1
pytest>=8.2.2
pytest-cov>=5.0.0
click_completion>=0.5.2
tqdm>=4.66.4
tqdm>=4.66.4
pytest-cov>=5.0.0
2 changes: 1 addition & 1 deletion src/claudesync/providers/base_claude_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _get_session_key_expiry():


class BaseClaudeAIProvider(BaseProvider):
BASE_URL = "https://claude.ai/api"
BASE_URL = "https://api.claude.ai/api"

def __init__(self, session_key=None, session_key_expiry=None):
self.config = ConfigManager()
Expand Down
2 changes: 2 additions & 0 deletions src/claudesync/providers/claude_ai_curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def _make_request(self, method, endpoint, data=None):

command = self._build_curl_command(method, url, headers, data)

self.logger.debug(f"Executing command: {' '.join(command)}")

try:
result = subprocess.run(
command, capture_output=True, text=True, check=True, encoding="utf-8"
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/test_claude_ai_curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_make_request_success(self, mock_run, mock_get_session_key):
mock_run.assert_called_once()
args, kwargs = mock_run.call_args
self.assertIn("curl", args[0])
self.assertIn("https://claude.ai/api/test", args[0])
self.assertIn("https://api.claude.ai/api/test", args[0])
self.assertIn("--compressed", args[0])
self.assertIn("-s", args[0])
self.assertIn("-S", args[0])
Expand Down

0 comments on commit fcfa89c

Please sign in to comment.