Skip to content

Commit

Permalink
Merge pull request #19 from st1vms/dev-0.3.1
Browse files Browse the repository at this point in the history
Project Rename! Needs repo rename!
  • Loading branch information
st1vms authored Mar 27, 2024
2 parents af2c1ba + aa9985c commit de88d8e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 24 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# unofficial-claude2-api
# unofficial-claude-api

## Table of Contents

Expand Down Expand Up @@ -42,13 +42,13 @@ and more.
## How to install

```shell
pip install unofficial-claude2-api
pip install unofficial-claude-api
```

## Uninstallation

```shell
pip uninstall unofficial-claude2-api
pip uninstall unofficial-claude-api
```

## Requirements
Expand All @@ -65,15 +65,15 @@ pip uninstall unofficial-claude2-api

```python
from sys import exit as sys_exit
from claude2_api.client import (
from claude_api.client import (
ClaudeAPIClient,
SendMessageResponse,
)
from claude2_api.session import SessionData, get_session_data
from claude2_api.errors import ClaudeAPIError, MessageRateLimitError, OverloadError
from claude_api.session import SessionData, get_session_data
from claude_api.errors import ClaudeAPIError, MessageRateLimitError, OverloadError

# Wildcard import will also work the same as above
# from claude2_api import *
# from claude_api import *

# List of attachments filepaths, up to 5, max 10 MB each
FILEPATH_LIST = [
Expand Down Expand Up @@ -192,7 +192,7 @@ If for whatever reason you'd like to avoid auto session gathering using selenium
you just need to manually create a `SessionData` class for `ClaudeAPIClient` constructor, like so...

```python
from claude2_api.session import SessionData
from claude_api.session import SessionData

cookie_header_value = "The entire Cookie header value string when you visit https://claude.ai/chats"
user_agent = "User agent to use, required"
Expand All @@ -215,8 +215,8 @@ __________
If you'd like to set an HTTP proxy for all requests, follow this example:

```py
from claude2_api.client import HTTPProxy, ClaudeAPIClient
from claude2_api.session import SessionData
from claude_api.client import HTTPProxy, ClaudeAPIClient
from claude_api.session import SessionData

# Create HTTPProxy instance
http_proxy = HTTPProxy(
Expand All @@ -236,8 +236,8 @@ client = ClaudeAPIClient(session, proxy=http_proxy)
If you want to opt for SOCKS proxies instead, the procedure is the same, but you need to import the `SOCKSProxy` class instead, configuring it with the version number.

```py
from claude2_api.client import SOCKSProxy, ClaudeAPIClient
from claude2_api.session import SessionData
from claude_api.client import SOCKSProxy, ClaudeAPIClient
from claude_api.session import SessionData

# Create SOCKSProxy instance
socks_proxy = SOCKSProxy(
Expand All @@ -259,8 +259,8 @@ __________
In case you have accounts that are unable to migrate to latest model, you can override the `model_name` string parameter of `ClaudeAPIClient` constructor.

```py
from claude2_api.client import ClaudeAPIClient
from claude2_api.session import SessionData
from claude_api.client import ClaudeAPIClient
from claude_api.session import SessionData

session = SessionData(...)

Expand Down
8 changes: 4 additions & 4 deletions claude2_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""unofficial-claude2-api"""
from .client import (
"""Backward compatibility import (Before dev-0.3.1)"""
from claude_api.client import (
ClaudeAPIClient,
SendMessageResponse,
HTTPProxy,
)
from .session import SessionData, get_session_data
from .errors import ClaudeAPIError, MessageRateLimitError, OverloadError
from claude_api.session import SessionData, get_session_data
from claude_api.errors import ClaudeAPIError, MessageRateLimitError, OverloadError


__all__ = [
Expand Down
20 changes: 20 additions & 0 deletions claude_api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""unofficial-claude-api"""
from .client import (
ClaudeAPIClient,
SendMessageResponse,
HTTPProxy,
)
from .session import SessionData, get_session_data
from .errors import ClaudeAPIError, MessageRateLimitError, OverloadError


__all__ = [
"ClaudeAPIClient",
"SendMessageResponse",
"HTTPProxy",
"SessionData",
"get_session_data",
"MessageRateLimitError",
"ClaudeAPIError",
"OverloadError",
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from os.path import dirname, join, abspath
from setuptools import setup, find_packages

__DESCRIPTION = """Unofficial Claude2 API supporting direct HTTP chat creation/deletion/retrieval, \
multiple message attachments, proxies and auto session gathering using Firefox with geckodriver. \
"""
__DESCRIPTION = """This unofficial Python API provides access to \
the conversational capabilities of Anthropic's Claude AI \
through a simple chat messaging interface."""

with open(
join(abspath(dirname(__file__)), "README.md"),
Expand All @@ -15,14 +15,14 @@
__LONG_DESCRIPTION = fp.read().lstrip().rstrip()

setup(
name="unofficial-claude2-api",
version="0.3.0",
name="unofficial-claude-api",
version="0.3.1",
author="st1vms",
author_email="[email protected]",
description=__DESCRIPTION,
long_description=__LONG_DESCRIPTION,
long_description_content_type="text/markdown",
url="https://github.com/st1vms/unofficial-claude2-api",
url="https://github.com/st1vms/unofficial-claude-api",
packages=find_packages(),
classifiers=[
"Programming Language :: Python :: 3.10",
Expand Down

0 comments on commit de88d8e

Please sign in to comment.