Skip to content

Commit f67014d

Browse files
committed
uv: init the project
1 parent 99b9423 commit f67014d

5 files changed

Lines changed: 426 additions & 0 deletions

File tree

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
12+
# IDEs
13+
.vscode/
14+
.idea/
15+
16+
# OS X
17+
*.DS_Store

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# OpenAI-API-Polling
2+
3+
Polling OpenAI API without rate limit issues.
4+
5+
## Quickly Start
6+
7+
You can use `pip` to install this package.
8+
9+
```bash
10+
pip install openai-api-polling
11+
```
12+
13+
A simple example:
14+
```python
15+
from openai_api_polling.polling import ClientPolling
16+
17+
api_keys = [
18+
"<your api key a>",
19+
"<your api key> b",
20+
"<your api key> c",
21+
]
22+
client_polling = ClientPolling(api_keys=api_keys)
23+
24+
for _ in range(10):
25+
resp = client_polling.client.chat.completions.create(
26+
model="gpt-4",
27+
messages=[
28+
{"role": "system", "content": "You are a helpful assistant."},
29+
{"role": "user", "content": "Hello! Explain the core of Game Theory."},
30+
]
31+
)
32+
print(resp.choices[0].message.content)
33+
```
34+

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[project]
2+
name = "openai-api-polling"
3+
version = "0.1.0"
4+
description = "Polling OpenAI API without rate limit issues."
5+
readme = "README.md"
6+
authors = [
7+
{ name = "SongTan", email = "sepinetam@gmail.com" }
8+
]
9+
requires-python = ">=3.11"
10+
dependencies = [
11+
"openai>=2.8.1",
12+
]
13+
14+
[project.scripts]
15+
openai-api-polling = "openai_api_polling:main"
16+
17+
[build-system]
18+
requires = ["hatchling"]
19+
build-backend = "hatchling.build"
20+
21+
[project.urls]
22+
Homepage = "https://github.com/sepinetam/openai-api-polling"
23+
Source = "https://github.com/sepinetam/openai-api-polling"

0 commit comments

Comments
 (0)