Skip to content

resource pool like ip proxy openai keys and etc...

Notifications You must be signed in to change notification settings

appassionate/respool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

respool

resource pool like ip_proxy openai_keys and etc...

short installation

git clone [address.git]
pip install -e .

example

openaiKeyPool:

read yaml file to respool and iterator generating

from respool.openai import openaiKeyPool
pool = openaiKeyPool.from_yaml("./keys.yaml")
iter_cycle = pool.cycle()

#cycle
for i in range(666):
    _key = next(iter_cycle).key
    print("current key is: ", _key)


# sync validation
res = pool._validate()

# async validation
res = await pool._validate_async()
# res == [True, True, False,...]

#drop invalid resource
pool = pool[res]

yaml example

keys.yaml

- key:  sk-1xxxxxxx
- key:  sk-2xxxxxxx
  freq: 123

resource supporting

  • ipProxyPool: IP proxy
  • openaiKeyPool: openai api key for openai sdk or langchain using.

more feature

  1. validation: sync or async(still developing...)
  2. iterator generating: providing resource under some principle: cycling, randomly
  3. base class for fast developing

About

resource pool like ip proxy openai keys and etc...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages