File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ 3.11
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments